/* === REFINED KYIVPROJECT CABINET STYLE - WIDER & CLEANER - v2.5 === */

/* Main Container - EXACT WIDTH MATCH TO NAVBAR */
.cabinet-content {
    max-width: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cabinet-main-wrapper {
    background: var(--bg-navbar);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    margin-top: 20px;
    margin-bottom: 40px;

    /* FIX: Use 90% of parent (which is full width) to match navbar width */
    width: calc(100% - 60px);
    max-width: 1140px;

    margin-left: auto;
    margin-right: auto;
    display: flex;
    overflow: hidden;
    box-shadow: 0 10px 40px var(--shadow-color);
    position: relative;
    backdrop-filter: blur(20px);
}

/* 1. Left Sidebar Strip */
.cabinet-sidebar {
    width: 80px;
    border-right: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 30px;
    padding-bottom: 30px;
    /* Added padding bottom */
    flex-shrink: 0;
}

/* Avatar Box */
.sidebar-avatar-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    transition: all 0.3s ease;
    cursor: pointer;
}

.sidebar-avatar-box:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-hover);
    transform: scale(1.05);
}

.sidebar-avatar-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

/* Sidebar Logout Button */
.sidebar-logout-btn {
    margin-top: auto;
    /* Push to bottom */
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-logout-btn:hover {
    color: #ef4444;
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.3);
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.2);
}

.sidebar-logout-btn:active {
    transform: scale(0.95);
}

/* 2. Right Content Area */
.cabinet-right-content {
    flex: 1;
    padding: 30px 40px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* -- Top Row Grid -- */
.cabinet-top-row {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 25px;
    height: 400px;
}

/* Universal Card Style */
.cabinet-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    background-clip: padding-box;
}

/* HOVER EFFECT FIX: No thick borders, just subtle light */
.cabinet-card:hover {
    /* Kept border same width, just accent color OR just shadow */
    border-color: rgba(249, 134, 82, 0.4);
    box-shadow: 0 0 25px rgba(249, 134, 82, 0.15);
    /* Soft diffused glow */
    transform: translateY(-2px);
}

/* REMOVE THICK ORANGE BAR ON HOVER */
.cabinet-card::before {
    display: none !important;
}

/* Skin Block */
.skin-block {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cabinet-skin-container {
    width: 100%;
    height: 100%;
}

.cabinet-skin-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Info + Bio Block */
.info-bio-block {
    display: flex;
    flex-direction: column;
    padding: 30px;
}

/* Header Part */
.info-header-part {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.header-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#cabinetUsername {
    font-size: 32px;
    margin: 0;
    color: var(--accent-color);
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.tag-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 15px;
    /* Increased padding slightly for better look */
    border-radius: 8px;
    width: 210px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    overflow: hidden;
    /* Ensure nothing leaks out */
}

.tag-row:hover {
    border-color: rgba(249, 134, 82, 0.3);
    background: rgba(0, 0, 0, 0.25);
}

.tag-symbol {
    color: var(--accent-color);
    font-weight: bold;
    font-size: 15px;
    opacity: 0.9;
}

.tag-input {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    /* CRITICAL: allow input to shrink and stay inside the box */
    font-family: inherit;
    outline: none;
}

.edit-icon {
    font-size: 13px;
    /* Slightly larger for better visibility */
    color: var(--text-muted);
    opacity: 0.5;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Edit icon becomes orange on hover of the row or itself */
.tag-row:hover .edit-icon,
.edit-icon:hover {
    color: var(--accent-color);
    opacity: 1;
    transform: scale(1.1);
}

/* Date Row (Matches Tag Row) */
.date-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 15px;
    border-radius: 8px;
    width: 210px;
    border: 1px solid transparent;
    margin-top: 10px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.date-row:hover {
    border-color: rgba(249, 134, 82, 0.3);
    background: rgba(0, 0, 0, 0.25);
}

.date-input {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    width: 100%;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}

.date-input::-webkit-datetime-edit-text {
    color: var(--accent-color);
    font-weight: bold;
}

.date-input:focus {
    color: var(--text-primary);
}

/* Style the native date picker indicator (Right Icon) */
.date-input::-webkit-calendar-picker-indicator {
    /* Initially muted/greyish */
    filter: grayscale(1) brightness(0.8);
    opacity: 0.5;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Turns orange on hover of the whole row OR just the icon */
.date-row:hover .date-input::-webkit-calendar-picker-indicator,
.date-input::-webkit-calendar-picker-indicator:hover {
    /* KYIVPROJECT ORANGE COLOR - Explicitly reset first */
    filter: brightness(0) saturate(100%) invert(58%) sepia(35%) saturate(1478%) hue-rotate(334deg) brightness(101%) contrast(94%);
    opacity: 1;
    transform: scale(1.1);
}

/* Description Part */
.info-desc-part {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.desc-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 700;
    opacity: 0.7;
}

.bio-wrapper {
    flex: 1;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 15px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    position: relative;
    /* Hide native scrollbars */
    overflow: hidden;
}

.bio-wrapper:hover,
.bio-wrapper:focus-within {
    border-color: rgba(249, 134, 82, 0.3);
    background: rgba(0, 0, 0, 0.2);
}

.bio-wrapper textarea {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    resize: none;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    font-family: inherit;
    /* Invisible scrollbar by default */
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.3s;
}

/* Firefox specific */
@supports not selector(::-webkit-scrollbar) {
    .bio-wrapper textarea {
        scrollbar-width: thin;
    }
}

/* Show scrollbar only on hover */
.bio-wrapper:hover textarea {
    scrollbar-color: var(--accent-color) transparent;
}

.bio-wrapper textarea::-webkit-scrollbar {
    width: 6px;
    /* Wider hit area but visible line will be thin */
}

.bio-wrapper textarea::-webkit-scrollbar-track {
    background: transparent;
}

.bio-wrapper textarea::-webkit-scrollbar-thumb {
    background-color: transparent;
    border: 2px solid transparent;
    /* This makes the visible part thin */
    background-clip: padding-box;
    border-radius: 10px;
}

.bio-wrapper:hover textarea::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
}


.bio-wrapper textarea:focus {
    outline: none;
}

.bio-wrapper textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.bio-char-count {
    text-align: right;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    opacity: 0.7;
}

/* -- Bottom Row -- */
.cabinet-bottom-row {
    height: 70px;
}

.pin-block {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    cursor: pointer;
}

.pin-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
}

/* Pin Action Button */
.pin-action-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(249, 134, 82, 0.3);
    transition: all 0.3s ease;
}

.pin-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 134, 82, 0.5);
}



