/* ─── ПРОФИЛЬ ПЕРСОНАЖА ─── */
:root {
    --profile-panel-bg: var(--bg-card);
    --profile-panel-border: var(--border-glass);
    --profile-panel-shadow: var(--shadow-card);
    --profile-header-bg: var(--bg-card);
    --profile-header-border: var(--border-glass);
    --profile-card-bg: var(--bg-card);
    --profile-card-border: var(--border-glass);
    --profile-stat-bg: var(--bg-card);
    --profile-stat-border: var(--border-glass);
}

body.dark-theme {
    --profile-panel-bg: var(--bg-card);
    --profile-panel-border: var(--border-glass);
    --profile-panel-shadow: var(--shadow-card);
    --profile-header-bg: var(--bg-card);
    --profile-header-border: var(--border-glass);
    --profile-card-bg: var(--bg-card);
    --profile-card-border: var(--border-glass);
    --profile-stat-bg: var(--bg-card);
    --profile-stat-border: var(--border-glass);
}

/* ─── SEO-БЛОК (H1 + описание) ─── */
.profile-seo {
    text-align: center;
    margin-bottom: 24px;
}
.profile-page-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}
.profile-page-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.profile-panel {
    background: var(--profile-panel-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--profile-panel-border);
    border-radius: var(--radius);
    box-shadow: var(--profile-panel-shadow);
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
}

.profile-container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.profile-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 20px;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    padding: 0;
}
.profile-back:hover {
    color: var(--text-primary);
}

/* ─── ХЕДЕР ПРОФИЛЯ ─── */
.profile-header {
    background: var(--profile-header-bg);
    border: 1px solid var(--profile-header-border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-wrap: wrap;
}

/* ─── КВАДРАТНЫЙ АВАТАР С ФОТО (только одно фото) ─── */
.profile-photo-block {
    flex: 0 0 340px;
    min-width: 280px;
    max-width: 100%;
    position: relative;
}

.gallery {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--bg-secondary);
    border-radius: 16px;
    cursor: pointer;
}
.gallery .main-slide {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

/* ─── ИНФОРМАЦИЯ О ПЕРСОНАЖЕ ─── */
.profile-info {
    flex: 1;
    padding: 24px 28px 20px;
    min-width: 280px;
}
.profile-info .top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 6px;
}
.profile-info .top-row .name-age {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}
.profile-info .top-row .name-age .name {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.profile-info .top-row .name-age .age {
    font-size: 22px;
    color: var(--text-muted);
    font-weight: 500;
}
.profile-info .top-row .status {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
}
.profile-info .top-row .status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
}

.profile-info .bio-short {
    color: var(--text-secondary);
    font-size: 16px;
    margin: 8px 0 14px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-2);
    font-style: italic;
}

.profile-info .action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}
.profile-info .action-buttons a,
.profile-info .action-buttons button {
    padding: 10px 28px;
    border-radius: var(--radius-full);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}
.profile-info .action-buttons .btn-chat {
    background: var(--gradient-main);
    color: #fff;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.25);
}
.profile-info .action-buttons .btn-chat:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.35);
}
.profile-info .action-buttons .btn-call {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
}
.profile-info .action-buttons .btn-call:hover {
    border-color: var(--accent-1);
    color: #fff;
    background: rgba(139, 92, 246, 0.08);
}

