/* Planet FM Tanzania - Responsive Design */
/* Mobile-First Approach */

/* Base Mobile Styles (320px and up) */
@media screen and (max-width: 767px) {
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: var(--spacing-2xl);
        transition: left var(--transition-normal);
        z-index: 999;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-link {
        font-size: 1.125rem;
        padding: var(--spacing-md) 0;
        width: 100%;
        text-align: center;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    /* Hero Section */
    .hero {
        min-height: 100vh;
        padding: var(--spacing-lg) 0;
    }

    .hero-content {
        padding: 0 var(--spacing-md);
    }

    .station-name {
        font-size: 2rem;
    }

    .station-tagline {
        font-size: 1rem;
    }

    /* Live Player */
    .live-player {
        padding: var(--spacing-lg);
        margin: 0 var(--spacing-md) var(--spacing-xl);
    }

    .player-main {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
    }

    .play-btn {
        width: 60px;
        height: 60px;
        font-size: 1.25rem;
    }

    .player-controls {
        justify-content: center;
    }

    .volume-slider {
        width: 80px;
    }

    /* Quick Actions */
    .quick-actions {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }

    .action-btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    /* Current Show */
    .show-card {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--spacing-md);
        margin: 0 var(--spacing-md);
    }

    .show-image {
        width: 80px;
        height: 80px;
        margin: 0 auto;
    }

    /* Schedule Grid */
    .schedule-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        margin: 0 var(--spacing-md) var(--spacing-xl);
    }

    .schedule-actions {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }

    /* News Grid */
    .news-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        margin: 0 var(--spacing-md) var(--spacing-xl);
    }

    .news-card.featured {
        grid-template-columns: 1fr;
    }

    .news-card.featured .news-image {
        height: 200px;
    }

    /* Presenters Grid */
    .presenters-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        margin: 0 var(--spacing-md) var(--spacing-xl);
    }

    .presenter-image {
        width: 100px;
        height: 100px;
    }

    /* Contact Grid */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        margin: 0 var(--spacing-md) var(--spacing-xl);
    }

    .contact-form {
        margin: 0 var(--spacing-md);
    }

    .map-container {
        margin: 0 var(--spacing-md);
        height: 300px;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }

    .newsletter-form {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .newsletter-form button {
        width: 100%;
    }

    /* Modals */
    .modal {
        width: 95%;
        padding: var(--spacing-xl);
        max-height: 85vh;
    }

    /* Container */
    .container {
        padding: 0 var(--spacing-md);
    }

    /* Sections */
    section {
        padding: var(--spacing-2xl) 0;
    }

    .section-title {
        font-size: 1.75rem;
        margin-bottom: var(--spacing-xl);
    }

    /* Typography */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    /* Buttons */
    .btn {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 0.875rem;
    }

    /* Forms */
    .form-group input,
    .form-group textarea {
        padding: var(--spacing-sm);
        font-size: 1rem;
    }
}

/* Tablet Styles (768px to 1023px) */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    /* Navigation */
    .nav-menu {
        gap: var(--spacing-lg);
    }

    .nav-link {
        font-size: 0.875rem;
    }

    /* Hero Section */
    .station-name {
        font-size: 2.5rem;
    }

    /* Live Player */
    .live-player {
        max-width: 500px;
    }

    /* Schedule Grid */
    .schedule-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* News Grid */
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .news-card.featured {
        grid-column: span 2;
    }

    /* Presenters Grid */
    .presenters-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Contact Grid */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Container */
    .container {
        padding: 0 var(--spacing-lg);
    }
}

/* Desktop Styles (1024px to 1439px) */
@media screen and (min-width: 1024px) and (max-width: 1439px) {
    /* Navigation */
    .nav-menu {
        gap: var(--spacing-xl);
    }

    /* Live Player */
    .live-player {
        max-width: 600px;
    }

    /* Schedule Grid */
    .schedule-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* News Grid */
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .news-card.featured {
        grid-column: span 2;
    }

    /* Presenters Grid */
    .presenters-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Footer */
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Large Desktop Styles (1440px and up) */
@media screen and (min-width: 1440px) {
    /* Container */
    .container {
        max-width: 1400px;
        padding: 0 var(--spacing-xl);
    }

    /* Navigation */
    .nav-menu {
        gap: var(--spacing-2xl);
    }

    /* Live Player */
    .live-player {
        max-width: 700px;
        padding: var(--spacing-2xl);
    }

    .play-btn {
        width: 100px;
        height: 100px;
        font-size: 2rem;
    }

    /* Schedule Grid */
    .schedule-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-xl);
    }

    /* News Grid */
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-xl);
    }

    .news-card.featured {
        grid-column: span 3;
    }

    /* Presenters Grid */
    .presenters-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-xl);
    }

    /* Contact Grid */
    .contact-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-3xl);
    }

    /* Footer */
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-2xl);
    }

    /* Sections */
    section {
        padding: var(--spacing-3xl) 0;
    }

    /* Typography */
    h1 {
        font-size: 3.5rem;
    }

    h2 {
        font-size: 2.5rem;
    }

    h3 {
        font-size: 1.875rem;
    }
}