/* === LOGOUT CONFIRMATION MODAL === */
.logout-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.logout-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.logout-modal {
    background: var(--bg-navbar);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    max-width: 480px;
    width: 90%;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

.logout-modal-overlay.active .logout-modal {
    transform: scale(1);
}

.logout-modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.logout-modal-icon {
    font-size: 56px;
    color: #fbbf24;
    margin-bottom: 20px;
    display: block;
    animation: pulse-warning 2s ease-in-out infinite;
}

@keyframes pulse-warning {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.logout-modal-header h2 {
    font-size: 28px;
    margin: 0 0 12px 0;
    color: var(--text-primary);
    font-weight: 700;
}

.logout-modal-header p {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.logout-modal-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 30px;
}

.logout-modal-info p {
    margin: 0;
    color: #60a5fa;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logout-modal-info i {
    font-size: 16px;
}

.logout-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.logout-modal-cancel,
.logout-modal-confirm {
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}

.logout-modal-cancel {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.logout-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-color);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.logout-modal-confirm {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.logout-modal-confirm:hover {
    box-shadow: 0 6px 25px rgba(220, 38, 38, 0.5);
    transform: translateY(-2px);
}

.logout-modal-confirm:active,
.logout-modal-cancel:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 900px) {
    .cabinet-main-wrapper {
        flex-direction: column;
        height: auto;
        width: calc(100% - 30px);
        /* Slightly more space on sides */
    }

    .cabinet-sidebar {
        width: 100%;
        height: 70px;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 0 18px;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        background: rgba(0, 0, 0, 0.2);
    }

    .sidebar-avatar-box {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
        border-radius: 10px;
    }

    .sidebar-tabs {
        display: flex;
        flex-direction: row !important;
        margin-top: 0 !important;
        padding: 0 !important;
        width: auto !important;
        gap: 12px !important;
        flex-shrink: 0;
    }

    .sidebar-tab {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
        border-radius: 10px;
        font-size: 18px;
    }

    .sidebar-logout-btn {
        margin-top: 0;
        margin-bottom: 0;
        margin-left: auto;
        width: 44px;
        height: 44px;
        flex-shrink: 0;
        border-radius: 10px;
        font-size: 18px;
    }

    .cabinet-top-row {
        grid-template-columns: 1fr;
        height: auto;
        gap: 20px;
    }

    .skin-block,
    .info-bio-block {
        height: 400px;
    }

    .info-bio-block {
        height: auto;
        min-height: 400px;
        padding: 20px;
    }

    .cabinet-right-content {
        padding: 20px 15px;
        gap: 20px;
    }
}

/* Mobile Width Adjustment to match Navbar */
@media (max-width: 768px) {
    .cabinet-main-wrapper {
        width: calc(100% - 40px);
    }
}

/* === SIDEBAR TABS === */
.sidebar-tabs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
    padding: 0 16px;
}

.sidebar-tab {
    position: relative;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-tab:hover {
    background: rgba(249, 134, 82, 0.1);
    color: var(--accent-color);
    border-color: rgba(249, 134, 82, 0.3);
}

.sidebar-tab.active {
    background: var(--accent-gradient);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-hover);
}

.sidebar-tab.active:hover {
    transform: scale(1.05);
}

.sidebar-tab.tab-locked i {
    opacity: 0.4;
    filter: grayscale(1);
}

.sidebar-tab.tab-locked::after {
    content: '\f023';
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 11px;
    color: #ffd700;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.4);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

#skPasswordModalOverlay .pin-submit-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

#skPasswordModalOverlay .pin-modal {
    width: 380px;
}

#skPasswordInput:focus {
    border-color: var(--accent-color) !important;
    background: rgba(0, 0, 0, 0.4) !important;
}

.tab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--bg-navbar);
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

/* JS керує через style.opacity / style.transform */
.tab-badge:not(:empty) {
    opacity: 1;
    transform: scale(1);
    animation: badgePulse 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes badgePulse {
    0% {
        transform: scale(0);
    }

    60% {
        transform: scale(1.25);
    }

    100% {
        transform: scale(1);
    }
}

/* Avatar click effect */
.sidebar-avatar-box {
    cursor: pointer;
}

.sidebar-avatar-box.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px var(--accent-hover);
}