/* ─── ДОПОЛНИТЕЛЬНЫЙ БЛОК С ФОТОГРАФИЯМИ ─── */
.profile-photos-section {
    background: var(--profile-header-bg);
    border: 1px solid var(--profile-header-border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
}

.photos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.photos-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}
.photos-title i {
    color: var(--accent-2);
}
.photos-view-all {
    background: none;
    border: none;
    color: var(--accent-1);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    padding: 6px 12px;
    border-radius: var(--radius-full);
}
.photos-view-all:hover {
    background: rgba(139, 92, 246, 0.06);
    color: var(--accent-1);
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.photo-item {
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    border: 2px solid transparent;
}
.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.photo-item:hover {
    border-color: var(--accent-1);
    transform: scale(1.02);
}
.photo-item:hover img {
    transform: scale(1.05);
}

/* ─── СТАТИСТИКА (2 колонки) ─── */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
@media (max-width: 600px) {
    .profile-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}
.profile-stats .stat-item {
    background: var(--profile-stat-bg);
    border: 1px solid var(--profile-stat-border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    text-align: center;
}
.profile-stats .stat-item .num {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}
.profile-stats .stat-item .label {
    font-size: 12px;
    color: var(--text-muted);
}

/* ─── ОСНОВНАЯ ИНФОРМАЦИЯ ─── */
.profile-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
@media (max-width: 700px) {
    .profile-details {
        grid-template-columns: 1fr;
    }
}

.profile-card {
    background: var(--profile-card-bg);
    border: 1px solid var(--profile-card-border);
    border-radius: var(--radius);
    padding: 16px 18px;
}
.profile-card .card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.profile-card .card-title .icon {
    font-size: 18px;
}
.profile-card .info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
}
.profile-card .info-grid .item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.profile-card .info-grid .item .label {
    color: var(--text-muted);
    font-size: 14px;
}
.profile-card .info-grid .item .value {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}
.profile-card .tags-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}
.profile-card .tags-wrap .tag {
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
}
.profile-card .bio-text {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.8;
    white-space: pre-line;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ─── ЛАЙТБОКС ─── */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(20px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
}
.lightbox-overlay.show {
    display: flex;
}
.lightbox-overlay .lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    z-index: 1001;
    transition: 0.2s;
}
.lightbox-overlay .lightbox-close:hover {
    transform: scale(1.1);
    color: var(--accent-2);
}
.lightbox-overlay .lightbox-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
    z-index: 1001;
}
.lightbox-overlay .lightbox-nav button {
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: 0.2s;
    backdrop-filter: blur(8px);
}
.lightbox-overlay .lightbox-nav button:hover {
    background: rgba(139, 92, 246, 0.4);
}
.lightbox-overlay .lightbox-content-wrapper {
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.lightbox-overlay .lightbox-content {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
}
.lightbox-overlay .lightbox-counter {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    margin-top: 12px;
}
.lightbox-overlay .lightbox-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 80%;
}
.lightbox-overlay .lightbox-thumbs .lb-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.5;
    transition: 0.2s;
}
.lightbox-overlay .lightbox-thumbs .lb-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.lightbox-overlay .lightbox-thumbs .lb-thumb:hover {
    opacity: 0.8;
}
.lightbox-overlay .lightbox-thumbs .lb-thumb.active {
    border-color: var(--accent-1);
    opacity: 1;
}

/* ─── АДАПТИВ ─── */
@media (max-width: 820px) {
    .profile-panel {
        padding: 16px 18px;
        border-radius: var(--radius-sm);
    }
    .profile-photo-block {
        flex: 0 0 100%;
        min-width: 0;
    }
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    .profile-page-title {
        font-size: 28px;
    }
    .profile-page-subtitle {
        font-size: 16px;
    }
}
@media (max-width: 600px) {
    .profile-panel {
        padding: 12px 12px;
    }
    .profile-photo-block {
        flex: 0 0 100%;
        min-width: 0;
    }
    .profile-info {
        padding: 18px 16px 16px;
    }
    .profile-info .top-row .name-age .name {
        font-size: 24px;
    }
    .profile-info .top-row .name-age .age {
        font-size: 18px;
    }
    .profile-info .action-buttons a,
    .profile-info .action-buttons button {
        padding: 8px 18px;
        font-size: 14px;
        flex: 1;
        justify-content: center;
    }
    .profile-card {
        padding: 12px 14px;
    }
    .profile-card .info-grid {
        grid-template-columns: 1fr;
    }
    .profile-stats .stat-item .num {
        font-size: 18px;
    }
    .profile-photos-section {
        padding: 16px 16px;
    }
    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    .photos-title {
        font-size: 16px;
    }
    .lightbox-overlay .lightbox-content {
        max-height: 60vh;
    }
    .lightbox-overlay .lightbox-thumbs .lb-thumb {
        width: 44px;
        height: 44px;
    }
    .profile-page-title {
        font-size: 24px;
    }
    .profile-page-subtitle {
        font-size: 14px;
    }
}
