/* ===== COMPLETE RESPONSIVE STYLES - ALL DEVICES ===== */

/* LARGE DESKTOP SCREENS (1440px+) */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 5rem;
    }
    
    .hero-subtitle {
        font-size: 1.75rem;
    }
    
    .quiz-grid-spaced {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }
    
    .nav-container {
        padding: 0 3rem;
    }
}

/* DESKTOP SCREENS (1024px - 1439px) */
@media (min-width: 1024px) and (max-width: 1439px) {
    .hero-title {
        font-size: 4rem;
    }
    
    .hero-subtitle {
        font-size: 1.5rem;
    }
    
    .quiz-grid-spaced {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
    
    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* TABLET SCREENS (768px - 1023px) */
@media (min-width: 769px) and (max-width: 1023px) {
    .hero-title {
        font-size: 3.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .quiz-grid-spaced {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .filter-row-compact {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .btn-filter-compact {
        grid-column: 1 / -1;
        width: 100%;
    }
    
    .nav-container {
        padding: 0 2rem;
    }
}

/* MOBILE SCREENS (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    /* Show mobile bottom navigation */
    .mobile-bottom-nav {
        display: block !important;
    }
    
    /* Hide desktop navigation menu */
    .desktop-menu {
        display: none !important;
    }
    
    /* ENHANCED MOBILE HERO */
    .hero-section {
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        padding: 2rem 0;
    }
    
    .particles-background {
        opacity: 0.7 !important;
    }
    
    .hero-content {
        width: 100%;
        z-index: 25 !important;
        position: relative !important;
        padding: 4rem 1.5rem 3rem !important;
        text-align: center;
    }
    
    .hero-text {
        margin-bottom: 2.5rem;
        position: relative;
        z-index: 30;
    }
    
    /* MOBILE HERO TITLE VISIBILITY FIX */
    .hero-title.mobile-visible {
        font-size: 3.25rem !important;
        line-height: 1.1 !important;
        margin-bottom: 1.75rem !important;
        text-shadow: 4px 4px 10px rgba(0, 0, 0, 0.6) !important;
        font-weight: 900 !important;
        color: white !important;
        position: relative !important;
        z-index: 35 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        text-align: center !important;
    }
    
    .gradient-text {
        background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
        -webkit-background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
        text-shadow: none !important;
        font-weight: 900 !important;
        display: inline-block !important;
        position: relative !important;
        z-index: 35 !important;
    }
    
    .hero-subtitle.mobile-visible {
        font-size: 1.4rem !important;
        margin-bottom: 2.75rem !important;
        padding: 0 1rem !important;
        text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.7) !important;
        color: rgba(255, 255, 255, 0.98) !important;
        font-weight: 600 !important;
        line-height: 1.4 !important;
        position: relative !important;
        z-index: 35 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Mobile buttons */
    .hero-buttons {
        flex-direction: column;
        gap: 1.25rem;
        margin-bottom: 3rem;
        padding: 0 1.5rem;
    }
    
    .hero-btn {
        width: 100%;
        justify-content: center;
        font-size: 1.125rem;
        padding: 1.25rem 2rem;
    }
    
    /* Mobile stats */
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1.5rem;
        margin-top: 3rem;
    }
    
    .stat-card {
        padding: 1.75rem;
        border-radius: var(--radius-xl);
        flex-direction: row;
        text-align: left;
    }
    
    /* Mobile filters */
    .quiz-filters-ultra-compact {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .filter-row-compact {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .btn-filter-compact {
        justify-content: center;
        width: 100%;
        padding: 1rem 2rem;
    }
    
    /* Mobile quiz grid */
    .quiz-container-spaced {
        padding: 0 1.5rem;
    }
    
    .quiz-grid-spaced {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0;
    }
    
    .enhanced-card {
        padding: 1.75rem;
        border-radius: var(--radius-xl);
    }
    
    /* Mobile pagination */
    .pagination-controls-enhanced {
        flex-direction: column;
        gap: 1.25rem;
        text-align: center;
        padding: 2rem 0;
    }
    
    .btn-load-more-enhanced {
        width: 100%;
        justify-content: center;
        padding: 1.25rem 2rem;
    }
    
    /* Mobile navigation spacing */
    .main-content {
        padding-bottom: 120px;
    }
    
    .mobile-bottom-nav.minimized + .main-content {
        padding-bottom: 60px;
    }
    
    /* Navigation adjustments */
    .nav-container {
        padding: 0 1.5rem;
    }
    
    .nav-logo {
        font-size: 1.3rem;
    }
    
    .logo-text {
        display: inline-block;
    }
    
    /* User profile tablet */
    .user-name {
        max-width: 100px !important;
        font-size: 0.85rem !important;
    }
    
    .profile-dropdown {
        min-width: 300px;
        right: 0;
    }
}

/* SMALL MOBILE SCREENS (320px - 480px) */
@media (max-width: 480px) {
    /* ULTRA ENHANCED SMALL MOBILE HERO */
    .hero-section {
        min-height: 100vh;
        padding: 1rem 0;
    }
    
    .hero-content {
        padding: 3rem 1rem 2rem !important;
        z-index: 30 !important;
    }
    
    .hero-title.mobile-visible {
        font-size: 2.75rem !important;
        line-height: 1.1 !important;
        margin-bottom: 1.5rem !important;
        text-shadow: 4px 4px 12px rgba(0, 0, 0, 0.8) !important;
        font-weight: 900 !important;
        z-index: 40 !important;
    }
    
    .hero-subtitle.mobile-visible {
        font-size: 1.2rem !important;
        padding: 0 0.5rem !important;
        text-shadow: 3px 3px 10px rgba(0, 0, 0, 0.8) !important;
        line-height: 1.3 !important;
        z-index: 40 !important;
    }
    
    .hero-buttons {
        padding: 0 1rem;
        gap: 1rem;
    }
    
    .hero-btn {
        padding: 1.125rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Small mobile stats */
    .hero-stats {
        padding: 0 1rem;
        gap: 1.25rem;
    }
    
    .stat-card {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    /* Small mobile navigation */
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-logo {
        font-size: 1.125rem;
    }
    
    .logo-text {
        display: none; /* Show only icon on very small screens */
    }
    
    .user-name {
        display: none !important; /* Hide username on very small screens */
    }
    
    .user-profile {
        padding: 0.5rem;
        gap: 0;
    }
    
    .btn-login span {
        display: none; /* Show only icon */
    }
    
    .profile-dropdown {
        min-width: 250px;
        right: -0.5rem;
    }
    
    /* Small mobile filters */
    .quiz-filters-ultra-compact {
        padding: 1.25rem;
    }
    
    .filter-label-compact span {
        display: none; /* Show only icons */
    }
    
    /* Small mobile quiz cards */
    .quiz-container-spaced {
        padding: 0 1rem;
    }
    
    .enhanced-card {
        padding: 1.5rem;
    }
    
    .quiz-title {
        font-size: 1.25rem;
    }
    
    .quiz-info {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    /* Small mobile states */
    .login-required-state,
    .no-quizzes-state,
    .connection-issue {
        padding: 3rem 1.5rem;
    }
    
    .login-icon,
    .no-quiz-icon,
    .connection-icon {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }
    
    .login-required-state h3,
    .no-quizzes-state h3,
    .connection-issue h3 {
        font-size: 1.5rem;
    }
    
    .login-features {
        gap: 0.5rem;
    }
    
    .feature-item {
        font-size: 0.9rem;
    }
    
    /* Ultra minimal mobile toggle adjustments */
    .mobile-nav-toggle-minimal {
        width: 40px;
        height: 3px;
    }
    
    .mobile-bottom-nav.minimized .mobile-nav-toggle-minimal {
        width: 50px;
        height: 4px;
    }
    
    /* Mobile bottom navigation */
    .mobile-nav-content {
        padding: 0.75rem 0.5rem 1.25rem;
    }
    
    .mobile-nav-item {
        padding: 0.75rem 0.5rem;
        min-width: 60px;
    }
    
    .mobile-nav-item span {
        font-size: 0.625rem;
    }
    
    .mobile-nav-item i {
        font-size: 1.125rem;
    }
}

/* EXTRA SMALL MOBILE (320px - 359px) */
@media (max-width: 359px) {
    .hero-title.mobile-visible {
        font-size: 2.25rem !important;
        margin-bottom: 1rem !important;
    }
    
    .hero-subtitle.mobile-visible {
        font-size: 1rem !important;
        padding: 0 !important;
        margin-bottom: 2rem !important;
    }
    
    .hero-content {
        padding: 2.5rem 0.75rem 1.5rem !important;
    }
    
    .hero-buttons {
        padding: 0 0.75rem;
    }
    
    .hero-stats {
        padding: 0 0.75rem;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    .quiz-container-spaced {
        padding: 0 0.75rem;
    }
    
    .quiz-filters-ultra-compact {
        padding: 1rem;
        margin: 0 0.75rem 1.5rem;
    }
}

/* HIGH-RESOLUTION DISPLAYS */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-title,
    .section-title {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    .user-avatar,
    .dropdown-avatar {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* LANDSCAPE MOBILE ORIENTATION */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .hero-content {
        padding: 2rem 1rem !important;
    }
    
    .hero-title.mobile-visible {
        font-size: 2.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    .hero-subtitle.mobile-visible {
        font-size: 1.125rem !important;
        margin-bottom: 1.5rem !important;
    }
    
    .hero-buttons {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .hero-btn {
        width: auto;
        min-width: 150px;
    }
    
    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        margin-top: 2rem;
    }
    
    .stat-card {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
}

/* DARK MODE SUPPORT */
@media (prefers-color-scheme: dark) {
    :root {
        --gray-50: #1a1a1a;
        --gray-100: #262626;
        --gray-200: #404040;
        --gray-300: #525252;
        --gray-400: #737373;
        --gray-500: #a3a3a3;
        --gray-600: #d4d4d4;
        --gray-700: #e5e5e5;
        --gray-800: #f5f5f5;
        --gray-900: #ffffff;
    }
    
    .navbar {
        background: rgba(26, 26, 26, 0.95);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .mobile-nav-content {
        background: rgba(26, 26, 26, 0.98);
        border-top-color: rgba(255, 255, 255, 0.1);
    }
    
    .enhanced-card {
        background: var(--gray-100);
        border-color: var(--gray-200);
    }
    
    .quiz-filters-ultra-compact {
        background: var(--gray-100);
        border-color: var(--gray-200);
    }
    
    .filter-select-compact,
    .filter-input-compact {
        background: var(--gray-100);
        border-color: var(--gray-300);
        color: var(--gray-700);
    }
}

/* REDUCED MOTION SUPPORT */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .bubble-enhanced {
        animation: none;
        display: none;
    }
    
    .floating-card {
        animation: none;
    }
    
    .pulse-effect,
    .pulse-animation {
        animation: none;
    }
}

/* PRINT STYLES */
@media print {
    .navbar,
    .mobile-bottom-nav,
    .bubble-effects,
    .particles-background,
    .auth-modal,
    .ad-banner {
        display: none !important;
    }
    
    .hero-section {
        background: white !important;
        color: black !important;
        min-height: auto;
    }
    
    .hero-title,
    .hero-subtitle {
        color: black !important;
        text-shadow: none !important;
    }
    
    .gradient-text {
        -webkit-text-fill-color: black !important;
        background: none !important;
    }
    
    .main-content {
        padding-bottom: 0 !important;
    }
}

/* ACCESSIBILITY ENHANCEMENTS */
@media (prefers-contrast: high) {
    .hero-title,
    .hero-subtitle {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8) !important;
    }
    
    .nav-link:focus,
    .mobile-nav-item:focus {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
    }
    
    .btn-quiz-start-enhanced:focus {
        outline: 3px solid white;
        outline-offset: 2px;
    }
}

/* ULTRA-WIDE DISPLAYS (1920px+) */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }
    
    .hero-title {
        font-size: 6rem;
    }
    
    .hero-subtitle {
        font-size: 2rem;
    }
    
    .quiz-grid-spaced {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }
    
    .nav-container {
        padding: 0 4rem;
    }
    
    .section-title {
        font-size: 4rem;
    }
}

/* HOVER DEVICE SUPPORT */
@media (hover: hover) {
    .enhanced-card:hover {
        transform: translateY(-12px);
    }
    
    .stat-card:hover {
        transform: translateY(-8px) scale(1.05);
    }
    
    .mobile-nav-item:hover {
        transform: translateY(-3px);
    }
}

/* NO HOVER DEVICE SUPPORT (Touch Devices) */
@media (hover: none) {
    .enhanced-card:hover {
        transform: none;
    }
    
    .stat-card:hover {
        transform: none;
    }
    
    .enhanced-card:active {
        transform: scale(0.98);
    }
    
    .btn-quiz-start-enhanced:active {
        transform: scale(0.95);
    }
}

/* VERY TALL SCREENS */
@media (min-height: 900px) {
    .hero-section {
        min-height: 90vh;
    }
    
    .hero-content {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
}

/* SHORT SCREENS (Landscape phones) */
@media (max-height: 600px) and (orientation: landscape) {
    .hero-section {
        min-height: 100vh;
        padding: 1rem 0;
    }
    
    .hero-content {
        padding: 1.5rem 1rem !important;
    }
    
    .hero-stats {
        margin-top: 2rem;
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}