/* === MINIMALIST META ROW === */
.meta-row {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

/* Update Tag Row for Meta Context */
.tag-row {
    margin-bottom: 0 !important;
    min-width: 180px;
}

/* === MINIMALIST STATS === */
/* Replaces old .social-stats */
.social-stats-minimal {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 4px;
    /* Clean look: no heavy background */
}

.stat-mini {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    text-decoration: none;
}

.stat-mini:hover {
    color: var(--text-primary);
    transform: translateY(-1px);
}

.stat-val {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-lbl {
    font-size: 13px;
    font-weight: 500;
    text-transform: lowercase;
    opacity: 0.7;
    padding-top: 1px;
    /* Align visually */
}

.stat-mini-divider {
    width: 1px;
    height: 14px;
    background: var(--border-color);
    opacity: 0.5;
}

/* === CONTENT VISIBILITY === */
.hidden {
    display: none !important;
}

/* === CHAT LAYOUT === */
.chat-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    /* Трохи ширше для списку */
    gap: 20px;
    /* Відступ між блоками */
    height: 495px;
    animation: chatLayoutFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chatLayoutFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === CHATS SIDEBAR === */
.chats-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    /* Округлені кути як в решті дизайну */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Щоб контент не виходив за межі */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chats-sidebar:hover {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

/* Search Container */
.chat-search-container {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    /* Прозорий фон для чистого вигляду */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    /* Тонка лінія */
}

.search-icon {
    color: var(--text-muted);
    font-size: 16px;
    transition: color 0.3s ease;
}

.chat-search-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid transparent;
    border-radius: 12px;
    /* Більш округлий */
    padding: 12px 16px;
    /* Трохи більший padding */
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-search-input:focus {
    border-color: var(--accent-color);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 3px rgba(249, 134, 82, 0.1);
    transform: translateY(-1px);
}

.chat-search-input:focus+.search-icon,
.chat-search-container:focus-within .search-icon {
    color: var(--accent-color);
}

/* Search Results */
.search-results {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.search-results-header {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding: 0 10px;
    font-weight: 700;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-result-item:hover {
    background: rgba(249, 134, 82, 0.1);
    border-color: var(--accent-color);
    transform: translateX(5px);
}

.search-result-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    image-rendering: pixelated;
    border: 1px solid var(--border-color);
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-tag {
    font-size: 12px;
    color: var(--text-muted);
}

/* Chats List */
.chats-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chats-list-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding: 12px 20px 8px;
    font-weight: 800;
    opacity: 0.6;
}

.chats-items {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.empty-chats {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-chats i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.3;
}

.empty-chats p {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text-secondary);
}

.empty-chats span {
    font-size: 13px;
    opacity: 0.7;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    /* Трохи більший padding */
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 0;
    /* Без border-radius щоб вписувався в container */
    position: relative;
    overflow: hidden;
    /* Для анімації фону */
}

.chat-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-color);
    transform: scaleY(0);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-item:hover {
    background: rgba(249, 134, 82, 0.08);
    transform: translateX(4px);
}

.chat-item:hover::before {
    transform: scaleY(1);
}

.chat-item.active {
    background: rgba(249, 134, 82, 0.15);
}

.chat-item.active::before {
    transform: scaleY(1);
}

.chat-item.unread {
    background: rgba(249, 134, 82, 0.05);
}

@keyframes pulseBadge {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

.chat-item-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: contain;
    image-rendering: pixelated;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.chat-item-info {
    flex: 1;
    min-width: 0;
}

.chat-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.chat-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-time {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.chat-item-preview {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item.unread .chat-item-preview {
    font-weight: 600;
    color: var(--text-secondary);
}

.chat-item-badge {
    position: absolute;
    right: 20px;
    bottom: 12px;
    background: var(--accent-color);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* === CHAT WINDOW === */
.chat-window {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    /* Округлені кути */
    overflow: hidden;
    /* Щоб контент не виходив за межі */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-window:hover {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

/* No Chat Selected */
.no-chat-selected {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
    color: var(--text-muted);
}

.no-chat-selected i {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.2;
}

.no-chat-selected h3 {
    font-size: 24px;
    margin: 0 0 10px 0;
    color: var(--text-secondary);
}

.no-chat-selected p {
    font-size: 14px;
    margin: 0;
    opacity: 0.7;
}

/* Active Chat */
.active-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    /* Трохи більший padding */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    /* Тонша лінія */
    background: transparent;
    /* Прозорий фон */
    backdrop-filter: blur(10px);
    transition: background 0.3s ease;
}

.chat-header:hover {
    background: rgba(0, 0, 0, 0.05);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: contain;
    image-rendering: pixelated;
    border: 1px solid var(--border-color);
}

.chat-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-user-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.chat-user-tag {
    font-size: 13px;
    color: var(--text-muted);
}

.chat-header-actions {
    display: flex;
    gap: 8px;
}

.chat-action-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    border: 1px solid transparent;
    border-radius: 10px;
    /* Більш округлі */
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-action-btn:hover {
    background: rgba(249, 134, 82, 0.15);
    color: var(--accent-color);
    border-color: rgba(249, 134, 82, 0.3);
    transform: scale(1.1) rotate(5deg);
    /* Трохи обертання */
}

.chat-action-btn:active {
    transform: scale(0.95) rotate(0deg);
}

.chat-action-btn.following {
    background: var(--accent-gradient);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 4px 15px rgba(249, 134, 82, 0.3);
}

.chat-action-btn.following:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(249, 134, 82, 0.5);
}

.chat-action-btn.following i::before {
    content: "\f007";
    /* fa-user */
}

/* Messages Container */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 2px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 10px;
    transition: background 0.3s;
}

.chat-messages:hover::-webkit-scrollbar-thumb {
    background: var(--accent-color);
}

.chat-messages:hover {
    scrollbar-color: var(--accent-color) transparent;
}

/* Message */
.message {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.own {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: contain;
    image-rendering: pixelated;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.message-content {
    max-width: 65%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.message.own .message-content {
    align-items: flex-end;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.message-sender {
    font-weight: 600;
    color: var(--text-secondary);
}

.message-time {
    color: var(--text-muted);
    font-size: 11px;
}

.message-bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.own .message-bubble {
    background: var(--accent-gradient);
    border-color: var(--accent-color);
    color: white;
}

/* Message Input */
.chat-input-container {
    display: flex;
    gap: 12px;
    padding: 24px 28px;
    /* Щоб співпадало з header */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: transparent;
    backdrop-filter: blur(10px);
    align-items: center;
}

.message-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid transparent;
    border-radius: 14px;
    /* Більш округлий */
    padding: 14px 18px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    min-height: 48px;
    outline: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    line-height: 1.5;
}

.message-input:focus {
    border-color: var(--accent-color);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 3px rgba(249, 134, 82, 0.1);
    transform: translateY(-2px);
}

.message-input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.send-message-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(249, 134, 82, 0.3);
}

.send-message-btn:hover {
    transform: scale(1.08) rotate(-10deg);
    /* Трохи обертання */
    box-shadow: 0 6px 25px rgba(249, 134, 82, 0.5);
}

.send-message-btn:active {
    transform: scale(0.95) rotate(0deg);
}

.send-message-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(249, 134, 82, 0.3);
    box-shadow: none;
}

.send-message-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* === RESPONSIVE UPDATES === */
@media (max-width: 900px) {
    .sidebar-tabs {
        flex-direction: row;
        margin-top: 0;
        padding: 0;
        gap: 10px;
    }

    .chat-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 500px;
    }

    .chats-sidebar {
        display: none;
    }

    .chats-sidebar.mobile-visible {
        display: flex;
    }

    .social-stats {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .chat-layout {
        min-height: 400px;
    }

    .chat-messages {
        padding: 15px;
    }

    .message-content {
        max-width: 80%;
    }
}

/* === SOCIAL MODAL (Followers/Following) === */
.social-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.social-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.social-modal {
    background: var(--bg-navbar);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.social-modal-overlay.active .social-modal {
    transform: scale(1);
}

/* Modal Header */
.social-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.1);
}

.social-modal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.social-modal-icon {
    font-size: 20px;
    color: var(--accent-color);
}

.social-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.social-modal-count {
    background: var(--accent-gradient);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(249, 134, 82, 0.3);
}

.social-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.social-modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
    transform: rotate(90deg);
}

/* Modal Tabs */
.social-modal-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.05);
}

.social-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.social-tab:hover {
    background: rgba(249, 134, 82, 0.08);
    color: var(--accent-color);
}

.social-tab.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 3px 12px rgba(249, 134, 82, 0.3);
}

.social-tab i {
    font-size: 16px;
}

.tab-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.social-tab.active .tab-count {
    background: rgba(255, 255, 255, 0.3);
}

/* Search Bar */
.social-modal-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.social-search-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.social-search-input:focus {
    background: rgba(0, 0, 0, 0.3);
}

/* Users Grid */
.social-users-grid {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-content: start;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.social-users-grid::-webkit-scrollbar {
    width: 2px;
}

.social-users-grid::-webkit-scrollbar-track {
    background: transparent;
}

.social-users-grid::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 10px;
    transition: background 0.3s;
}

.social-users-grid:hover::-webkit-scrollbar-thumb {
    background: var(--accent-color);
}

.social-users-grid:hover {
    scrollbar-color: var(--accent-color) transparent;
}

/* User Card */
.user-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    animation: userCardFadeIn 0.3s ease;
}

@keyframes userCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.user-card:hover {
    background: rgba(249, 134, 82, 0.05);
    border-color: rgba(249, 134, 82, 0.3);
}

.user-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.user-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: contain;
    image-rendering: pixelated;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}



