/* ============================================================
   MOBILE SPECIFIC STYLES (Ultra-Premium Optimization)
   Targeting devices up to 1024px (Tablets) and 768px (Mobiles)
============================================================ */

/* TABLET & SMALL LAPTOP (Max: 1024px) */
@media screen and (max-width: 1024px) {
    /* Optimize orbs for tablet performance */
    body::before, body::after, .bg-orb-3 {
        filter: blur(100px); /* Reduced from 140px for performance */
    }

    .audio-player {
        flex-direction: column;
        border-radius: 32px;
        padding: 2rem;
        gap: 1.5rem;
        width: 95%;
    }
    
    .now-playing, .player-options {
        width: 100%;
        justify-content: center;
    }
    
    .player-center { 
        width: 100%; 
        max-width: 100%;
    }
    
    .bio-grid {
        grid-template-columns: 1fr;
    }
}

/* MOBILE PORTRAIT (Max: 768px) */
@media screen and (max-width: 768px) {
    
    /* 1. Core Layout & Performance */
    body::before, body::after, .bg-orb-3 {
        filter: blur(80px); /* Further reduce blur for mobile GPU */
        opacity: 0.3; /* Slightly dimmer to avoid overwhelming text */
        animation: floatOrb 30s infinite alternate linear; /* Simpler animation curve */
    }

    .home-page {
        height: auto;
        min-height: 100vh;
        overflow-y: auto; /* Allow scrolling */
        padding: 2rem 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }

    .glass-panel {
        /* Optimize glassmorphism for mobile GPUs */
        backdrop-filter: blur(25px) saturate(180%);
        -webkit-backdrop-filter: blur(25px) saturate(180%);
        border-radius: 20px;
        padding: 1.5rem;
    }

    /* 2. Header & Typography */
    .header {
        padding: 2rem 1.5rem 1.5rem;
    }

    .top-links {
        padding: 0;
        flex-direction: row;
        justify-content: center;
        gap: 1.2rem;
        font-size: 0.85rem;
        flex-wrap: wrap;
    }

    .header h1 { 
        font-size: 2.2rem; 
        line-height: 1.2;
    }

    .header p {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .logo, .profile-image { 
        width: 120px; 
        height: 120px; 
        margin-bottom: 1.5rem;
    }

    /* 3. Cards Layout */
    .reciter-list { 
        grid-template-columns: 1fr; 
        gap: 1.5rem;
        margin-top: 2rem;
        padding: 0 1.5rem;
    }

    .surah-list { 
        grid-template-columns: 1fr; 
        gap: 1.2rem;
        padding: 0 1.5rem 180px; /* Space for the floating player */
    }

    .reciter-card {
        padding: 1.5rem;
    }

    .reciter-number {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .reciter-name {
        font-size: 1.15rem;
    }

    /* 4. Search Bar */
    .search-container {
        padding: 0 1.5rem;
        margin-bottom: 2rem;
    }

    .search-input {
        padding: 1.2rem 1.5rem 1.2rem 3rem;
        font-size: 1rem;
    }

    .search-icon {
        left: 2.5rem;
    }

    /* 5. Surah Buttons */
    .button-group {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.5rem;
    }
    
    .btn {
        padding: 0.8rem 0.5rem;
        font-size: 0.75rem;
        flex: 1;
        min-width: 0;
        white-space: nowrap;
    }

    /* 6. Mobile Audio Player (Ultra-Sleek Dock) */
    .audio-player {
        bottom: 1.5rem;
        width: calc(100% - 3rem);
        padding: 1.5rem;
        border-radius: 28px;
        gap: 1.2rem;
        background: linear-gradient(135deg, rgba(20, 20, 25, 0.8) 0%, rgba(10, 10, 15, 0.9) 100%); /* Solidified slightly for text clarity */
        border-top: 1px solid rgba(255,255,255,0.15);
    }

    .now-playing {
        justify-content: space-between;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .now-playing-info {
        text-align: left;
        flex: 1;
        margin-left: 1rem;
    }

    .player-options {
        width: auto;
        min-width: auto;
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
    }

    .speed-control {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
        background: rgba(255,255,255,0.1);
    }

    .player-center {
        width: 100%;
        gap: 1.2rem;
    }

    .progress-wrapper {
        width: 100%;
    }

    .control-buttons {
        gap: 2.5rem; /* Spread controls wider for thumb tapping */
    }

    .play-pause-main {
        width: 56px;
        height: 56px;
        font-size: 1.4rem;
        box-shadow: 0 10px 25px rgba(255,255,255,0.15);
    }

    /* Touch Optimizations (Remove hover scaling, add active state) */
    .reciter-card:hover, .surah-card:hover, .logo:hover, .profile-image:hover, .btn:hover {
        transform: none; /* Disable hover jumps on mobile touch */
    }
    
    .btn:active, .reciter-card:active, .play-pause-main:active {
        transform: scale(0.96); /* Smooth tap feedback */
        transition: transform 0.1s ease;
    }

    /* 7. Notifications */
    #custom-notification {
        top: 15px;
        right: 5%;
        width: 90%;
        text-align: center;
        padding: 1rem;
        font-size: 0.9rem;
    }
}

/* VERY SMALL MOBILE (Max: 400px) */
@media screen and (max-width: 400px) {
    .header h1 {
        font-size: 1.8rem;
    }
    .top-links {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    .header {
        padding-top: 5rem;
    }
    .btn {
        font-size: 0.75rem;
    }
    .play-pause-main {
        width: 50px;
        height: 50px;
    }
}
