/* ===== DESKTOP LAYOUT STYLES ===== */
/* Адаптивный дизайн для полноценного десктопного опыта */

/* ===== БАЗОВЫЕ АДАПТИВНЫЕ ПРАВИЛА ===== */
@media (min-width: 768px) {

    /* Убираем ограничение ширины mobile-wrapper на десктопе */
    .mobile-wrapper {
        max-width: 100% !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        min-height: 100vh;
    }

    /* ВАЖНО: Скрываем мобильный блок баланса на десктопе */
    .mobile-balance-block {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        position: absolute !important;
        left: -9999px !important;
    }

    /* Фон для app-container на десктопе */
    #app-container {
        background: linear-gradient(135deg, #1E1D30 0%, #181A20 100%) !important;
        min-height: 100vh;
    }
}

/* ===== DESKTOP HEADER ===== */
.desktop-header {
    display: none;
}

@media (min-width: 768px) {
    .desktop-header {
        display: flex !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 40 !important;
        box-sizing: border-box !important;
        padding: 0.75rem 2rem !important;
        /* Solid dark background - NO GLASSMORPHISM */
        background-color: #181A20 !important;
        background: #181A20 !important;
        border-bottom: 1px solid #31333F !important;
        /* Override any glassmorphism effects */
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: none !important;
        transition: none !important;
    }

    .desktop-header-container {
        max-width: 1400px;
        width: 100%;
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    /* Логотип - строго белый */
    .desktop-logo {
        display: flex !important;
        align-items: center !important;
        gap: 0.75rem !important;
        font-size: 1.5rem !important;
        font-weight: 800 !important;
        color: #FFFFFF !important;
        text-decoration: none !important;
        transition: all 0.3s ease !important;
        white-space: nowrap !important;
    }

    .desktop-logo span,
    .desktop-logo .desktop-logo-text {
        color: #FFFFFF !important;
    }

    .desktop-logo:hover {
        transform: scale(1.02);
        color: #FFFFFF !important;
    }

    .desktop-logo-img {
        width: 2rem !important;
        height: 2rem !important;
        object-fit: contain !important;
        /* Remove any color filter */
        filter: none !important;
    }

    .desktop-logo-text {
        font-family: 'Nunito', sans-serif !important;
        text-transform: uppercase !important;
        letter-spacing: 0.05em !important;
        color: #FFFFFF !important;
    }


    /* Навигация (Optional: make it subtler if needed, or keep as is) */
    .desktop-nav {
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }

    .desktop-nav-item {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        border-radius: 0.5rem;
        color: #9ca3af;
        text-decoration: none;
        font-weight: 600;
        transition: all 0.3s ease;
        position: relative;
    }

    .desktop-nav-item:hover {
        background-color: rgba(255, 255, 255, 0.05);
        color: #fff;
    }

    .desktop-nav-item.active {
        color: #fff;
        background-color: rgba(255, 255, 255, 0.1);
    }

    .desktop-nav-item svg {
        width: 1.25rem;
        height: 1.25rem;
    }


    /* Right Section Structure */
    .desktop-right-section {
        display: flex;
        align-items: center;
        gap: 2rem;
        /* Spacing between Balance Block and User Block */
    }

    /* Balance + Plus Button Block */
    .desktop-balance-page-block {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    /* Plus Button for Deposit */
    .desktop-deposit-plus-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.1);
        color: white;
        text-decoration: none;
        transition: all 0.2s ease;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }

    .desktop-deposit-plus-btn:hover {
        background-color: rgba(255, 255, 255, 0.2);
        transform: scale(1.1);
    }

    .desktop-deposit-plus-btn svg {
        stroke: white;
    }

    .desktop-page-name {
        font-size: 0.9rem;
        color: #6c7080;
        /* Subtle color for page name */
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    /* Отображение баланса (Modified to fit new style) */
    .desktop-balance-display {
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        /* Removed background for cleaner look, or keep minimal? User said 'balance... visible'.
           Let's keep it clean, maybe just text and icon */
        padding: 0.25rem 0 !important;
        background-color: transparent !important;
    }

    .desktop-balance-amount {
        font-size: 1rem !important;
        font-weight: 700 !important;
        color: #fff !important;
        /* White text for balance */
    }

    .desktop-star-icon {
        width: 1.25rem !important;
        height: 1.25rem !important;
    }


    /* User Dropdown Trigger (Avatar + Name + Arrow) */
    .desktop-user-dropdown-trigger {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        cursor: pointer;
        padding: 0.25rem;
        border-radius: 99em;
        /* Pill shape hover */
        transition: background-color 0.2s;
        position: relative;
    }

    .desktop-user-dropdown-trigger:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }

    /* User Dropdown Menu */
    .desktop-user-dropdown-menu {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        background-color: #1E1D30;
        border: 1px solid rgba(109, 78, 255, 0.3);
        border-radius: 0.75rem;
        min-width: 200px;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.2s ease;
        z-index: 1000;
        overflow: hidden;
        pointer-events: none;
        display: flex;
        flex-direction: column;
        padding: 0.25rem 0;
    }

    .desktop-user-dropdown-trigger.active .desktop-user-dropdown-menu {
        pointer-events: auto;
    }

    .desktop-user-dropdown-trigger.active .desktop-user-dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .desktop-user-dropdown-menu-item {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.875rem 1rem;
        color: #fff;
        text-decoration: none;
        transition: background-color 0.2s;
        cursor: pointer;
        border: none;
        background: none;
        width: 100%;
        text-align: left;
        font-size: 0.95rem;
        font-weight: 600;
        box-sizing: border-box;
        font-family: 'Nunito', sans-serif;
    }

    .desktop-user-dropdown-menu-item:hover {
        background-color: rgba(109, 78, 255, 0.2);
    }

    .desktop-user-dropdown-menu-item svg {
        width: 1.25rem;
        height: 1.25rem;
        stroke: currentColor;
        flex-shrink: 0;
    }

    .desktop-user-dropdown-menu-item span {
        flex: 1;
        white-space: nowrap;
    }

    .desktop-user-dropdown-menu-item.logout {
        color: #ef4444;
        border-top: 1px solid rgba(109, 78, 255, 0.2);
    }

    .desktop-user-dropdown-menu-item.logout:hover {
        background-color: rgba(239, 68, 68, 0.1);
    }

    .desktop-user-info {
        /* Reset flex properties if needed inside trigger */
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .desktop-avatar {
        width: 2.25rem !important;
        height: 2.25rem !important;
        border-radius: 50% !important;
        background-color: #333 !important;
        overflow: hidden !important;
        flex-shrink: 0 !important;
        border: 2px solid #222;
    }

    .desktop-avatar-img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .desktop-username {
        font-size: 0.95rem !important;
        font-weight: 700 !important;
        color: #fff !important;
        white-space: nowrap !important;
        max-width: 150px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .desktop-chevron {
        color: #6c7080;
        transition: transform 0.2s, color 0.2s;
    }

    .desktop-user-dropdown-trigger:hover .desktop-chevron {
        color: #fff;
    }

    .desktop-user-dropdown-trigger.active .desktop-chevron {
        transform: rotate(180deg);
        color: #fff;
    }

    /* Removing old specific classes that are no longer used or needed */
    /* .desktop-deposit-btn removed */
    /* .desktop-profile-btn removed (integrated into trigger) */

    /* Скрываем мобильную навигацию */
    .bottom-navbar {
        display: none !important;
    }

    /* Скрываем мобильный блок баланса на десктопе */
    .mobile-balance-block,
    div.mobile-balance-block {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Убираем нижний отступ у контента */
    .main-content {
        padding-bottom: 2rem !important;
    }
}

/* ===== DESKTOP CONTENT CONTAINER ===== */
@media (min-width: 768px) {
    .desktop-content-container {
        max-width: 1400px;
        margin: 0 auto;
        padding: 2rem;
    }

    .desktop-max-w-2xl {
        max-width: 42rem;
    }
}

@media (min-width: 1024px) {
    .desktop-content-container {
        padding: 3rem;
    }

    .desktop-max-w-2xl {
        max-width: 56rem;
    }
}

/* ===== УЛУЧШЕННЫЕ КАРТОЧКИ ДЛЯ ДЕСКТОПА ===== */
@media (min-width: 768px) {
    .standard-card {
        transition: all 0.3s ease;
    }

    .standard-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2) !important;
    }
}

/* ===== GRID LAYOUTS ДЛЯ ДЕСКТОПА ===== */
@media (min-width: 768px) {
    .desktop-grid-2 {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .desktop-grid-3 {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }

    .desktop-grid-4 {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .desktop-grid-2 {
        gap: 2.5rem;
    }

    .desktop-grid-3 {
        gap: 2.5rem;
    }
}

/* ===== SIDEBAR LAYOUT ===== */
@media (min-width: 1024px) {
    .desktop-sidebar-layout {
        display: grid;
        grid-template-columns: 1fr 350px;
        gap: 2.5rem;
    }

    .desktop-sidebar {
        position: sticky;
        top: 100px;
        height: fit-content;
    }
}

/* ===== HERO SECTION (Для главной страницы) ===== */
@media (min-width: 768px) {
    .desktop-hero {
        text-align: center;
        padding: 3rem 0;
        margin-bottom: 3rem;
    }

    .desktop-hero h1 {
        font-size: 3rem;
        font-weight: 800;
        background: linear-gradient(135deg, #6D4EFF 0%, #a78bfa 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        margin-bottom: 1rem;
    }

    .desktop-hero p {
        font-size: 1.25rem;
        color: #9ca3af;
        max-width: 600px;
        margin: 0 auto;
    }
}

/* ===== МОДАЛЬНЫЕ ОКНА ДЛЯ ДЕСКТОПА ===== */
@media (min-width: 768px) {
    .standard-modal-content {
        max-width: 600px;
        border-radius: 1rem;
        padding: 2rem;
    }
}

@media (min-width: 1024px) {
    .standard-modal-content {
        max-width: 800px;
    }
}

/* ===== ФОРМЫ ДЛЯ ДЕСКТОПА ===== */
@media (min-width: 768px) {
    .desktop-form-group {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .desktop-form-group-full {
        grid-column: 1 / -1;
    }
}

/* ===== УЛУЧШЕННЫЕ КНОПКИ ДЛЯ ДЕСКТОПА ===== */
@media (min-width: 768px) {
    .standard-btn {
        cursor: pointer;
    }

    .standard-btn:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.15);
    }
}

/* ===== СТАТИСТИЧЕСКИЕ КАРТОЧКИ ===== */
@media (min-width: 768px) {
    .stat-card {
        background: linear-gradient(135deg, #6D4EFF 0%, #5a3fd9 100%);
        color: white;
        padding: 1.5rem;
        border-radius: 1rem;
        box-shadow: 0 4px 15px rgba(109, 78, 255, 0.3);
        transition: all 0.3s ease;
    }

    .stat-card:hover {
        transform: translateY(-4px) scale(1.02);
        box-shadow: 0 8px 25px rgba(109, 78, 255, 0.4);
    }

    .stat-card-value {
        font-size: 2.5rem;
        font-weight: 800;
        margin-bottom: 0.5rem;
    }

    .stat-card-label {
        font-size: 1rem;
        opacity: 0.9;
        font-weight: 500;
    }
}

/* ===== ТАБЛИЦЫ ДЛЯ ДЕСКТОПА ===== */
@media (min-width: 768px) {
    .desktop-table {
        width: 100%;
        border-collapse: separate;
        border-spacing: 0;
        background-color: #1E1D30;
        border-radius: 0.75rem;
        overflow: hidden;
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    }

    .desktop-table th {
        background-color: #181A20;
        padding: 1rem;
        text-align: left;
        font-weight: bold;
        color: #FFFFFF;
        border-bottom: 2px solid rgba(109, 78, 255, 0.3);
    }

    .desktop-table td {
        padding: 1rem;
        border-bottom: 1px solid rgba(109, 78, 255, 0.2);
        color: #FFFFFF;
    }

    .desktop-table tr:last-child td {
        border-bottom: none;
    }

    .desktop-table tr:hover {
        background-color: #374151;
    }
}

/* ===== АНИМАЦИИ ДЛЯ ДЕСКТОПА ===== */
@media (min-width: 768px) {
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    @keyframes slideInRight {
        from {
            opacity: 0;
            transform: translateX(30px);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .animate-fade-in-up {
        animation: fadeInUp 0.6s ease-out;
    }

    .animate-fade-in {
        animation: fadeIn 0.6s ease-out;
    }

    .animate-slide-in-right {
        animation: slideInRight 0.6s ease-out;
    }
}

/* ===== TOOLTIP ДЛЯ ДЕСКТОПА ===== */
@media (min-width: 768px) {
    .desktop-tooltip {
        position: relative;
        cursor: help;
    }

    .desktop-tooltip::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%) translateY(-8px);
        padding: 0.5rem 0.75rem;
        background-color: #1f2937;
        color: white;
        font-size: 0.875rem;
        border-radius: 0.5rem;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 100;
    }

    .desktop-tooltip:hover::after {
        opacity: 1;
    }
}

/* ===== SCROLLBAR STYLING ДЛЯ ДЕСКТОПА ===== */
@media (min-width: 768px) {

    /* Для webkit браузеров (Chrome, Safari) */
    ::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }

    ::-webkit-scrollbar-track {
        background: #181A20;
        border-radius: 5px;
    }

    ::-webkit-scrollbar-thumb {
        background: #31333F;
        border-radius: 5px;
        transition: background 0.3s ease;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: #6D4EFF;
    }
}

/* ===== BREADCRUMBS ===== */
@media (min-width: 768px) {
    .desktop-breadcrumbs {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 2rem;
        font-size: 0.875rem;
        color: #9ca3af;
    }

    .desktop-breadcrumbs a {
        color: #6D4EFF;
        text-decoration: none;
        transition: color 0.3s ease;
    }

    .desktop-breadcrumbs a:hover {
        color: #5a3fd9;
        text-decoration: underline;
    }

    .desktop-breadcrumbs svg {
        width: 1rem;
        height: 1rem;
    }
}

/* ===== GUEST MODE STYLES ===== */

/* Desktop Guest Login Button */
.desktop-guest-login-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, #6D4EFF 0%, #5a3fd9 100%);
    color: #fff;
    border: none;
    border-radius: 99em;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
    box-shadow: 0 4px 15px rgba(109, 78, 255, 0.3);
}

.desktop-guest-login-btn:hover {
    background: linear-gradient(135deg, #5a3fd9 0%, #4a32b8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(109, 78, 255, 0.4);
}

.desktop-guest-login-btn svg {
    stroke: currentColor;
}

/* Mobile Guest Login Button */
.mobile-guest-login-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #6D4EFF 0%, #5a3fd9 100%);
    color: #fff;
    border: none;
    border-radius: 99em;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
    width: 100%;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(109, 78, 255, 0.3);
}

.mobile-guest-login-btn:hover {
    background: linear-gradient(135deg, #5a3fd9 0%, #4a32b8 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(109, 78, 255, 0.4);
}

.mobile-guest-login-btn svg {
    stroke: currentColor;
    flex-shrink: 0;
}

/* Login Required Modal */
.login-required-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-required-modal.active {
    opacity: 1;
    visibility: visible;
}

.login-required-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.login-required-modal-content {
    position: relative;
    background-color: #1E1D30;
    border-radius: 1.25rem;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(109, 78, 255, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.login-required-modal.active .login-required-modal-content {
    transform: scale(1) translateY(0);
}

.login-required-modal-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.login-required-modal-icon svg {
    stroke: #6D4EFF;
}

.login-required-modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.75rem;
    font-family: 'Nunito', sans-serif;
}

.login-required-modal-message {
    font-size: 1rem;
    color: #9ca3af;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.login-required-modal-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.login-required-modal-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #6D4EFF 0%, #5a3fd9 100%);
    color: #fff;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
    box-shadow: 0 4px 15px rgba(109, 78, 255, 0.3);
}

.login-required-modal-btn-primary:hover {
    background: linear-gradient(135deg, #5a3fd9 0%, #4a32b8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(109, 78, 255, 0.4);
}

.login-required-modal-btn-primary svg {
    stroke: currentColor;
}

.login-required-modal-btn-secondary {
    padding: 0.75rem 1.5rem;
    background-color: transparent;
    color: #9ca3af;
    border: 1px solid #374151;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Nunito', sans-serif;
}

.login-required-modal-btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: #4b5563;
}

/* ===== КОНЕЦ DESKTOP LAYOUT STYLES ===== */