.user-card-info {
    flex: 1;
    min-width: 0;
}

.user-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.user-card-tag {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card-bio {
    display: none;
}

.user-card-stats {
    display: none;
}

.user-card-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
}

.user-card-stat-value {
    font-weight: 700;
    color: var(--accent-color);
}

.user-card-stat-label {
    color: var(--text-muted);
}

.user-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.user-card-btn {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: none;
    white-space: nowrap;
}

.user-card-btn.primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(249, 134, 82, 0.25);
}

.user-card-btn.primary:hover {
    box-shadow: 0 3px 12px rgba(249, 134, 82, 0.4);
}

/* Icon buttons for user cards */
.user-card-btn.icon-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.user-card-btn.icon-btn:hover {
    background: rgba(249, 134, 82, 0.1);
    color: var(--accent-color);
    border-color: rgba(249, 134, 82, 0.3);
    transform: scale(1.1);
}

.user-card-btn.icon-btn.following {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-color: #10b981;
}

.user-card-btn.icon-btn.following:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #ef4444;
}

.user-card-btn.icon-btn i {
    font-size: 14px;
}


/* Empty State */
.social-empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.social-empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.social-empty-state p {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text-secondary);
}

.social-empty-state span {
    font-size: 14px;
    opacity: 0.7;
}

/* Loading State */
.social-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 15px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.social-loading p {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0;
}

/* === USER PREVIEW MODAL === */
.user-preview-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(15px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10002;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.user-preview-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.user-preview-modal {
    background: var(--bg-navbar);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.user-preview-modal-overlay.active .user-preview-modal {
    transform: scale(1);
}

.user-preview-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.user-preview-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.4);
    transform: rotate(90deg);
}

.user-preview-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    min-height: 500px;
}

/* Left: 3D Skin */
.user-preview-skin {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(249, 134, 82, 0.1));
    border-right: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.user-preview-skin::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(249, 134, 82, 0.1), transparent 70%);
    pointer-events: none;
}

.user-preview-skin canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Right: User Info */
.user-preview-info {
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.user-preview-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-preview-avatar {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    object-fit: contain;
    image-rendering: pixelated;
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.user-preview-name-section {
    flex: 1;
}

.user-preview-name-section h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent-color);
    margin: 0 0 6px 0;
    letter-spacing: -0.5px;
}

.user-preview-tag {
    font-size: 16px;
    color: var(--text-muted);
}

.user-preview-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.user-preview-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: lowercase;
}

.stat-divider {
    width: 1px;
    height: 35px;
    background: var(--border-color);
    opacity: 0.5;
}

.user-preview-bio-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bio-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
    opacity: 0.7;
}

.user-preview-bio {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    min-height: 80px;
    max-height: 120px;
    overflow-y: auto;
}

.user-preview-bio::-webkit-scrollbar {
    width: 4px;
}

.user-preview-bio::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 2px;
}

.user-preview-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.user-preview-btn {
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}

.user-preview-btn.primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(249, 134, 82, 0.3);
    grid-column: 1 / -1;
}

.user-preview-btn.primary:hover {
    box-shadow: 0 6px 25px rgba(249, 134, 82, 0.5);
    transform: translateY(-2px);
}

.user-preview-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.user-preview-btn.secondary:hover {
    background: rgba(249, 134, 82, 0.1);
    color: var(--accent-color);
    border-color: rgba(249, 134, 82, 0.3);
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .social-modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .social-users-grid {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .user-preview-content {
        grid-template-columns: 1fr;
    }

    .user-preview-skin {
        height: 300px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .user-preview-info {
        padding: 30px 20px;
    }

    .user-preview-actions {
        grid-template-columns: 1fr;
    }

    .user-preview-btn.primary {
        grid-column: 1;
    }
}

/* === SHOP SECTION — CHAT-MIRRORED LAYOUT === */

/* Container for all shop content */
#shopContent {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 !important;
    height: 100%;
    min-height: 0;
}

/* Shop Layout: mirrors .chat-layout */
.shop-layout {
    display: grid;
    grid-template-columns: 80px 1fr;
    grid-template-rows: 1fr;
    /* Force the single row to take available height */
    gap: 16px;
    padding: 0 20px 20px 20px;
    animation: chatLayoutFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    align-items: stretch;
    height: 580px;
    /* Use height instead of max-height to ensure internal components can calculate heights */
    max-height: 580px;
}

/* === LEFT SIDEBAR: Categories (mirrors .chats-sidebar) === */
.shop-categories-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 80px;
    min-width: 80px;
    min-height: 0;
    /* CRITICAL: allow grid item to shrink below content size */
    flex-shrink: 0;
}

.shop-categories-sidebar:hover {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

/* Sidebar header label — hidden in narrow mode */
.shop-sidebar-header {
    display: none;
}

/* Scrollable list of category tabs */
.shop-categories-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    /* Disable horizontal scroll */
    display: flex;
    flex-direction: column;
    align-items: center;
    /* PERFECT CENTERING */
    gap: 16px;
    padding: 25px 0;

    /* FIX: Ensure content stays centered and doesn't shift when scrollbar appears */
    scrollbar-gutter: stable both-edges;
    scrollbar-color: transparent transparent;

    /* Better scrolling behavior for modern browsers */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;

    /* Create beautiful fade effect at top and bottom */
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 40px, black calc(100% - 40px), transparent);
    mask-image: linear-gradient(to bottom, transparent, black 40px, black calc(100% - 40px), transparent);
}

/* Firefox specific */
@supports not selector(::-webkit-scrollbar) {
    .shop-categories-list {
        scrollbar-width: thin;
    }
}

/* Hide horizontal scrollbar specifically */
.shop-categories-list::-webkit-scrollbar:horizontal {
    height: 0;
    display: none;
}

