/**
 * SHAC Gallery Mobile Enhancements
 * Optimizes interactive audio browsing for mobile discovery
 * 
 * Perfect for mobile music exploration and SHAC file downloads
 */

@media (max-width: 768px) {
    
    /* ============================================
       MOBILE LAYOUT OPTIMIZATION
       ============================================ */
    
    .container {
        padding: 20px 15px !important;
        max-width: 100% !important;
    }
    
    /* ============================================
       MOBILE HEADER SECTION
       ============================================ */
    
    header {
        text-align: center;
        margin-bottom: 25px !important;
        padding-bottom: 20px;
        border-bottom: 1px solid #333;
    }
    
    header h1 {
        font-size: 2.5em !important;
        font-weight: 700;
        color: #fff;
        margin-bottom: 8px;
        letter-spacing: 3px;
    }
    
    .tagline {
        font-size: 1.1em !important;
        color: #4ecdc4 !important;
        font-weight: 500;
        font-style: italic;
    }
    
    /* ============================================
       MOBILE INTRO SECTION
       ============================================ */
    
    .intro {
        background: #0a0a0a !important;
        border: 1px solid #222 !important;
        border-radius: 12px !important;
        padding: 20px !important;
        margin-bottom: 30px;
        line-height: 1.6;
    }
    
    .intro p {
        font-size: 0.95em !important;
        color: #e8e8e8 !important;
        margin-bottom: 15px;
    }
    
    .intro p:last-child {
        margin-bottom: 0;
    }
    
    .intro strong {
        color: #4ecdc4;
        font-weight: 600;
    }
    
    .intro a {
        color: #667eea;
        text-decoration: none;
        font-weight: 500;
        border-bottom: 1px solid rgba(102, 126, 234, 0.3);
        transition: border-color 0.3s ease;
    }
    
    .intro a:hover,
    .intro a:active {
        border-bottom-color: #667eea;
    }
    
    .intro .note {
        background: rgba(102, 126, 234, 0.1) !important;
        border: 1px solid #667eea !important;
        border-radius: 8px !important;
        padding: 12px 16px !important;
        margin-top: 15px !important;
        font-size: 0.9em !important;
        color: #8fa7ff !important;
    }
    
    .intro .note em {
        font-style: normal;
        font-weight: 500;
    }
    
    /* ============================================
       MOBILE SONGS SECTION
       ============================================ */
    
    .songs {
        margin-bottom: 40px;
    }
    
    .songs h2 {
        font-size: 1.6em !important;
        color: #fff !important;
        font-weight: 600;
        margin-bottom: 20px;
        text-align: center;
        padding-bottom: 12px;
        border-bottom: 1px solid #333;
    }
    
    .song-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    /* ============================================
       MOBILE SONG CARDS
       ============================================ */
    
    .song-card {
        background: linear-gradient(135deg, #111 0%, #1a1a1a 100%) !important;
        border: 1px solid #333 !important;
        border-radius: 12px !important;
        padding: 20px !important;
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }
    
    .song-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(78, 205, 196, 0.05) 0%, rgba(102, 126, 234, 0.05) 100%);
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }
    
    .song-card:active {
        transform: scale(0.98);
        border-color: #4ecdc4;
    }
    
    .song-card:active::before {
        opacity: 1;
    }
    
    /* Star indicator for featured tracks */
    .song-card h3 {
        font-size: 1.3em !important;
        color: #fff !important;
        font-weight: 600;
        margin-bottom: 8px;
        display: flex;
        align-items: center;
        gap: 8px;
        line-height: 1.3;
    }
    
    .song-card h3:first-letter {
        font-size: 1.2em;
    }
    
    .genre {
        font-size: 0.85em !important;
        color: #4ecdc4 !important;
        font-weight: 500;
        margin-bottom: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .description {
        font-size: 0.9em !important;
        color: #ccc !important;
        line-height: 1.6 !important;
        margin-bottom: 15px;
    }
    
    .description em {
        color: #888;
        font-size: 0.9em;
        display: block;
        margin-top: 8px;
    }
    
    /* ============================================
       MOBILE FILE INFO
       ============================================ */
    
    .file-info {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 15px !important;
        padding: 10px 15px !important;
        background: #0a0a0a !important;
        border-radius: 8px !important;
        border: 1px solid #222;
    }
    
    .file-info .size,
    .file-info .duration {
        font-size: 0.85em !important;
        color: #888 !important;
        font-weight: 500;
        font-family: 'JetBrains Mono', monospace;
    }
    
    .file-info .size {
        color: #667eea;
    }
    
    .file-info .duration {
        color: #4ecdc4;
    }
    
    /* ============================================
       MOBILE DOWNLOAD BUTTONS
       ============================================ */
    
    .download-options {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .download-btn {
        width: 100% !important;
        min-height: 50px !important;
        background: linear-gradient(135deg, #4ecdc4 0%, #44b3a8 100%) !important;
        color: #000 !important;
        text-decoration: none !important;
        border: none !important;
        border-radius: 12px !important;
        font-size: 1em !important;
        font-weight: 600 !important;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px;
        box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
        text-align: center;
        padding: 14px 20px;
    }
    
    .download-btn::before {
        content: "⬇️";
        font-size: 1.2em;
    }
    
    .download-btn:hover:not(:disabled),
    .download-btn:active {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
    }
    
    .download-btn:active {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgba(78, 205, 196, 0.3);
    }
    
    /* Secondary download options */
    .secondary-download {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
        color: #fff !important;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }
    
    .secondary-download::before {
        content: "🎵";
    }
    
    .secondary-download:hover,
    .secondary-download:active {
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    }
    
    /* ============================================
       MOBILE EXTERNAL LINKS
       ============================================ */
    
    .external-link {
        background: rgba(102, 126, 234, 0.1) !important;
        color: #8fa7ff !important;
        border: 1px solid #667eea !important;
        box-shadow: none !important;
    }
    
    .external-link::before {
        content: "🔗";
    }
    
    .external-link:hover,
    .external-link:active {
        background: rgba(102, 126, 234, 0.2) !important;
        transform: translateY(-1px);
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
    }
    
    /* ============================================
       MOBILE PLAYER STATUS
       ============================================ */
    
    .player-status {
        position: fixed;
        bottom: 80px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0,0,0,0.9) !important;
        border: 1px solid #4ecdc4 !important;
        border-radius: 25px !important;
        padding: 12px 20px;
        font-size: 0.9em;
        color: #4ecdc4;
        font-weight: 500;
        z-index: 999;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        display: none; /* Initially hidden */
    }
    
    .player-status.active {
        display: block;
        animation: slideUp 0.3s ease;
    }
    
    @keyframes slideUp {
        from { opacity: 0; transform: translateX(-50%) translateY(20px); }
        to { opacity: 1; transform: translateX(-50%) translateY(0); }
    }
    
    /* ============================================
       MOBILE FOOTER
       ============================================ */
    
    footer {
        text-align: center !important;
        margin-top: 40px !important;
        padding-top: 30px !important;
        border-top: 1px solid #333 !important;
        font-size: 0.85em !important;
        color: #666 !important;
    }
    
    footer p {
        line-height: 1.5;
    }
    
    /* ============================================
       MOBILE AUDIO VISUALIZER OPTIMIZATION
       ============================================ */
    
    #visualizer-toggle {
        bottom: 15px !important;
        right: 15px !important;
        z-index: 1000 !important;
    }
    
    #visualizer-toggle button {
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 12px !important;
        font-size: 14px !important;
        border-radius: 8px !important;
        background: rgba(0,0,0,0.8) !important;
        border: 1px solid rgba(255,255,255,0.3) !important;
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        transition: all 0.3s ease;
    }
    
    #visualizer-toggle button:active {
        transform: scale(0.95);
        background: rgba(78, 205, 196, 0.2) !important;
        border-color: #4ecdc4 !important;
    }
    
    /* ============================================
       MOBILE DOWNLOAD PROGRESS
       ============================================ */
    
    .download-progress {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: rgba(0,0,0,0.95) !important;
        border: 1px solid #4ecdc4 !important;
        border-radius: 12px !important;
        padding: 30px;
        text-align: center;
        z-index: 1001;
        min-width: 280px;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }
    
    .progress-title {
        font-size: 1.1em;
        color: #fff;
        font-weight: 600;
        margin-bottom: 15px;
    }
    
    .progress-bar {
        width: 100%;
        height: 8px;
        background: #333;
        border-radius: 4px;
        overflow: hidden;
        margin-bottom: 12px;
    }
    
    .progress-fill {
        height: 100%;
        background: linear-gradient(90deg, #4ecdc4 0%, #44b3a8 100%);
        border-radius: 4px;
        transition: width 0.3s ease;
        width: 0%;
    }
    
    .progress-text {
        font-size: 0.9em;
        color: #888;
        font-family: 'JetBrains Mono', monospace;
    }
    
    /* ============================================
       MOBILE SHARING INTEGRATION
       ============================================ */
    
    .share-btn {
        background: rgba(255,255,255,0.1) !important;
        color: #ccc !important;
        border: 1px solid #444 !important;
        box-shadow: none !important;
        margin-top: 8px;
    }
    
    .share-btn::before {
        content: "📤";
    }
    
    .share-btn:hover,
    .share-btn:active {
        background: rgba(255,255,255,0.2) !important;
        border-color: #666 !important;
    }
    
    /* Native mobile sharing */
    @media (max-width: 768px) and (hover: none) {
        .share-btn {
            display: block !important;
        }
    }
    
    /* ============================================
       MOBILE ACCESSIBILITY ENHANCEMENTS
       ============================================ */
    
    /* Enhanced touch targets */
    .download-btn,
    .song-card {
        min-height: 60px !important;
        touch-action: manipulation;
    }
    
    /* Better focus indicators */
    .download-btn:focus {
        box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.5) !important;
    }
    
    /* Improved contrast for mobile screens */
    .song-card h3 {
        color: #fff !important;
    }
    
    .description {
        color: #e0e0e0 !important;
    }
    
    /* ============================================
       MOBILE UTILITY CLASSES
       ============================================ */
    
    .mobile-hidden { display: none !important; }
    .mobile-only { display: block !important; }
    .mobile-center { text-align: center !important; }
    .mobile-full-width { width: 100% !important; }
    .mobile-stack { flex-direction: column !important; }
    .mobile-no-gap { gap: 0 !important; }
}

/* ============================================
   DESKTOP-ONLY UTILITIES
   ============================================ */

@media (min-width: 769px) {
    .mobile-only { display: none !important; }
    .download-progress { display: none !important; }
}