/* Mobile Responsive Styles */

/* Улучшаем кликабельность всех кнопок темы */
/* Увеличенный размер кнопки переключения темы */
.theme-toggle {
    cursor: pointer;
    position: relative;
    z-index: 100;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}

.theme-toggle svg {
    width: 32px;
    height: 32px;
    pointer-events: none; /* Чтобы клики проходили через SVG */
}

/* Улучшаем кликабельность Sign Out */
.sign-out-btn {
    cursor: pointer;
}

/* Скрытие мобильной навигации на десктопе */
@media (min-width: 992px) {
    .mobile-nav-container,
    .mobile-header,
    .mobile-controls {
        display: none !important;
    }
}

/* Для мобильной версии скрываем основную шапку */
@media (max-width: 991px) {
    .main-header .theme-toggle,
    .main-header .sign-out-btn {
        display: none !important;
    }
}

/* Base mobile styles */
@media (max-width: 991px) {
    :root {
        --header-height: 60px;
    }

    /* Hide sidebar for mobile */
    .sidebar {
        display: none;
    }

    /* Adjust main content to take full width */
    .main-content {
        margin-left: 0;
        width: 100%;
    }

    /* Mobile header adjustments */
    .main-header {
        padding: 0 15px;
    }

    /* Adjust dashboard content padding */
    .dashboard-content {
        padding: 15px;
    }

    /* Mobile sign out button */
    .mobile-sign-out-btn {
        background-color: #7c5cfc;
        color: white;
        border-radius: 20px;
        padding: 6px 14px;
        font-size: 14px;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 6px;
        margin: 0 12px;
        text-decoration: none;
        height: 32px;
    }
    
    .mobile-sign-out-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .mobile-sign-out-btn span {
        white-space: nowrap;
    }
    
    .mobile-controls {
        display: flex;
        align-items: center;
    }
    
    /* Adjust card padding */
    .card {
        padding: 15px;
    }

    /* Mobile Navigation Menu */
    .mobile-nav-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background-color: var(--background-medium);
        z-index: 1000;
        box-shadow: var(--shadow-md);
    }
    
    /* Бургер-кнопка */
    .mobile-burger-btn {
        display: flex;
        cursor: pointer;
        width: 40px;
        height: 40px;
        padding: 8px;
        border-radius: 4px;
        background: var(--primary-color);
        box-shadow: 0 2px 5px rgba(0,0,0,0.3);
        flex-direction: column;
        justify-content: space-between;
        align-items: center;
        z-index: 1010;
    }
    
    .mobile-burger-btn div {
        width: 25px;
        height: 3px;
        background-color: white;
        margin: 2px 0;
        border-radius: 3px;
        transition: all 0.3s ease;
    }
    
    /* Активное состояние бургера */
    .mobile-burger-btn.active div:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .mobile-burger-btn.active div:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-burger-btn.active div:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: var(--header-height);
        padding: 0 15px;
        border-bottom: 1px solid var(--border-color);
    }
    
    /* Мобильный логотип */
    .mobile-logo {
        display: flex;
        align-items: center;
    }
    
    /* Контейнер для бургер-меню и переключателя темы */
    .mobile-controls {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    /* Стили для мобильной навигации */
    .mobile-nav-scroll {
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
        background-color: var(--background-light);
        border-top: 1px solid var(--border-color);
    }
    
    .mobile-nav-links {
        padding: 10px;
        display: flex;
        flex-direction: column;
    }
    
    .mobile-nav-link {
        display: flex;
        align-items: center;
        padding: 12px 15px;
        text-decoration: none;
        color: var(--text-secondary);
        border-radius: var(--border-radius-sm);
        margin-bottom: 5px;
        transition: all 0.3s ease;
    }
    
    .mobile-nav-link svg {
        margin-right: 12px;
        width: 20px;
        height: 20px;
    }
    
    .mobile-nav-link.active {
        background-color: rgba(110, 86, 207, 0.1);
        color: var(--primary-color);
    }
    
    .mobile-nav-link:hover {
        background-color: rgba(110, 86, 207, 0.05);
    }
    
    /* Темная тема для мобильного меню */
    .dark-theme .mobile-nav-container {
        background-color: var(--background-dark);
    }
    
    .dark-theme .mobile-nav-scroll {
        background-color: var(--background-medium-dark);
        border-top: 1px solid var(--border-color-dark);
    }
    
    .dark-theme .mobile-burger-btn span {
        background-color: var(--text-primary-dark);
    }

    .mobile-logo .solana-logo-symbol {
        width: 30px;
        height: 30px;
    }
    
    .mobile-logo .solana-logo {
        width: 100px;
        height: auto;
        margin-left: 8px;
    }

    /* Horizontal scrollable navigation */
    .mobile-nav-scroll {
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE and Edge */
        padding: 10px 15px;
        background-color: var(--background-dark);
    }

    .mobile-nav-scroll::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }

    .mobile-nav {
        display: inline-flex;
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .mobile-nav-item {
        margin-right: 20px;
    }

    .mobile-nav-item:last-child {
        margin-right: 0;
    }

    .mobile-nav-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 12px;
        transition: color var(--transition-speed);
        padding: 8px 12px;
        border-radius: var(--border-radius-sm);
    }

    .mobile-nav-link svg {
        width: 20px;
        height: 20px;
        margin-bottom: 5px;
    }

    .mobile-nav-link.active {
        color: var(--primary-color);
        background-color: rgba(110, 86, 207, 0.1);
    }

    .mobile-nav-link:hover {
        color: var(--text-primary);
    }

    /* Adjust section titles */
    .section-title h1 {
        font-size: 24px;
    }

    .section-title p {
        font-size: 14px;
    }

    /* Adjust tables for mobile */
    .table-header {
        display: none;
    }

    .table-row {
        display: block;
        padding: 15px;
        margin-bottom: 10px;
        border-radius: var(--border-radius-sm);
        background-color: var(--background-medium);
    }

    .td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid var(--border-color);
    }

    .td:last-child {
        border-bottom: none;
    }
    
    /* Улучшения для блока Your Assets на мобильном */
    .assets-card .table-row {
        border-left: 3px solid var(--primary-color);
        padding-bottom: 5px;
    }
    
    /* Отображение кнопок в блоке Your Assets на мобильном */
    .assets-card .actions {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        padding-top: 10px;
        flex-wrap: nowrap;
        margin-top: 5px;
    }
    
    /* Скрываем надпись "Действия" для кнопок */
    .assets-card .td.actions::before {
        content: none;
    }
    
    /* Стили для кнопок в мобильной версии */
    .assets-card .td.actions .btn-action {
        padding: 8px 16px;
        min-width: 90px;
        font-size: 14px;
        text-align: center;
        display: inline-block;
        border-radius: var(--border-radius-sm);
    }
    
    /* Кнопка Deposit с акцентным цветом */
    .assets-card .td.actions .btn-action:first-child {
        background-color: var(--primary-color);
        color: #fff;
        border-color: var(--primary-color);
    }
    
    /* Стили удалены для избежания конфликтов */

    .td::before {
        content: attr(data-label);
        font-weight: 500;
        color: var(--text-secondary);
    }

    /* Adjust forms for mobile */
    .form-group {
        margin-bottom: 15px;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group .form-control {
        width: 100%;
        margin-bottom: 10px;
    }

    .input-group .btn {
        width: 100%;
    }

    /* Adjust buttons for mobile */
    .btn {
        width: 100%;
        padding: 12px 15px;
    }

    /* Adjust charts for mobile */
    .chart-container {
        height: 200px;
    }

    /* Adjust cards grid */
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Adjust currency grid */
    .currency-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Adjust deposit address */
    .address-box {
        flex-direction: column;
        align-items: flex-start;
    }

    .address-actions {
        margin-top: 10px;
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    /* Adjust QR code */
    .qr-code {
        width: 150px;
        height: 150px;
        margin: 0 auto 15px;
    }
}

/* Small mobile devices */
@media (max-width: 576px) {
    .currency-grid {
        grid-template-columns: 1fr;
    }

    .search-bar {
        max-width: 200px;
    }

    .user-menu {
        margin-left: 10px;
    }

    .notification-dropdown {
        width: 300px;
        right: -140px;
    }

    .notification-dropdown::before {
        right: 155px;
    }
}

/* Sign-in and Sign-up pages specific styles */
@media (max-width: 991px) {
    /* Fix for password reset form showing on mobile */
    .password-reset-modal {
        display: none !important;
    }
    
    .password-reset-modal.active {
        display: block !important;
    }
    
    /* Fix for success modal on sign-up page */
    .success-modal-overlay {
        display: none !important;
    }
    
    .success-modal-overlay.show {
        display: flex !important;
    }
    
    /* Fix for email sent container */
    #email-sent-container {
        display: none !important;
    }
    
    #email-sent-container.active {
        display: block !important;
    }
    
    /* Adjust sign-in container for mobile */
    .sign-in-container {
        padding: 20px 15px;
    }
    
    .sign-in-card {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
    
    /* Hide features section on small screens */
    .sign-in-features {
        display: none;
    }
    
    /* Adjust form elements for mobile */
    .auth-form .form-group {
        margin-bottom: 15px;
    }
    
    .auth-form .input-wrapper {
        width: 100%;
    }
    
    /* Adjust button size */
    .auth-form .btn-primary {
        width: 100%;
        padding: 12px;
    }
}