.shop-categories-list::-webkit-scrollbar {
    width: 6px;
}

.shop-categories-list::-webkit-scrollbar-track {
    background: transparent;
}

.shop-categories-list::-webkit-scrollbar-thumb {
    background: transparent;
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 10px;
}

.shop-categories-list:hover::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
}

.shop-categories-list:hover {
    scrollbar-color: var(--accent-color) transparent;
}

/* Individual category card */
.shop-cat-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    /* Even more compact for better spacing */
    height: 48px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.shop-cat-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.shop-cat-tab.active {
    background: var(--accent-gradient);
    border-color: var(--accent-color);
    box-shadow:
        0 4px 15px rgba(212, 98, 42, 0.3),
        inset 0 0 10px rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

/* Elegant indicator for active tab */
.shop-cat-tab.active::after {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--accent-color);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--accent-color);
}

.shop-cat-tab img {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.shop-cat-tab:hover img {
    transform: scale(1.15);
    filter: drop-shadow(0 3px 8px rgba(249, 134, 82, 0.4));
}

.shop-cat-tab.active img {
    transform: scale(1.1);
    filter: drop-shadow(0 3px 10px rgba(249, 134, 82, 0.5));
}

/* Tooltip fixed to show despite overflow-x: hidden */
.shop-cat-label {
    position: fixed;
    /* Fixed position relative to viewport or nearest transformed ancestor */
    left: 105px;
    /* Aligned next to the sidebar (80px + margin) */
    background: rgba(20, 20, 24, 0.95);
    border: 1px solid rgba(249, 134, 82, 0.3);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    display: block;
}

/* Position tooltips correctly for each item on hover since they are fixed */
.shop-cat-tab:hover .shop-cat-label {
    opacity: 1;
}

.shop-cat-tab.active .shop-cat-label {
    color: var(--accent-color);
    font-weight: 700;
}

/* === RIGHT PANEL: Items Window (mirrors .chat-window) === */
.shop-items-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-height: 0;
}

.shop-items-panel:hover {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

/* Items Viewport (scrollable) */
.shop-items-viewport {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) transparent;
    background: transparent;
    min-height: 0;
    /* Create beautiful fade effect at top and bottom */
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 15px, black calc(100% - 15px), transparent);
    mask-image: linear-gradient(to bottom, transparent, black 15px, black calc(100% - 15px), transparent);
}

.shop-items-viewport::-webkit-scrollbar {
    width: 6px;
}

.shop-items-viewport::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.shop-items-viewport::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-color), #d4622a);
    border-radius: 3px;
}

.shop-items-viewport::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ffaa70, var(--accent-color));
}

/* Category Panel (each tab content) */
.shop-category-panel {
    display: none;
    padding: 5px 12px 15px 12px;
    animation: shopPanelFadeIn 0.35s ease-out;
}

.shop-category-panel.active {
    display: block;
}

@keyframes shopPanelFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Items Grid */
.shop-items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.shop-item-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    width: 100%;
    height: 100%;
}

.shop-item-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(249, 134, 82, 0.2);
    background: rgba(249, 134, 82, 0.06);
}

.shop-item-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(249, 134, 82, 0.08), transparent 70%);
    pointer-events: none;
}

.item-frame {
    width: 64px;
    height: 64px;
    background: rgba(0, 0, 0, 0.3);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.shop-item-card:hover .item-frame {
    border-color: var(--accent-color);
    background: rgba(249, 134, 82, 0.1);
    transform: scale(1.05) rotate(5deg);
}

.item-frame img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
    image-rendering: pixelated;
}

.item-info {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.item-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 32px;
    line-height: 1.2;
}

.item-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 800;
    color: #fbbf24;
    margin-bottom: 10px;
}

.buy-item-btn {
    width: 100%;
    padding: 8px;
    border-radius: 10px;
    border: none;
    background: var(--accent-gradient);
    color: white;
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(249, 134, 82, 0.2);
    margin-top: auto;
}

.buy-item-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(249, 134, 82, 0.4);
    filter: brightness(1.1);
}

.buy-item-btn:active {
    transform: scale(0.98);
}

/* === SHOP RESPONSIVE === */
@media (max-width: 1100px) {
    .shop-items-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .shop-layout {
        grid-template-columns: 70px 1fr;
        gap: 10px;
    }

    .shop-categories-sidebar {
        width: 70px;
        min-width: 70px;
    }

    .shop-items-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .shop-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        max-height: none !important;
        /* Allow the layout to expand as needed on mobile */
    }

    .shop-categories-sidebar {
        width: 100%;
        min-width: 0;
        height: auto;
        flex-direction: column;
        overflow: visible;
        margin-bottom: 15px;
    }

    .shop-categories-list {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 12px 6px;
        gap: 12px;
        -webkit-overflow-scrolling: touch;
        /* Momentum scroll */
        justify-content: flex-start;
        scrollbar-width: none;
        /* Hide for cleaner look on mobile */

        /* Fix: Reset vertical mask and use horizontal mask for row layout */
        -webkit-mask-image: linear-gradient(to right, transparent, black 20px, black calc(100% - 20px), transparent);
        mask-image: linear-gradient(to right, transparent, black 20px, black calc(100% - 20px), transparent);

        /* Add snap for "flipping" feel */
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
    }

    .shop-categories-list::-webkit-scrollbar {
        display: none;
    }

    .shop-cat-tab {
        flex-direction: row;
        padding: 0 16px;
        gap: 10px;
        min-width: auto;
        height: 54px;
        width: max-content;
        border-radius: 12px;
        scroll-snap-align: center;
    }

    .shop-cat-tab img {
        width: 28px;
        height: 28px;
    }

    .shop-cat-tab::before {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 3px;
        transform: scaleX(0);
    }

    .shop-cat-tab:hover::before,
    .shop-cat-tab.active::before {
        transform: scaleX(1);
    }

    .shop-cat-tab:hover {
        transform: translateY(-2px);
    }

    .shop-cat-label {
        font-size: 10px;
    }

    .shop-items-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 10px 4px;
    }

    .shop-item-card {
        height: auto;
    }

    /* Fix: Force independent vertical scroll and capture touch events */
    .shop-items-viewport {
        height: 500px;
        /* Strong fixed height to trigger internal scroll */
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        /* Momentum scroll for iOS */
        touch-action: pan-y !important;
        /* Ensure touch gestures move the list */
        overscroll-behavior-y: contain;
        /* Prevent the body from scrolling when list reaches end */
        -webkit-mask-image: linear-gradient(to bottom, transparent, black 15px, black calc(100% - 15px), transparent);
        mask-image: linear-gradient(to bottom, transparent, black 15px, black calc(100% - 15px), transparent);
        position: relative;
        z-index: 5;
    }
}

