/* ====== СТРАНИЦА ПРОФИЛЯ ====== */

body.page-profile .profile-container {
    display: flex;
    min-height: calc(100vh - var(--header-height));
}

body.page-profile .profile-sidebar {
    width: var(--sidebar-width);
    padding: var(--spacing-xl) var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: static;
    top: auto;
    height: auto;
    overflow-y: visible;
}

body.page-profile .user-card {
    text-align: center;
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 25px 20px;
    box-shadow: var(--shadow-light);
    border: 1px solid rgba(var(--palette-primary-rgb), 0.2);
}

body.page-profile .user-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--gradient-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2rem;
    font-weight: bold;
    margin: 0 auto 20px;
    border: 4px solid rgba(255, 255, 255, 0.2);
}

body.page-profile .user-rank {
    color: var(--bold-blue);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

body.page-profile .user-school {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

body.page-profile .profile-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

body.page-profile .profile-nav-item {
    padding: 15px 20px;
    background: var(--bg-card);
    border: 1px solid rgba(var(--palette-primary-rgb), 0.2);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 0.95rem;
}

body.page-profile .profile-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: rgba(var(--palette-primary-rgb), 0.4);
}

body.page-profile .profile-nav-item.active {
    background: rgba(var(--palette-primary-rgb), 0.2);
    color: var(--text-primary);
    border-color: var(--primary-blue);
}

body.page-profile .profile-nav-item i {
    width: 20px;
}

body.page-profile .profile-content {
    flex: 1;
    padding: var(--spacing-xxl);
    overflow: visible;
    background: var(--bg-primary);
}

body.page-profile .profile-section {
    display: none;
}

body.page-profile .profile-section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

/* Прогресс уровня */

body.page-profile .level-progress-container {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 25px;
    margin: 30px 0;
    border: 1px solid rgba(var(--palette-primary-rgb), 0.2);
}

body.page-profile .level-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

body.page-profile .level-progress-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

body.page-profile .level-progress-text {
    color: var(--bold-blue);
    font-size: 0.95rem;
    font-weight: 600;
}

body.page-profile .level-progress-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
}

body.page-profile .level-progress-fill {
    height: 100%;
    background: var(--gradient-blue);
    border-radius: 5px;
    width: 65%;
    transition: width 0.5s ease;
}

/* Достижения */

body.page-profile .badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

body.page-profile .badge-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

body.page-profile .badge-card:hover {
    transform: translateY(-5px);
    border-color: var(--bold-blue);
}

body.page-profile .badge-card.locked {
    opacity: 0.6;
    filter: grayscale(50%);
}

body.page-profile .badge-card.earned::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

body.page-profile .badge-icon {
    width: 60px;
    height: 60px;
    background: rgba(var(--palette-primary-rgb), 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: var(--secondary-blue);
    font-size: 1.5rem;
    border: 2px solid currentColor;
}

body.page-profile .badge-title {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 8px;
}

body.page-profile .badge-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 15px;
}

body.page-profile .badge-status {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 15px;
    display: inline-block;
}

body.page-profile .badge-status.earned {
    background: rgba(49, 160, 152, 0.2);
    color: var(--bold-blue);
}

