/* ========== RESET & GLOBAL ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f5f7fb;
    color: #1e2a3e;
    line-height: 1.5;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== TYPOGRAPHY ========== */
.section-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #2c3e66;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}
.btn-sm { padding: 6px 16px; font-size: 13px; }
.btn-block { width: 100%; text-align: center; }

.btn-primary {
    background: #ff6b6b;
    color: white;
}
.btn-primary:hover { background: #ff5252; }

.btn-outline {
    background: transparent;
    border: 1px solid #cbd5e0;
    color: #2c3e66;
}
.btn-outline:hover { background: #edf2f7; }

.btn-success {
    background: #2c3e66;
    color: white;
}
.btn-success:hover { background: #1e2c4a; }

.btn-warning {
    background: #ffb347;
    color: #2c3e66;
}
.btn-warning:hover { background: #ffa01e; }

.btn-secondary {
    background: #e2e8f0;
    color: #2c3e66;
}
.btn-secondary:hover { background: #cbd5e0; }

/* ========== HEADER ========== */
.site-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 0;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 26px;
    color: #1e2a3e;
}
.heart-swirl {
    display: flex;
    gap: 4px;
    animation: swirl 2s infinite ease-in-out;
}
.heart-swirl span {
    display: inline-block;
    font-size: 24px;
}
@keyframes swirl {
    0% { transform: rotate(0deg) scale(1); opacity: 0.7; }
    50% { transform: rotate(15deg) scale(1.2); opacity: 1; }
    100% { transform: rotate(0deg) scale(1); opacity: 0.7; }
}
.main-nav {
    display: flex;
    list-style: none;
    gap: 28px;
}
.main-nav a {
    text-decoration: none;
    color: #2c3e66;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}
.main-nav a:hover {
    color: #ff6b6b;
}
.auth-buttons {
    display: flex;
    gap: 12px;
}
.user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}
.user-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.user-name {
    font-weight: 500;
}
.dropdown-menu {
    margin-top: -10px;
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 220px;
    padding: 8px 0;
    display: none;
    z-index: 200;
}
.user-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #2c3e66;
    text-decoration: none;
    font-size: 14px;
}
.dropdown-menu a:hover { background: #f1f5f9; }
.dropdown-menu .danger { color: #e53e3e; }
.divider { height: 1px; background: #e2e8f0; margin: 6px 0; }

/* ========== ГАЛЕРЕЯ-КАРУСЕЛЬ ========== */
.gallery-carousel {
    background: white;
    border-radius: 24px;
    padding: 20px;
    margin: 30px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.carousel-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 8px;
}
.carousel-item {
    flex: 0 0 100px;
    text-align: center;
}
.carousel-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 8px;
}
.carousel-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.carousel-name {
    font-weight: 600;
    font-size: 14px;
}
.carousel-age {
    font-size: 12px;
    color: #5f7f9e;
}

/* ========== ТРЁХКОЛОНОЧНАЯ СЕТКА ========== */
.three-columns {
    display: grid;
    grid-template-columns: 280px 1fr 300px;
    gap: 30px;
    margin: 30px 0;
}
/* Класс для скрытия правой колонки */
.three-columns.no-right-sidebar {
    grid-template-columns: 280px 1fr;
}
.three-columns.no-right-sidebar .right-sidebar {
    display: none;
}

/* Адаптивность */
@media (max-width: 1024px) {
    .three-columns {
        grid-template-columns: 1fr 300px;
    }
    .three-columns.no-right-sidebar {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .three-columns {
        grid-template-columns: 1fr;
    }
    .three-columns.no-right-sidebar {
        grid-template-columns: 1fr;
    }
}

/* ========== WIDGETS (левая колонка) ========== */
.widget {
    background: white;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    border: 1px solid #eef2f8;
}
.widget h3 {
    font-size: 18px;
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2c3e66;
}

.widget p {
    margin-bottom: 12px;
}
.welcome-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.welcome-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 12px;
    object-fit: cover;
}
.user-badge {
    background: #f0f4fa;
    border-radius: 40px;
    padding: 6px 12px;
    font-size: 13px;
    margin: 12px 0;
}
.quick-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.quick-actions a {
    background: #edf2f7;
    padding: 6px 12px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 13px;
    color: #2c3e66;
}
.auth-widget .form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e0;
    border-radius: 40px;
    margin-bottom: 12px;
}
.auth-links {
    text-align: center;
    margin-top: 12px;
}
.social-auth {
    margin-top: 20px;
    text-align: center;
}
.social-icons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 12px 0;
}
.social-icons a {
    background: #f1f5f9;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #2c3e66;
    transition: 0.2s;
}
.social-icons a:hover { background: #e2e8f0; }
.google-warning {
    font-size: 11px;
    color: #e53e3e;
    background: #fff5f5;
    padding: 4px 8px;
    border-radius: 30px;
    display: inline-block;
}
.quick-reg .btn-block { margin-top: 10px; }
.popular-list ul, .tips-widget ul, .events-widget ul {
    list-style: none;
}
.popular-list li, .tips-widget li, .events-widget li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}
.popular-list a, .tips-widget a, .events-widget a {
    text-decoration: none;
    color: #2c3e66;
}
.likes { color: #ff6b6b; font-size: 13px; }
.more-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 13px;
    color: #ff6b6b;
    text-decoration: none;
}

/* ========== ПРАВАЯ КОЛОНКА (виджеты) ========== */
.search-widget .form-group {
    margin-bottom: 14px;
}
.search-widget label {
    display: block;
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 6px;
}
.form-select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 30px;
    border: 1px solid #cbd5e0;
    background: white;
}
.age-range {
    display: flex;
    gap: 10px;
    align-items: center;
}
.age-range input {
    width: 80px;
    padding: 6px;
    border-radius: 30px;
    border: 1px solid #cbd5e0;
}
.online-users-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.online-user {
    display: flex;
    align-items: center;
    gap: 12px;
}
.online-user img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* ========== ЦЕНТРАЛЬНАЯ КОЛОНКА (список анкет) ========== */
.users-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.user-card-horizontal {
    background: white;
    border-radius: 20px;
    display: flex;
    gap: 20px;
    padding: 16px;
    border: 1px solid #eef2f8;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.user-card-horizontal:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.1);
}
.card-photo {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 20px;
    overflow: hidden;
    flex-shrink: 0;
}
.card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.online-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 14px;
    height: 14px;
    background: #2ecc71;
    border: 2px solid white;
    border-radius: 50%;
}
.card-info {
    flex: 1;
}
.card-name {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}
.card-name a {
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    color: #1e2a3e;
}
.age {
    font-size: 15px;
    color: #5f7f9e;
}
.card-location {
    font-size: 13px;
    color: #5f7f9e;
    margin-bottom: 8px;
}
.card-status {
    margin: 10px 0;
    font-size: 13px;
}
.online-text { color: #2ecc71; }
.offline-text { color: #94a3b8; }
.more-users-btn {
    text-align: center;
    margin-top: 24px;
}
.seo-block {
    background: #f8fafc;
    border-radius: 20px;
    padding: 20px;
    margin-top: 30px;
    font-size: 14px;
    color: #334155;
}
.seo-block h1 {
    font-size: 18px;
    margin-bottom: 12px;
    color: #2c3e66;
}

/* ========== ДЕТАЛЬНАЯ АНКЕТА (появляется вместо списка) ========== */
.profile-detail {
    background: white;
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 24px;
}
.btn-back {
    background: none;
    border: none;
    color: #ff6b6b;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    font-size: 14px;
}
.btn-back i {
    margin-right: 6px;
}
.profile-layout {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}
.profile-photos {
    flex: 1;
    min-width: 200px;
}
.main-photo {
    width: 100%;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 15px;
}
.main-photo img {
    width: 100%;
    height: auto;
    display: block;
}
.additional-photos {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.photo-thumb {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}
.photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-info-main {
    flex: 1;
    min-width: 250px;
}
.profile-info-main h2 {
    font-size: 28px;
    margin-bottom: 8px;
}
.profile-badge {
    display: inline-block;
    background: #eef2f5;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 14px;
    margin-bottom: 12px;
}
.profile-city {
    margin-bottom: 8px;
    color: #2c3e66;
}
.profile-status {
    margin: 12px 0;
}
.profile-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}
.profile-section {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #eef2f8;
}
.profile-section h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: #2c3e66;
}
.interests-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.interest-tag {
    background: #eef2f5;
    border-radius: 30px;
    padding: 4px 12px;
    font-size: 13px;
}
.info-list {
    list-style: none;
}
.info-list li {
    margin-bottom: 8px;
}
.loading-spinner {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #2c3e66;
}
.favorite-btn .fa-heart {
    color: #ff6b6b;
}

/* ========== ФУТЕР ========== */
.site-footer {
    background: #0f172a;
    color: #cbd5e0;
    padding: 40px 0 20px;
    margin-top: 40px;
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}
.footer-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 22px;
    font-weight: bold;
    color: white;
    margin-bottom: 12px;
}
.footer-desc {
    font-size: 13px;
    margin-bottom: 12px;
}
.footer-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
}
.footer-col h4 {
    color: white;
    margin-bottom: 16px;
    font-size: 16px;
}
.footer-col ul {
    list-style: none;
}
.footer-col li {
    margin-bottom: 10px;
}
.footer-col a {
    color: #cbd5e0;
    text-decoration: none;
    font-size: 13px;
}
.footer-col a:hover { color: #ff6b6b; }
.social-links {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}
.social-links a {
    background: #1e293b;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.age-restricted {
    width: 50px;
    height: 50px;
    background: #1e293b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    color: #ff6b6b;
}
.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #1e293b;
    font-size: 12px;
}
@media (max-width: 800px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 500px) {
    .footer-grid { grid-template-columns: 1fr; }
}

