/* ================================
   RESPONSIVE CSS - Biscuits With Tea
   GLASSMORPHIC MOBILE-FIRST DESIGN
   ================================ */

/* ================================
   DESKTOP - 1024px and up (Default)
   Full glass effects enabled
   ================================ */

/* ================================
   TABLET - 768px to 1023px
   Reduced blur for better performance
   ================================ */

@media (max-width: 1023px) {
    /* Reduce Glass Blur Intensity for Performance */
    :root {
        --glass-blur: 15px;
        --glass-blur-strong: 30px;
        --glass-blur-subtle: 8px;
        
        --font-size-5xl: 2.5rem;
        --font-size-4xl: 2rem;
        --font-size-3xl: 1.75rem;
    }
    
    .container {
        padding: 0 var(--spacing-md);
    }
    
    /* Glass Mobile Menu */
    .nav-links {
        position: fixed;
        top: 60px;
        left: 16px;
        right: 16px;
        
        /* Strong Glass for Menu Overlay */
        background: var(--glass-white-strong);
        backdrop-filter: blur(var(--glass-blur-strong)) saturate(180%);
        -webkit-backdrop-filter: blur(var(--glass-blur-strong)) saturate(180%);
        border: 1px solid var(--glass-border-strong);
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-glass-lg);
        
        flex-direction: column;
        padding: var(--spacing-lg);
        gap: var(--spacing-xs);
        
        transform: translateY(-120%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-base);
        z-index: var(--z-dropdown);
    }
    
    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .hamburger {
        display: flex;
    }
    
    .subscribe-btn {
        display: none;
    }
    
    /* Grid Adjustments */
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Videos Grid */
    .videos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    .videos-grid.large {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Categories */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
    
    /* Community Highlights */
    .highlights-grid {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Team */
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    /* Pillars */
    .pillars-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* BTS */
    .bts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    /* Collaboration */
    .collaboration-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Partner Stats */
    .partner-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Reddit Integration */
    .reddit-integration {
        grid-template-columns: 1fr;
    }
    
    /* Comments Slider */
    .comments-slider {
        grid-template-columns: 1fr;
    }
    
    .comments-slider-large {
        grid-template-columns: 1fr;
    }
    
    /* Submissions */
    .submissions-grid {
        grid-template-columns: 1fr;
    }
    
    /* Guidelines */
    .guidelines-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-md);
    }
    
    /* Social Platforms */
    .social-platforms {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-md);
    }
    
    /* Playlists */
    .playlists-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Hero */
    .hero-cta {
        flex-direction: column;
        align-items: stretch;
    }
    
    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ================================
   MOBILE - 320px to 767px
   Minimal blur for battery optimization
   ================================ */