/* Landscape Orientation for Mobile */
@media screen and (max-width: 767px) and (orientation: landscape) {
    /* Hero Section */
    .hero {
        min-height: auto;
        padding: var(--spacing-lg) 0;
    }

    /* Live Player */
    .live-player {
        margin: var(--spacing-md) auto;
    }

    /* Quick Actions */
    .quick-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .action-btn {
        width: auto;
        flex: 1;
        min-width: 200px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Improve rendering for retina displays */
    .logo-img,
    .presenter-image,
    .news-image,
    .show-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    /* Disable animations for users who prefer reduced motion */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .animated-bg,
    .live-indicator,
    .live-dot,
    .equalizer .bar {
        animation: none !important;
    }

    .play-btn.playing {
        animation: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    /* Ensure dark theme is maintained */
    body {
        background-color: var(--primary-dark);
        color: var(--text-primary);
    }
}

/* Light Mode Support (if needed) */
@media (prefers-color-scheme: light) {
    /* Override with light theme if user prefers light mode */
    .light-theme {
        --primary-dark: #ffffff;
        --secondary-dark: #f5f5f5;
        --tertiary-dark: #e0e0e0;
        --text-primary: #1a1a1a;
        --text-secondary: #666666;
        --text-muted: #999999;
    }
}

/* Print Styles */
@media print {
    /* Hide unnecessary elements for printing */
    .header,
    .live-player,
    .quick-actions,
    .modal-overlay,
    .modal,
    .footer {
        display: none !important;
    }

    /* Ensure content is readable when printed */
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
    }

    .container {
        max-width: none;
        padding: 0;
    }

    section {
        padding: 1rem 0;
        page-break-inside: avoid;
    }

    .news-card,
    .presenter-card,
    .schedule-item {
        page-break-inside: avoid;
        border: 1px solid #ccc;
        margin-bottom: 1rem;
    }
}

/* Accessibility Improvements */
@media (prefers-contrast: high) {
    /* Increase contrast for users who prefer high contrast */
    :root {
        --neon-green: #00ff00;
        --neon-blue: #00ffff;
        --text-secondary: #cccccc;
        --text-muted: #999999;
    }

    .btn-primary {
        background: #00ff00;
        color: #000000;
    }

    .btn-secondary {
        border-color: #00ff00;
        color: #00ff00;
    }
}

/* Focus Visible for Better Accessibility */
@media (hover: hover) and (pointer: fine) {
    .btn:hover,
    .nav-link:hover,
    .social-link:hover,
    .action-btn:hover {
        transform: translateY(-2px);
    }
}

/* Touch Devices */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets for mobile devices */
    .btn,
    .nav-link,
    .social-link,
    .action-btn,
    .play-btn {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    .btn:hover,
    .nav-link:hover,
    .social-link:hover,
    .action-btn:hover {
        transform: none;
    }

    /* Add active states for touch feedback */
    .btn:active,
    .nav-link:active,
    .social-link:active,
    .action-btn:active,
    .play-btn:active {
        transform: scale(0.95);
        opacity: 0.8;
    }
}

/* Small Mobile Devices (320px - 374px) */
@media screen and (max-width: 374px) {
    /* Extra small adjustments */
    .container {
        padding: 0 var(--spacing-sm);
    }

    .live-player {
        margin: 0 var(--spacing-sm) var(--spacing-xl);
        padding: var(--spacing-md);
    }

    .play-btn {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }

    .action-btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.75rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .modal {
        width: 98%;
        padding: var(--spacing-lg);
    }
}

/* Large Mobile Devices (414px - 767px) */
@media screen and (min-width: 414px) and (max-width: 767px) {
    /* Adjustments for larger mobile devices */
    .live-player {
        max-width: 380px;
    }

    .quick-actions {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .action-btn {
        width: auto;
        flex: 1;
        min-width: 160px;
        max-width: 200px;
    }
}

/* iPad Specific Styles */
@media screen and (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {
    /* Portrait iPad adjustments */
    .hero {
        min-height: 80vh;
    }

    .live-player {
        max-width: 500px;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .news-card.featured {
        grid-column: span 1;
    }
}

@media screen and (min-width: 768px) and (max-width: 1023px) and (orientation: landscape) {
    /* Landscape iPad adjustments */
    .hero {
        min-height: 60vh;
    }

    .quick-actions {
        flex-direction: row;
    }

    .action-btn {
        width: auto;
        flex: 1;
    }
}