/* === Shop Header Bar (NOT a panel — sits at top) === */
.shop-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: transparent;
    /* Removed border and added small margin to accommodate search divider row */
    margin-bottom: 4px;
}

.shop-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.shop-header-icon {
    font-size: 28px;
    color: var(--accent-color);
    background: rgba(249, 134, 82, 0.12);
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px solid rgba(249, 134, 82, 0.2);
    flex-shrink: 0;
    text-shadow: 0 2px 8px rgba(249, 134, 82, 0.3);
}

.shop-title-section h2 {
    font-size: 22px;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    font-weight: 800;
    letter-spacing: -0.3px;
}

.shop-title-section p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    opacity: 0.75;
}

/* === SHOP SEARCH === */
/* === SHOP SEARCH AREA (CENTERED ON THE MIDDLE LINE) === */
.shop-search-divider-row {
    display: flex;
    align-items: center;
    gap: 30px;
    margin: 5px 0 20px 0;
    padding: 0 40px;
    animation: shopBlockIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.search-line {
    flex: 1;
    height: 1px;
    background: var(--border-color);
    opacity: 0.4;
}

.shop-search-divider-row .search-line:first-child {
    background: linear-gradient(to left, var(--border-color), transparent);
}

.shop-search-divider-row .search-line:last-child {
    background: linear-gradient(to right, var(--border-color), transparent);
}

.shop-search-container {
    flex: 0 1 450px;
    position: relative;
    display: flex;
    align-items: center;
}

@media (max-width: 900px) {
    .shop-search-divider-row {
        gap: 15px;
        padding: 0 20px;
    }

    .shop-search-container {
        flex: 0 1 400px;
    }
}

@media (max-width: 600px) {
    .shop-search-divider-row {
        margin: 10px 0;
    }

    .search-line {
        display: none;
    }

    .shop-search-container {
        flex: 1;
        max-width: 100%;
    }
}

.shop-search-icon {
    position: absolute;
    left: 15px;
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 2;
}

.shop-search-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 15px 12px 40px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.shop-search-input:focus {
    border-color: var(--accent-color);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 15px rgba(249, 134, 82, 0.15);
}

.shop-search-input:focus~.shop-search-icon {
    color: var(--accent-color);
    transform: scale(1.1);
}

.filtered-out {
    display: none !important;
}

.shop-empty-search {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.shop-empty-search i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.3;
    color: var(--accent-color);
}

.shop-empty-search p {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

/* === BALANCE DISPLAY === */
.shop-balance-section {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    backdrop-filter: blur(10px);
}

.balance-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: default;
}

.balance-symbol {
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
}

.vidliky-symbol {
    color: #38bdf8;
    text-shadow: 0 0 15px rgba(56, 189, 248, 0.6);
    animation: vidlikyGlow 2s ease-in-out infinite;
}

@keyframes vidlikyGlow {

    0%,
    100% {
        text-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
    }

    50% {
        text-shadow: 0 0 22px rgba(56, 189, 248, 0.9);
    }
}

.balance-val {
    font-size: 19px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.balance-lbl {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
    text-transform: lowercase;
}

/* Earn button */
.earn-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
    white-space: nowrap;
    font-family: inherit;
    flex-shrink: 0;
}

.earn-btn i {
    font-size: 15px;
    animation: earnBtnPulse 1.5s ease-in-out infinite;
}

@keyframes earnBtnPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

.earn-btn:hover {
    transform: scale(1.06) translateY(-1px);
    box-shadow: 0 8px 22px rgba(14, 165, 233, 0.5);
    filter: brightness(1.1);
}

.earn-btn:active {
    transform: scale(0.97);
}

.balance-up {
    animation: balanceUpdateUp 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.balance-down {
    animation: balanceUpdateDown 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes balanceUpdateUp {
    0% {
        color: #4ade80;
        text-shadow: 0 0 15px rgba(74, 222, 128, 0.8);
        transform: translateY(-2px) scale(1.08);
    }

    30% {
        color: #4ade80;
        text-shadow: 0 0 20px rgba(74, 222, 128, 0.6);
        transform: translateY(-2px) scale(1.08);
    }

    100% {
        color: #fff;
        text-shadow: none;
        transform: translateY(0) scale(1);
    }
}

@keyframes balanceUpdateDown {
    0% {
        color: #f87171;
        text-shadow: 0 0 15px rgba(248, 113, 113, 0.8);
        transform: translateY(2px) scale(1.08);
    }

    30% {
        color: #f87171;
        text-shadow: 0 0 20px rgba(248, 113, 113, 0.6);
        transform: translateY(2px) scale(1.08);
    }

    100% {
        color: #fff;
        text-shadow: none;
        transform: translateY(0) scale(1);
    }
}

/* === 3 Panels Container === */
.shop-panels-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 20px 20px 20px;
    flex: 1;
    min-height: 0;
}

/* === Universal Panel Style — matches .chats-sidebar / .chat-window style === */
.shop-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: shopBlockIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.shop-panel:nth-child(1) {
    animation-delay: 0s;
}

.shop-panel:nth-child(2) {
    animation-delay: 0.08s;
}

.shop-panel:nth-child(3) {
    animation-delay: 0.16s;
}

@keyframes shopBlockIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* === PANEL 1: Top 5 Categories === */
.shop-top-categories-panel {
    padding: 0;
}

.shop-top-categories-panel .shop-inventory-tabs {
    border-bottom: none;
}

/* === PANEL 2: Items Panel (the big one) === */
.shop-items-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* Items Viewport (Scrollable Content Area inside Panel 2) */
.shop-items-viewport {
    background: transparent;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    flex: 1;
    min-height: 0;

    /* Better scrolling behavior for modern browsers */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;

    /* FIX: Prevent layout shift on scrollbar appearance */
    scrollbar-gutter: stable;
    scrollbar-color: transparent transparent;
}

/* Firefox specific */
@supports not selector(::-webkit-scrollbar) {
    .shop-items-viewport {
        scrollbar-width: thin;
    }
}

/* Custom Scrollbar */
.shop-items-viewport::-webkit-scrollbar {
    width: 6px;
    /* Thinner and consistent */
}

.shop-items-viewport::-webkit-scrollbar-track {
    background: transparent;
}

.shop-items-viewport::-webkit-scrollbar-thumb {
    background-color: transparent;
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 10px;
    transition: background 0.3s;
}

.shop-items-viewport:hover::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
}

.shop-items-viewport:hover {
    scrollbar-color: var(--accent-color) transparent;
}

/* Category Panel (each tab content) */
.shop-category-panel {
    display: none;
    padding: 18px;
    animation: shopPanelFadeIn 0.35s ease-out;
}

.shop-category-panel.active {
    display: block;
}

@keyframes shopPanelFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Items Grid — 6 per row */
.shop-items-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.shop-item-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    width: 100%;
    height: 100%;
}