/* ========== ВСПОМОГАТЕЛЬНЫЕ КЛАССЫ ========== */
.error-alert {
    background: #fee2e2;
    border-left: 4px solid #e53e3e;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #c53030;
}
.mt15 { margin-top: 15px; }
/* ========== МОДАЛЬНАЯ ГАЛЕРЕЯ ========== */
/* Модальная галерея – фиксированный контейнер */
.gallery-image-container {
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    max-height: 80vh;
    width: 100%;
    background: #000;
}
.gallery-image-container img {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: none; /* убираем анимацию, чтобы не дёргалось */
}
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.gallery-modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gallery-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}
.gallery-prev, .gallery-next {
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    font-size: 30px;
    padding: 12px;
    cursor: pointer;
    border-radius: 50%;
    transition: 0.2s;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
}
.gallery-prev:hover, .gallery-next:hover {
    background: rgba(0,0,0,0.8);
}
.gallery-image-container {
    flex: 1;
    text-align: center;
}
.gallery-image-container img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
}
.gallery-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    background: rgba(0,0,0,0.6);
    padding: 4px 12px;
    border-radius: 30px;
}
@media (max-width: 768px) {
    .gallery-prev, .gallery-next {
        font-size: 20px;
        width: 35px;
        height: 35px;
    }
    .gallery-close {
        font-size: 30px;
        top: -30px;
    }
}
.gallery-image-container img {
    transition: opacity 0.2s;
}
/* Сворачиваемые секции */
.profile-section.collapsible .collapsible-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
}
.profile-section.collapsible .toggle-icon {
    transition: transform 0.2s;
}
.profile-section.collapsible .toggle-icon.rotated {
    transform: rotate(180deg);
}
.profile-section.collapsible .collapsible-content {
    display: none;
    margin-top: 12px;
}
.profile-section.collapsible .collapsible-content.open {
    display: block;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.pagination-btn {
    background: white;
    border: 1px solid #cbd5e0;
    border-radius: 30px;
    padding: 8px 14px;
    cursor: pointer;
    font-weight: 500;
    transition: 0.2s;
}
.pagination-btn.active {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: white;
}
.pagination-btn:hover:not(.active) {
    background: #edf2f7;
}
.pagination-dots {
    padding: 0 4px;
    color: #2c3e66;
    font-size: 14px;
}
/*Чат*/
.chat-date-divider {
    text-align: center;
    margin: 15px 0;
    position: relative;
}
.chat-date-divider span {
    background: #e2e8f0;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: #2c3e66;
}
.message-sender {
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 4px;
    color: #ff6b6b;
}
.message-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 10px;
}
.message-status i {
    color: #2ecc71;
    font-size: 14px;
    font-style: normal;
}
.message-status {
    display: inline-flex;
    align-items: center;
    gap: 0;
}
.unread-contacts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.unread-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 12px;
    transition: background 0.2s;
    cursor: pointer;
}
.unread-contact:hover {
    background: #f0f4fa;
}
.unread-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.unread-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.unread-name {
    font-weight: 500;
}
.unread-badge {
    background: #ff6b6b;
    color: white;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: bold;
}
