/* ===== Mobile & Tablet Responsive Styles ===== */

/* Tablet (769px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .nav-menu li a {
        padding: 0.65rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .banner-content {
        padding: 3rem 2rem;
    }
    
    .banner-title {
        font-size: 2.5rem;
    }
    
    .auth-box {
        max-width: 700px;
        padding: 3rem;
    }
    
    .topup-grid,
    .auth-form .form-row {
        gap: 1.5rem;
    }
    
    .minigames-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile (≤768px) */
@media (max-width: 768px) {
    /* Navigation Mobile */
    .navbar {
        padding: 0.75rem 0;
    }
    
    .navbar .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 1rem;
    }
    
    .nav-brand {
        display: flex;
        align-items: center;
        padding-left: 1.25rem;
    }
    
    .nav-logo {
        height: 70px;
    }
    
    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 1001;
        background: none;
        border: none;
        color: var(--purple-neon);
        font-size: 1.8rem;
        cursor: pointer;
        padding: 0.5rem;
        transition: all 0.3s;
        width: 45px;
        height: 45px;
    }
    
    .nav-toggle:hover {
        color: var(--cyan-neon);
        transform: scale(1.1);
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: linear-gradient(135deg, rgba(10, 10, 10, 0.98) 0%, rgba(26, 26, 26, 0.98) 100%);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 5rem 0 2rem;
        display: flex;
        border-left: 2px solid rgba(168, 85, 247, 0.3);
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        overflow-y: auto;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu li {
        margin: 0;
        border-bottom: 1px solid rgba(168, 85, 247, 0.1);
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-menu li a {
        width: 100%;
        padding: 1.25rem 1.5rem;
        font-size: 1.05rem;
        display: flex;
        align-items: center;
        gap: 1.25rem;
        border-radius: 0;
        justify-content: flex-start;
        transition: all 0.3s ease;
    }
    
    .nav-menu li a:hover {
        background: rgba(168, 85, 247, 0.15);
        padding-left: 2rem;
    }
    
    .nav-menu li a i {
        font-size: 1.3rem;
        width: 32px;
        min-width: 32px;
        text-align: center;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-menu li a.active {
        background: linear-gradient(90deg, rgba(168, 85, 247, 0.2) 0%, transparent 100%);
        border-left: 4px solid var(--purple-neon);
        padding-left: calc(1.5rem - 4px);
    }
    
    /* Mobile User Dropdown */
    .nav-user-dropdown {
        margin-left: 0;
        width: 100%;
        position: static;
    }
    
    .nav-user-trigger {
        width: 100%;
        padding: 1rem 1.5rem !important;
        border-radius: 0 !important;
        border: none !important;
        border-bottom: 1px solid rgba(168, 85, 247, 0.1) !important;
        justify-content: space-between;
    }
    
    .user-avatar {
        width: 35px;
        height: 35px;
        font-size: 1.3rem;
    }
    
    .user-info {
        flex: 1;
        margin-left: 0.5rem;
    }
    
    .user-name {
        font-size: 1rem;
    }
    
    .user-balance {
        font-size: 0.9rem;
    }
    
    .dropdown-menu {
        position: static !important;
        width: 100% !important;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        transform: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
        background: rgba(15, 15, 15, 0.95);
        transition: max-height 0.4s ease, padding 0.4s ease;
        padding: 0;
    }
    
    .nav-user-dropdown.active .dropdown-menu {
        max-height: 500px;
        padding: 0;
        border-top: 1px solid rgba(168, 85, 247, 0.2);
        border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    }
    
    .dropdown-header {
        padding: 1.25rem 1.5rem;
        border-radius: 0;
    }
    
    .dropdown-balance {
        padding: 1rem 1.5rem;
    }
    
    .dropdown-item {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    .dropdown-item:hover {
        padding-left: 2rem;
    }
    
    .dropdown-item.logout {
        border-radius: 0;
    }
    
    .dropdown-divider {
        margin: 0;
    }
    
    /* Mobile Overlay */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s;
    }
    
    .mobile-overlay.active {
        display: block;
        opacity: 1;
    }
    
    /* Hero & Banner Mobile */
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .banner-slider {
        min-height: auto;
    }
    
    .banner-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 2rem 1.5rem;
        min-height: auto;
    }
    
    .banner-title {
        font-size: 1.8rem;
    }
    
    .banner-description {
        font-size: 1rem;
    }
    
    .price-value {
        font-size: 2rem;
    }
    
    .banner-actions {
        flex-direction: column;
    }
    
    .banner-actions .btn {
        width: 100%;
    }
    
    .banner-image {
        order: -1;
        padding-bottom: 2rem;
    }
    
    .banner-image img {
        max-height: 250px;
    }
    
    /* Products & Cards Mobile */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .section-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    /* Footer Mobile */
    .footer-wave {
        height: 60px;
    }
    
    .footer-wave svg {
        height: 60px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-section {
        text-align: center;
    }
    
    .footer-section ul {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .social-links {
        flex-direction: row !important;
        justify-content: center;
    }
    
    .footer-logo {
        justify-content: center;
    }
    
    /* Auth Pages Mobile */
    .auth-section {
        padding: 2rem 0;
    }
    
    .auth-box {
        max-width: 100%;
        padding: 2.5rem 1.5rem;
        margin: 1rem;
        border-radius: 20px;
    }
    
    .auth-header h2 {
        font-size: 1.8rem;
    }
    
    .auth-logo img {
        max-height: 100px !important;
    }
    
    .auth-form .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    /* Minigame & Topup Mobile */
    .topup-grid {
        grid-template-columns: 1fr;
    }
    
    .minigames-grid {
        grid-template-columns: 1fr;
    }
    
    .minigame-card {
        padding: 2rem 1.5rem;
    }
    
    .topup-form-container,
    .topup-sidebar {
        padding: 2rem 1.5rem;
    }
    
    /* Page Header Mobile */
    .page-header {
        padding: 2rem 0;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .page-header .page-logo img {
        max-height: 100px !important;
    }
    
    /* Balance Card Mobile */
    .balance-card {
        padding: 1.5rem;
    }
    
    .balance-card h2 {
        font-size: 2rem;
    }
    
    /* Product Detail Mobile */
    .product-detail-grid {
        grid-template-columns: 1fr;
    }
    
    /* History Table Mobile */
    .history-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .history-table table {
        min-width: 600px;
    }
    
    /* Loader Mobile */
    .page-loader {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .loader-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 100vw;
        padding: 0 1rem;
    }
    
    .loader-logo-container {
        width: 160px;
        height: 160px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }
    
    .loader-logo {
        width: 100px;
        height: auto;
    }
    
    .progress-ring {
        width: 160px;
        height: 160px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(-90deg);
    }
    
    .progress-ring-circle {
        stroke-width: 5;
        stroke-dasharray: 452.39;
        animation: progressMobile 2s ease-in-out infinite;
    }
    
    @keyframes progressMobile {
        0% {
            stroke-dashoffset: 452.39;
        }
        50% {
            stroke-dashoffset: 0;
        }
        100% {
            stroke-dashoffset: -452.39;
        }
    }
    
    .loader-text {
        font-size: 1rem;
        margin-top: 1rem;
        text-align: center;
    }
}

/* Small Mobile (≤480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .navbar .container {
        padding: 0 10px;
    }
    
    .nav-menu {
        width: 85%;
    }
    
    .banner-content {
        padding: 1.5rem 1rem;
        border-radius: 15px;
    }
    
    .banner-title {
        font-size: 1.5rem;
    }
    
    .banner-description {
        font-size: 0.9rem;
    }
    
    .auth-box {
        padding: 2rem 1rem;
        margin: 0.5rem;
        border-radius: 15px;
    }
    
    .auth-header h2 {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .form-control {
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
    }
    
    .minigame-card,
    .topup-form-container,
    .topup-sidebar {
        padding: 1.5rem 1rem;
        border-radius: 15px;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .product-card {
        margin: 0;
    }
    
    .social-links a {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    /* Loader Small Mobile */
    .loader-logo-container {
        width: 140px;
        height: 140px;
        margin: 0 auto;
    }
    
    .loader-logo {
        width: 80px;
        height: auto;
    }
    
    .progress-ring {
        width: 140px;
        height: 140px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(-90deg);
    }
    
    .progress-ring-circle {
        stroke-width: 4;
        stroke-dasharray: 395.84;
        animation: progressSmall 2s ease-in-out infinite;
    }
    
    @keyframes progressSmall {
        0% {
            stroke-dashoffset: 395.84;
        }
        50% {
            stroke-dashoffset: 0;
        }
        100% {
            stroke-dashoffset: -395.84;
        }
    }
    
    .loader-text {
        font-size: 0.95rem;
        text-align: center;
    }
    
    .navbar .container {
        padding: 0 0.5rem;
    }
    
    .nav-logo {
        height: 60px;
    }
    
    .nav-brand {
        padding-left: 1rem;
    }
    
    .nav-toggle {
        font-size: 1.6rem;
        padding: 0.5rem;
        width: 40px;
        height: 40px;
    }
}

/* Landscape Mode */
@media (max-height: 500px) and (orientation: landscape) {
    .nav-menu {
        padding: 3rem 0 1rem;
    }
    
    .nav-menu li a {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .auth-section {
        padding: 1rem 0;
    }
    
    .loader-logo-container {
        width: 120px;
        height: 120px;
        margin: 0 auto;
    }
    
    .loader-logo {
        width: 70px;
        height: auto;
    }
    
    .progress-ring {
        width: 120px;
        height: 120px;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(-90deg);
    }
    
    .progress-ring-circle {
        stroke-width: 4;
        stroke-dasharray: 339.29;
        animation: progressLandscape 2s ease-in-out infinite;
    }
    
    @keyframes progressLandscape {
        0% {
            stroke-dashoffset: 339.29;
        }
        50% {
            stroke-dashoffset: 0;
        }
        100% {
            stroke-dashoffset: -339.29;
        }
    }
}