.shop-item-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px rgba(249, 134, 82, 0.2);
    background: rgba(249, 134, 82, 0.06);
}

.shop-item-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(249, 134, 82, 0.08), transparent 70%);
    pointer-events: none;
}

.item-frame {
    width: 64px;
    height: 64px;
    background: rgba(0, 0, 0, 0.3);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.shop-item-card:hover .item-frame {
    border-color: var(--accent-color);
    background: rgba(249, 134, 82, 0.1);
    transform: scale(1.05) rotate(5deg);
}

.item-frame img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
    image-rendering: pixelated;
}

.item-info {
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.item-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 32px;
    line-height: 1.2;
}

.item-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 800;
    color: #fbbf24;
    margin-bottom: 10px;
}

.item-price i {
    font-size: 14px;
    color: #fbbf24;
}

.buy-item-btn {
    width: 100%;
    padding: 8px;
    border-radius: 10px;
    border: none;
    background: var(--accent-gradient);
    color: white;
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(249, 134, 82, 0.2);
    margin-top: auto;
}

.buy-item-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(249, 134, 82, 0.4);
    filter: brightness(1.1);
}

.buy-item-btn:active {
    transform: scale(0.98);
}

/* === PANEL 3: Bottom 4 Categories === */
.shop-bottom-panel {
    padding: 0;
}

.shop-bottom-panel .shop-inventory-tabs {
    border-bottom: none;
}

/* === SHOP RESPONSIVE === */
@media (max-width: 1200px) {
    .shop-items-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1000px) {
    .shop-items-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 800px) {
    .shop-items-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .shop-cat-label {
        font-size: 8px;
    }

    .shop-cat-tab img {
        width: 28px;
        height: 28px;
    }

    .shop-cat-tab {
        padding: 8px 6px 6px;
    }

    .shop-panels-container {
        padding: 0 12px 12px 12px;
    }
}

@media (max-width: 600px) {
    .shop-header-bar {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
        padding: 14px 16px;
    }

    .shop-balance-section {
        width: auto;
    }

    .shop-items-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .shop-inventory-tabs {
        gap: 4px;
        padding: 8px 10px;
    }

    .shop-cat-label {
        display: none;
    }

    .shop-cat-tab {
        padding: 8px;
    }

    .shop-cat-tab img {
        width: 24px;
        height: 24px;
    }

    .shop-panels-container {
        padding: 0 8px 8px 8px;
        gap: 10px;
    }
}

/* === PURCHASE MODAL STYLES === */
.purchase-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(15px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.purchase-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.purchase-modal {
    background: var(--bg-navbar);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 90%;
    max-width: 400px;
    padding: 35px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.purchase-modal-overlay.active .purchase-modal {
    transform: scale(1);
}

.purchase-modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.item-preview-frame {
    width: 100px;
    height: 100px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--accent-color);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    box-shadow: 0 0 20px rgba(249, 134, 82, 0.2);
}

.item-preview-frame img {
    width: 70px;
    height: 70px;
    image-rendering: pixelated;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.5));
}

.purchase-modal-header h2 {
    font-size: 24px;
    color: var(--text-primary);
    margin: 0 0 5px 0;
    font-weight: 800;
}

.purchase-modal-header p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.purchase-modal-body {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.purchase-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-label {
    font-size: 14px;
    color: var(--text-muted);
}

.info-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-color);
}

.purchase-quantity-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.purchase-quantity-section label {
    font-size: 14px;
    color: var(--text-muted);
}

.quantity-controls {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.quantity-controls input {
    width: 40px;
    text-align: center;
    background: transparent;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-top: none;
    border-bottom: none;
    color: var(--text-primary);
    font-weight: 700;
    font-family: inherit;
    -moz-appearance: textfield;
    appearance: textfield;
}

.quantity-controls input::-webkit-outer-spin-button,
.quantity-controls input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.purchase-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.total-price {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 800;
    color: #fbbf24;
}

.purchase-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.purchase-cancel-btn,
.purchase-confirm-btn {
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.purchase-cancel-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.purchase-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.purchase-confirm-btn {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(249, 134, 82, 0.3);
}

.purchase-confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 134, 82, 0.5);
}

.purchase-confirm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Vidliky price symbol */
.price-symbol {
    font-weight: 900;
    font-size: 16px;
}