@media (max-width: 767px) {
    /* Minimal Glass Blur for Mobile Performance */
    :root {
        --glass-blur: 10px;
        --glass-blur-strong: 20px;
        --glass-blur-subtle: 5px;
        
        --font-size-5xl: 2rem;
        --font-size-4xl: 1.75rem;
        --font-size-3xl: 1.5rem;
        --font-size-2xl: 1.25rem;
        --spacing-xxl: 3rem;
        --spacing-xl: 2rem;
    }
    
    .section {
        padding: var(--spacing-xl) 0;
    }
    
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    /* Navbar responsive padding */
    .navbar {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
    
    .logo-text {
        font-size: var(--font-size-lg);
    }
    
    .logo-img {
        height: 32px;
    }
    
    .search-toggle,
    .theme-toggle {
        width: 36px;
        height: 36px;
        font-size: var(--font-size-base);
    }
    
    /* Mobile Hero Adjustments */
    .hero {
        min-height: 80vh;
        padding: calc(var(--spacing-xxl) + 60px) var(--spacing-md) var(--spacing-xl);
    }
    
    .hero-title {
        font-size: clamp(2rem, 10vw, 3rem);
    }
    
    .hero-tagline {
        font-size: var(--font-size-base);
    }
    
    /* Smaller Glass Badge on Mobile */
    .subscriber-badge {
        flex-direction: column;
        padding: var(--spacing-sm) var(--spacing-md);
        gap: var(--spacing-xs);
    }
    
    .subscriber-count {
        font-size: var(--font-size-xl);
    }
    
    .hero-social-link {
        width: 44px;
        height: 44px;
        font-size: var(--font-size-lg);
    }
    
    /* Page Hero */
    .page-hero {
        padding: var(--spacing-xl) 0;
    }
    
    .page-title {
        font-size: var(--font-size-3xl);
    }
    
    .page-subtitle {
        font-size: var(--font-size-base);
    }
    
    /* Single Column Grids on Mobile */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    /* Mobile Video Grid - Single Column */
    .videos-grid,
    .videos-grid.large {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    /* Simplify Animations on Mobile */
    .video-card:hover {
        transform: translateY(-4px) translateZ(0);
    }
    
    /* Single Column Categories */
    .categories-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    /* Smaller Category Icons */
    .category-icon {
        width: 60px;
        height: 60px;
        font-size: var(--font-size-2xl);
    }
    
    .category-card {
        padding: var(--spacing-lg);
    }
    
    /* Disable complex animations on mobile */
    .glass-card-animated {
        animation: none;
    }
    
    .parallax-layer {
        transform: none !important;
    }
    
    /* Community Highlights */
    .highlights-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    /* Newsletter - Glass Form */
    .newsletter-box {
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .newsletter-form-main {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .newsletter-submit {
        width: 100%;
        justify-content: center;
    }
    
    /* Mobile Footer - Single Column */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .footer-section {
        padding: var(--spacing-md);
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .footer-links {
        align-items: center;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .footer-bottom-links {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    /* Compact Glass Modal on Mobile */
    .modal-content {
        width: 95%;
        max-height: 85vh;
        margin: auto;
    }
    
    .modal-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 40px;
        height: 40px;
    }
    
    /* Filter Section */
    .filter-buttons,
    .sort-buttons {
        flex-direction: column;
    }
    
    .filter-btn,
    .sort-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Video Modal */
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }
    
    .modal-video-info {
        padding: var(--spacing-md);
    }
    
    .modal-video-actions {
        flex-direction: column;
    }
    
    .modal-video-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .share-options {
        flex-direction: column;
    }
    
    .share-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Playlists */
    .playlists-grid {
        grid-template-columns: 1fr;
    }
    
    /* Team */
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    .member-social-link {
        width: 44px;
        height: 44px;
        font-size: var(--font-size-lg);
    }
    
    /* Timeline */
    .timeline {
        padding-left: 30px;
    }
    
    .timeline::before {
        left: 8px;
    }
    
    .timeline-marker {
        left: -28px;
        width: 20px;
        height: 20px;
    }
    
    .timeline-content {
        padding: var(--spacing-md);
    }
    
    /* Philosophy */
    .philosophy-icon {
        font-size: 3.5rem;
    }
    
    .philosophy-quote {
        font-size: var(--font-size-lg);
        padding: var(--spacing-md);
    }
    
    .philosophy-text {
        font-size: var(--font-size-base);
    }
    
    /* Pillars */
    .pillars-grid {
        grid-template-columns: 1fr;
    }
    
    .pillar-card {
        padding: var(--spacing-md);
    }
    
    .pillar-card i {
        font-size: var(--font-size-2xl);
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: var(--spacing-lg);
    }
    
    .stat-icon {
        font-size: var(--font-size-2xl);
    }
    
    .stat-number {
        font-size: var(--font-size-3xl);
    }
    
    /* BTS */
    .bts-grid {
        grid-template-columns: 1fr;
    }
    
    .bts-img {
        height: 200px;
    }
    
    /* CTA Section */
    .cta-box {
        padding: var(--spacing-xl) var(--spacing-lg);
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .cta-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Contact Page */
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-form-container {
        padding: var(--spacing-lg);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .info-card {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .info-icon {
        margin: 0 auto;
    }
    
    .info-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    
    .social-links-vertical {
        align-items: center;
    }
    
    /* Collaboration */
    .collaboration-grid {
        grid-template-columns: 1fr;
    }
    
    /* Partner Stats */
    .partner-stats {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .stat-number-large {
        font-size: var(--font-size-4xl);
    }
    
    /* Reddit Section */
    .reddit-integration {
        grid-template-columns: 1fr;
    }
    
    .reddit-stats {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .reddit-stat {
        flex: 1;
        min-width: 150px;
    }
    
    /* Comment Highlights */
    .featured-comment {
        padding: var(--spacing-lg);
    }
    
    .comment-content-large {
        flex-direction: column;
    }
    
    .commenter-avatar {
        width: 50px;
        height: 50px;
        margin: 0 auto;
    }
    
    .comment-body {
        text-align: center;
    }
    
    .comments-slider-large {
        grid-template-columns: 1fr;
    }
    
    /* Submissions */
    .submissions-grid {
        grid-template-columns: 1fr;
    }
    
    .submission-card {
        padding: var(--spacing-lg);
    }
    
    .submission-icon {
        width: 60px;
        height: 60px;
        font-size: var(--font-size-2xl);
    }
    
    .fan-gallery {
        grid-template-columns: 1fr;
    }
    
    /* Guidelines */
    .guidelines-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    .guideline-card i {
        font-size: var(--font-size-2xl);
    }
    
    /* Social Platforms */
    .social-platforms {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    .platform-card {
        padding: var(--spacing-lg);
    }
    
    .platform-card i {
        font-size: var(--font-size-3xl);
    }
    
    /* Buttons */
    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: var(--font-size-base);
    }
    
    /* Back to Top */
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
        font-size: var(--font-size-lg);
    }
    
    /* Forms */
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* ================================
   SMALL MOBILE - 320px to 479px
   ================================ */

@media (max-width: 479px) {
    :root {
        --font-size-5xl: 1.75rem;
        --font-size-4xl: 1.5rem;
        --spacing-xxl: 2.5rem;
    }
    
    .section-title {
        font-size: var(--font-size-3xl);
    }
    
    .section-subtitle {
        font-size: var(--font-size-base);
    }
    
    /* Hero */
    .hero-social {
        gap: var(--spacing-sm);
    }
    
    .hero-social-link {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-base);
    }
    
    /* Newsletter */
    .newsletter-title {
        font-size: var(--font-size-2xl);
    }
    
    .newsletter-text {
        font-size: var(--font-size-base);
    }
    
    /* Modal */
    .modal-content {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }
    
    /* Stats */
    .stat-number-large {
        font-size: var(--font-size-3xl);
    }
}

/* ================================
   LARGE DESKTOP - 1441px and up
   ================================ */

@media (min-width: 1441px) {
    .container {
        max-width: 1600px;
    }
    
    /* Videos Grid */
    .videos-grid.large {
        grid-template-columns: repeat(5, 1fr);
    }
    
    /* Playlists */
    .playlists-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ================================
   PRINT STYLES
   ================================ */

@media print {
    .site-header,
    .site-footer,
    .back-to-top,
    .hero-cta,
    .hero-social,
    .newsletter-section,
    .video-modal,
    .filter-section,
    .search-bar {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .page-hero {
        background: #fff;
        color: #000;
    }
}

/* ================================
   LANDSCAPE MOBILE
   ================================ */

@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: var(--spacing-xl) 0;
    }
    
    .scroll-indicator {
        display: none;
    }
}

/* ================================
   HIGH CONTRAST MODE
   ================================ */

@media (prefers-contrast: high) {
    :root {
        --color-text-primary: #000;
        --color-text-secondary: #333;
        --color-border: #666;
    }
    
    .btn-outline {
        border-width: 3px;
    }
    
    a:focus,
    button:focus {
        outline-width: 4px;
    }
}

/* ================================
   DARK MODE - ALWAYS ON BY DEFAULT
   ================================ */

/* Always apply dark theme by default (ignore device preferences) */
:root:not([data-theme="light"]) {
    --color-background: #1A1A1D;
    --color-white: #2D2D2D;
    --color-black: #FAFAFA;
    --color-text-primary: #E5E5E5;
    --color-text-secondary: #B5B5B5;
    --color-text-muted: #8B8B8B;
    --color-border: #3D3D3D;
    --color-shadow: rgba(0, 0, 0, 0.3);
    --color-overlay: rgba(0, 0, 0, 0.8);
}

/* ================================
   TOUCH DEVICE ENHANCEMENTS
   ================================ */

@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .btn,
    .icon-btn,
    .nav-link {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .card:hover,
    .video-card:hover,
    .category-card:hover {
        transform: none;
    }
    
    /* Show member overlay on mobile with transparency */
    .member-overlay {
        opacity: 1;
        background: transparent;
    }
    
    /* Transparent icon style for mobile */
    .member-social-link {
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.3);
        color: white;
    }
    
    /* Keep playlist overlay visible */
    .playlist-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.3);
    }
}

/* ================================
   ACCESSIBILITY - FOCUS STATES
   ================================ */

@media (prefers-reduced-motion: no-preference) {
    *:focus-visible {
        outline: 3px solid var(--color-primary);
        outline-offset: 3px;
        transition: outline-offset 0.2s ease;
    }
    
    *:focus-visible:active {
        outline-offset: 1px;
    }
}

/* ================================
   SAFARI-SPECIFIC FIXES
   ================================ */

@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific styles */
    .search-input,
    .newsletter-input,
    .newsletter-input-main,
    input[type="text"],
    input[type="email"],
    textarea {
        font-size: 16px !important; /* Prevents zoom */
    }
    
    /* Fix for position sticky on iOS */
    .site-header {
        position: -webkit-sticky;
        position: sticky;
    }
}

/* ================================
   FIREFOX-SPECIFIC FIXES
   ================================ */

@-moz-document url-prefix() {
    /* Firefox specific styles */
    .video-thumbnail,
    .playlist-thumbnail {
        overflow: -moz-hidden-unscrollable;
    }
}