body.page-profile .badge-status.locked {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

/* История активности */

body.page-profile .activity-list {
    margin-top: 20px;
}

body.page-profile .activity-item {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 15px;
    border-left: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: slideIn 0.5s ease-out forwards;
    opacity: 0;
    transform: translateX(-20px);
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

body.page-profile .activity-item:nth-child(1) {
    animation-delay: 0.1s;
}

body.page-profile .activity-item:nth-child(2) {
    animation-delay: 0.2s;
}

body.page-profile .activity-item:nth-child(3) {
    animation-delay: 0.3s;
}

body.page-profile .activity-item:nth-child(4) {
    animation-delay: 0.4s;
}

body.page-profile .activity-item:nth-child(5) {
    animation-delay: 0.5s;
}

body.page-profile .activity-item:nth-child(6) {
    animation-delay: 0.6s;
}

body.page-profile .activity-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

body.page-profile .activity-icon {
    width: 50px;
    height: 50px;
    background: rgba(var(--palette-primary-rgb), 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-blue);
    font-size: 1.2rem;
    flex-shrink: 0;
}

body.page-profile .activity-content {
    flex: 1;
}

body.page-profile .activity-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    font-size: 1rem;
}

body.page-profile .activity-time {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

body.page-profile .profile-event-meta {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

body.page-profile .activity-type {
    font-size: 0.82rem;
    font-weight: 700;
}

body.page-profile .event-ticket-placeholder {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid rgba(var(--palette-primary-rgb), 0.16);
    border-radius: 10px;
    background: rgba(var(--palette-primary-rgb), 0.08);
    color: var(--bold-blue);
    font-family: var(--site-heading-font-family);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

body.page-profile .profile-events-empty {
    padding: clamp(24px, 5vw, 48px);
    border: 1px dashed rgba(var(--palette-primary-rgb), 0.2);
    border-radius: 18px;
    background: rgba(var(--palette-primary-rgb), 0.06);
    color: var(--text-secondary);
    text-align: center;
}

body.page-profile .activity-xp {
    background: rgba(255, 209, 102, 0.1);
    color: var(--accent-gold);
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* График посещаемости */

body.page-profile .attendance-chart {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-top: 30px;
    border: 1px solid rgba(var(--palette-primary-rgb), 0.2);
}

body.page-profile .chart-title {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 20px;
    font-weight: 600;
}

body.page-profile .chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    height: 200px;
    padding: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

body.page-profile .chart-bar {
    flex: 1;
    background: var(--gradient-blue);
    border-radius: 5px 5px 0 0;
    min-height: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: height 0.5s ease;
    animation: growBar 1s ease-out forwards;
    opacity: 0;
}

@keyframes growBar {
    from {
        opacity: 0;
        height: 0;
    }

    to {
        opacity: 1;
    }
}

body.page-profile .chart-value {
    position: absolute;
    top: -25px;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
}

body.page-profile .chart-label {
    position: absolute;
    bottom: -30px;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

body.page-profile .user-card .user-name {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

body.page-profile .settings-form {
    background: var(--bg-card);
    border: 1px solid rgba(var(--palette-primary-rgb), 0.2);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-top: 20px;
}

body.page-profile .action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

body.page-profile .section-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

body.page-profile .section-lead {
    color: var(--text-secondary);
    margin: -8px 0 0;
    line-height: 1.5;
}

body.page-profile .completion-summary {
    flex: 0 0 auto;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(49, 160, 152, 0.14);
    color: var(--bold-blue);
    font-weight: 700;
    white-space: nowrap;
}

body.page-profile .achievement-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 34px;
    margin-top: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
}

body.page-profile .achievement-toolbar p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

body.page-profile .game-progress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

body.page-profile .game-progress-card {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 12px;
    align-items: center;
    padding: 16px;
    border-radius: 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

body.page-profile .game-progress-card:hover {
    transform: translateY(-3px);
    border-color: rgba(49, 160, 152, 0.55);
    box-shadow: var(--shadow-light);
}

body.page-profile .game-progress-card.completed {
    border-color: rgba(46, 125, 50, 0.5);
    background: linear-gradient(135deg, rgba(46, 125, 50, 0.12), var(--bg-card));
}

body.page-profile .game-progress-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    color: var(--secondary-blue);
    background: rgba(var(--palette-primary-rgb), 0.16);
    font-size: 1.15rem;
}

body.page-profile .game-progress-card.completed .game-progress-icon {
    color: var(--color-success);
    background: rgba(46, 125, 50, 0.2);
}

body.page-profile .game-progress-copy {
    min-width: 0;
}

body.page-profile .game-progress-copy h3 {
    margin: 0 0 5px;
    color: var(--text-primary);
    font-size: 1rem;
}

body.page-profile .game-progress-copy p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

body.page-profile .game-progress-meta {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 0.78rem;
}

body.page-profile .game-progress-status {
    color: var(--text-secondary);
}

body.page-profile .game-progress-card.completed .game-progress-status {
    color: var(--color-success);
    font-weight: 700;
}

body.page-profile .game-progress-status i {
    margin-right: 5px;
}

body.page-profile .game-progress-xp {
    color: var(--accent-gold);
    font-weight: 700;
}

body.page-profile .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

body.page-profile .stats-grid .stat-card {
    transition: transform 0.2s ease, border-color 0.2s ease;
}

body.page-profile .stats-grid .stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(49, 160, 152, 0.5);
}

@media (max-width: 992px) {
    body.page-profile .profile-container {
        flex-direction: column;
    }

    body.page-profile .profile-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid rgba(var(--palette-primary-rgb), 0.3);
        position: static;
        height: auto;
    }

    body.page-profile .profile-content {
        padding: var(--spacing-xl);
    }
}

@media (max-width: 768px) {
    body.page-profile .section-heading-row {
        flex-direction: column;
    }

    body.page-profile .completion-summary {
        align-self: flex-start;
    }

    body.page-profile .badges-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    body.page-profile .activity-item {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    body.page-profile .profile-event-meta {
        width: 100%;
        align-items: flex-start;
        padding-left: 65px;
    }
}

@media (max-width: 480px) {
    body.page-profile .badges-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    body.page-profile .profile-sidebar {
        padding: 14px 12px 12px;
        gap: 12px;
    }

    body.page-profile .user-card {
        padding: 18px 14px;
    }

    body.page-profile .user-avatar-large {
        width: 78px;
        height: 78px;
        margin-bottom: 12px;
    }

    body.page-profile .profile-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    body.page-profile .profile-nav::-webkit-scrollbar {
        display: none;
    }

    body.page-profile .profile-nav-item {
        flex: 0 0 auto;
        min-height: 44px;
        padding: 10px 13px;
        font-size: 0.84rem;
        white-space: nowrap;
    }

    body.page-profile .profile-content {
        padding: 18px 12px 28px;
    }

    body.page-profile .level-progress-container,
    body.page-profile .attendance-chart,
    body.page-profile .settings-form {
        padding: 16px;
        margin: 18px 0;
    }

    body.page-profile .level-progress-header,
    body.page-profile .achievement-toolbar {
        align-items: flex-start;
        gap: 8px;
        flex-direction: column;
    }

    body.page-profile .badges-grid,
    body.page-profile .game-progress-grid,
    body.page-profile .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    body.page-profile .badge-card,
    body.page-profile .game-progress-card {
        padding: 14px;
    }

    body.page-profile .activity-item {
        gap: 10px;
        padding: 14px;
    }

    body.page-profile .profile-event-meta {
        padding-left: 60px;
    }
}



.profile-privacy-consent .checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary, #a8b2d1);
    cursor: pointer;
}

.profile-privacy-consent input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #1da1f2;
}

.account-danger-zone {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(230, 57, 70, .25);
}

.btn-danger {
    border: 1px solid rgba(230, 57, 70, .7);
    background: rgba(230, 57, 70, .12);
    color: #ff8f98;
}

.btn-danger:hover {
    background: rgba(230, 57, 70, .22);
}