.price-symbol.vidliky-symbol,
.item-price[data-currency="vidliky"] .price-symbol {
    color: #38bdf8;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

/* Purchase modal currency icon */
.price-currency-icon {
    font-weight: 900;
    font-size: 20px;
}

.price-currency-icon.vidliky-currency {
    color: #38bdf8;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

/* Total price color based on currency */
.total-price.vidliky-total {
    color: #38bdf8;
}

/* Purchase balance row */
.purchase-balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    margin-top: 2px;
}

.balance-row-label {
    font-size: 13px;
    color: var(--text-muted);
    opacity: 0.8;
}

.balance-row-values {
    display: flex;
    align-items: center;
    gap: 10px;
}

.balance-row-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.balance-row-symbol {
    font-weight: 900;
    font-size: 14px;
}

.vidliky-row-symbol {
    color: #38bdf8;
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.balance-row-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Purchase status messages */
.purchase-status-msg {
    text-align: center;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 10px;
    animation: fadeInUp 0.3s ease-out;
}

.purchase-status-msg.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.purchase-status-msg.success {
    background: rgba(74, 222, 128, 0.15);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: #4ade80;
}

.purchase-status-msg.loading {
    background: rgba(167, 139, 250, 0.15);
    border: 1px solid rgba(167, 139, 250, 0.3);
    color: #a78bfa;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Confirmation Checkbox */
.purchase-confirmation-check {
    margin-top: 5px;
    padding: 12px 14px;
    background: rgba(249, 134, 82, 0.05);
    border: 1px solid rgba(249, 134, 82, 0.15);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.purchase-confirmation-check:hover {
    background: rgba(249, 134, 82, 0.08);
    border-color: rgba(249, 134, 82, 0.25);
}

.custom-checkbox-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    width: 100%;
}

.custom-checkbox-container input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.custom-checkbox-container:hover .checkmark {
    border-color: var(--accent-color);
}

.custom-checkbox-container input:checked~.checkmark {
    background: var(--accent-gradient);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(249, 134, 82, 0.4);
}

.checkmark:after {
    content: '';
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.custom-checkbox-container input:checked~.checkmark:after {
    display: block;
}

.checkbox-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.3s;
}

.custom-checkbox-container:hover .checkbox-text {
    color: var(--text-secondary);
}

.custom-checkbox-container input:checked~.checkbox-text {
    color: var(--text-primary);
}

/* ==============================
   EARN MODAL (Google AdSense Integration)
   ============================== */
.earn-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(16px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.earn-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.earn-modal {
    position: relative;
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: 28px;
    padding: 36px 32px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.8), 0 0 80px -20px rgba(56, 189, 248, 0.15);
    transform: scale(0.9) translateY(30px);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.earn-modal-overlay.active .earn-modal {
    transform: scale(1) translateY(0);
}

/* Background decorative orbs */
.earn-modal-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.15;
    pointer-events: none;
}

.earn-modal-orb-1 {
    width: 250px;
    height: 250px;
    background: #38bdf8;
    top: -100px;
    right: -100px;
}

.earn-modal-orb-2 {
    width: 200px;
    height: 200px;
    background: #818cf8;
    bottom: -80px;
    left: -80px;
}

.earn-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.earn-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: rotate(90deg);
}

/* States */
.earn-state {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.earn-state.hidden {
    display: none;
}

/* ═══ READY STATE ═══ */
.earn-ready-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.earn-lightning-icon {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.earn-title-gradient {
    font-size: 24px;
    font-weight: 900;
    margin: 0 0 6px 0;
    background: linear-gradient(135deg, #fff 30%, #a5f3fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.earn-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.earn-cards-row {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.earn-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.earn-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.earn-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.earn-card-val {
    font-size: 16px;
    font-weight: 800;
    color: #38bdf8;
}

.earn-card-val-bonus {
    color: #f59e0b;
}

.earn-card-label {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.3;
}

.earn-info-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    background: rgba(56, 189, 248, 0.05);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 24px;
}

.earn-info-badge i {
    color: #38bdf8;
    font-size: 14px;
}

.earn-info-badge span {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.earn-start-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.2);
}

.earn-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(14, 165, 233, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.2);
    filter: brightness(1.1);
}

.earn-start-btn:active {
    transform: scale(0.98);
}

/* ═══ LOADING STATE ═══ */
#earnStateLoading {
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.earn-loading-wrap {
    position: relative;
    width: 64px;
    height: 64px;
    margin-bottom: 24px;
}

.earn-loading-ring {
    position: absolute;
    inset: 0;
    border: 3px solid rgba(56, 189, 248, 0.2);
    border-top-color: #38bdf8;
    border-radius: 50%;
    animation: earnSpin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.earn-loading-inner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #38bdf8;
    animation: earnPulse 2s infinite ease-in-out;
}

@keyframes earnSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes earnPulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.earn-loading-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px;
}

.earn-loading-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* ═══ WATCHING STATE ═══ */
.earn-ad-wrapper {
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
}

.earn-ad-label-top {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 10;
    pointer-events: none;
}

.earn-ad-badge {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.earn-ad-badge i {
    color: #facc15;
}

.earn-timer-chip {
    position: relative;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.earn-timer-svg {
    position: absolute;
    inset: 0;
    transform: rotate(-90deg);
}

.earn-timer-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 3;
}

.earn-timer-fill {
    fill: none;
    stroke: #38bdf8;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.earn-countdown-num {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    position: relative;
    z-index: 2;
}

.earn-ad-container {
    width: 100%;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1e293b, #000);
}

/* This targets the Google ad iframe */
.earn-ad-container ins,
.earn-ad-container iframe {
    width: 100% !important;
    height: 100% !important;
    min-height: 220px;
}

.earn-ad-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    width: 100%;
}

.earn-ad-progress-fill {
    height: 100%;
    width: 0%;
    background: #38bdf8;
    transition: width 1s linear;
    box-shadow: 0 0 10px #38bdf8;
}

/* Visit Button in watching state */
.earn-visit-section {
    width: 100%;
}

.earn-visit-btn {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    border: none;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.earn-visit-btn.locked {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: not-allowed;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.earn-visit-lock {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.earn-visit-btn:not(.locked):not(.visited) {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.4);
    cursor: pointer;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.1);
}

.earn-visit-btn:not(.locked):not(.visited):hover {
    background: rgba(245, 158, 11, 0.25);
    transform: translateY(-2px);
    border-color: #f59e0b;
}

.earn-visit-btn.visited {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
    cursor: default;
}

.earn-visit-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.earn-visit-bonus {
    font-size: 11px;
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

/* ═══ DONE STATE ═══ */
#earnStateDone {
    align-items: center;
    text-align: center;
    padding: 20px 0 10px;
}

.earn-done-visual {
    position: relative;
    margin-bottom: 24px;
}

.earn-check-path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: dashCheck 0.6s 0.2s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

@keyframes dashCheck {
    to {
        stroke-dashoffset: 0;
    }
}

.earn-done-title {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 16px;
}

.earn-done-amount {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    margin-bottom: 8px;
}

.earn-done-plus {
    font-size: 32px;
    font-weight: 700;
    color: #38bdf8;
    margin-top: 4px;
}

.earn-done-num {
    font-size: 56px;
    font-weight: 900;
    color: #38bdf8;
    line-height: 1;
    text-shadow: 0 0 30px rgba(56, 189, 248, 0.5);
}

.earn-done-symbol {
    font-size: 32px;
    margin-top: 4px;
}

.earn-done-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 32px;
}

.earn-done-actions {
    display: flex;
    gap: 12px;
    width: 100%;
}

.earn-done-actions button {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.earn-again-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.earn-again-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.earn-close-done-btn {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.earn-close-done-btn:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: #38bdf8;
}

/* Particles */
.earn-particles {
    position: absolute;
    inset: -40px;
    pointer-events: none;
}

.earn-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #38bdf8;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    opacity: 0;
    box-shadow: 0 0 10px #38bdf8;
    animation: particlePop 1s ease-out forwards;
}

@keyframes particlePop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }

    100% {
        transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1);
        opacity: 0;
    }
}

@media (max-width: 520px) {
    .earn-modal {
        padding: 32px 24px;
        border-radius: 20px;
    }

    .earn-cards-row {
        flex-direction: column;
    }

    .earn-done-actions {
        flex-direction: column;
    }
}