/* ===== Responsive Design - Clean and Compressed ===== */

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
    
    .video-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .dance-styles-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktop (992px - 1199px) */
@media (max-width: 1199px) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
}

/* Tablet (768px - 991px) */
@media (max-width: 991px) {
    :root {
        --nav-height: 55px;
        --spacing-3xl: 2rem;
        --spacing-2xl: 1.5rem;
    }
    
    /* Navigation */
    .nav-container {
        padding: 0 var(--spacing-md);
    }
    
    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        height: 0;
        background: white;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 0;
        overflow: hidden;
        transition: height 0.3s ease;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
    }
    
    .nav-menu.active {
        height: 150px;
        padding: var(--spacing-lg) 0;
    }
    
    .nav-menu .nav-link {
        width: 200px;
        text-align: center;
        margin: var(--spacing-xs) 0;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Hero Section */
    .hero {
        padding: calc(var(--nav-height) + var(--spacing-lg)) 0 var(--spacing-xl);
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .hero-subtitle {
        font-size: var(--font-size-base);
    }
    
    .hero-stats {
        gap: var(--spacing-xl);
        margin-bottom: var(--spacing-lg);
    }
    
    /* Video Grid */
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    /* Filter */
    .filter-container {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: var(--spacing-sm);
    }
    
    .filter-container::-webkit-scrollbar {
        height: 3px;
    }
    
    .filter-container::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 2px;
    }
    
    .tag-button {
        flex-shrink: 0;
    }
    
    /* About */
    .dance-styles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-md);
    }
    
    /* Modal */
    .modal-content {
        margin: var(--spacing-md);
    }
}

/* Mobile Large (576px - 767px) */
@media (max-width: 767px) {
    :root {
        --nav-height: 50px;
        --spacing-3xl: 1.5rem;
        --spacing-2xl: 1rem;
        --spacing-xl: 0.875rem;
    }
    
    .container {
        padding: 0 var(--spacing-md);
    }
    
    /* Navigation */
    .brand-name {
        font-size: var(--font-size-base);
    }
    
    .brand-tagline {
        font-size: 0.65rem;
    }
    
    /* Hero */
    .hero {
        padding: calc(var(--nav-height) + var(--spacing-md)) 0 var(--spacing-lg);
    }
    
    .hero-title {
        font-size: 1.875rem;
        margin-bottom: var(--spacing-sm);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-sm);
        margin-bottom: var(--spacing-lg);
    }
    
    .hero-stats {
        gap: var(--spacing-lg);
        margin-bottom: var(--spacing-lg);
    }
    
    .stat-number {
        font-size: var(--font-size-xl);
    }
    
    .cta-button {
        padding: var(--spacing-sm) var(--spacing-xl);
        font-size: var(--font-size-sm);
    }
    
    /* Sections */
    .videos,
    .about {
        padding: var(--spacing-2xl) 0;
    }
    
    /* About Section - Qualities Grid */
    .qualities-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .section-header {
        margin-bottom: var(--spacing-xl);
    }
    
    .section-title {
        font-size: var(--font-size-2xl);
        margin-bottom: var(--spacing-xs);
    }
    
    .section-subtitle {
        font-size: var(--font-size-base);
    }
    
    /* Filter */
    .filter-section {
        margin-bottom: var(--spacing-xl);
        padding: var(--spacing-md) 0;
    }
    
    .filter-container {
        gap: var(--spacing-xs);
    }
    
    .tag-button {
        padding: var(--spacing-xs) var(--spacing-md);
        font-size: var(--font-size-xs);
    }
    
    /* Video Grid */
    .video-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        margin-bottom: var(--spacing-xl);
    }
    
    .video-info {
        padding: var(--spacing-md);
    }
    
    .video-title {
        font-size: var(--font-size-base);
        margin-bottom: var(--spacing-xs);
    }
    
    .video-description {
        margin-bottom: var(--spacing-sm);
    }
    
    .video-meta {
        margin-bottom: var(--spacing-sm);
        font-size: var(--font-size-xs);
    }
    
    .play-button {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-base);
    }
    
    /* About */
    .about-title {
        font-size: var(--font-size-2xl);
        margin-bottom: var(--spacing-md);
    }
    
    .about-description {
        font-size: var(--font-size-base);
        margin-bottom: var(--spacing-xl);
    }
    
    .dance-styles-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .style-card {
        padding: var(--spacing-md);
    }
    
    .style-card h4 {
        font-size: var(--font-size-base);
        margin-bottom: var(--spacing-xs);
    }
    
    .style-card p {
        font-size: var(--font-size-xs);
    }
    
    /* Modal */
    .modal-content {
        margin: var(--spacing-sm);
    }
    
    .modal-header {
        padding: var(--spacing-md);
    }
    
    .modal-title {
        font-size: var(--font-size-lg);
    }
    
    .video-details {
        padding: var(--spacing-md);
    }
    
    .video-stats {
        gap: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }
    
    .stat-item {
        font-size: var(--font-size-xs);
    }
    
    /* Footer */
    .footer {
        padding: var(--spacing-xl) 0 var(--spacing-md);
    }
    
    .footer-content {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
        margin-bottom: var(--spacing-md);
    }
    
    .footer-brand h3 {
        font-size: var(--font-size-lg);
        margin-bottom: var(--spacing-xs);
    }
    
    .footer-brand p {
        font-size: var(--font-size-sm);
    }
    
    .footer-links {
        gap: var(--spacing-md);
    }
    
    .footer-links a {
        font-size: var(--font-size-sm);
    }
}

/* Mobile Medium (480px - 575px) */
@media (max-width: 575px) {
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: var(--font-size-xs);
    }
    
    .hero-stats {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .stat {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: var(--spacing-md);
    }
    
    .stat-number {
        font-size: var(--font-size-lg);
    }
    
    .section-title {
        font-size: var(--font-size-xl);
    }
    
    .dance-styles-grid {
        gap: var(--spacing-xs);
    }
    
    /* About Section - Qualities Grid for smaller mobiles */
    .qualities-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xs);
    }
    
    .style-card {
        padding: var(--spacing-sm);
        text-align: center;
    }
    
    .filter-container {
        justify-content: flex-start;
    }
    
    .tag-button {
        min-width: 60px;
    }
}

/* Mobile Small (320px - 479px) */
@media (max-width: 479px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .hero-title {
        font-size: 1.25rem;
        word-break: break-word;
    }
    
    .hero-subtitle {
        line-height: 1.4;
    }
    
    .cta-button {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: var(--font-size-xs);
        width: 100%;
        max-width: 200px;
    }
    
    .section-title {
        font-size: var(--font-size-lg);
    }
    
    .section-subtitle {
        font-size: var(--font-size-sm);
    }
    
    .tag-button {
        padding: 4px var(--spacing-sm);
        font-size: 0.65rem;
        min-width: 50px;
    }
    
    .video-title {
        font-size: var(--font-size-sm);
    }
    
    .video-description {
        font-size: var(--font-size-xs);
    }
    
    .video-tag {
        padding: 2px 6px;
        font-size: 0.65rem;
    }
    
    .play-button {
        width: 35px;
        height: 35px;
        font-size: var(--font-size-sm);
    }
    
    .about-title {
        font-size: var(--font-size-lg);
    }
    
    .about-description {
        font-size: var(--font-size-sm);
    }
    
    .modal-header {
        padding: var(--spacing-sm);
    }
    
    .modal-title {
        font-size: var(--font-size-base);
    }
    
    .video-details {
        padding: var(--spacing-sm);
    }
}

/* Landscape Mode for Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: calc(var(--nav-height) + var(--spacing-sm)) 0 var(--spacing-md);
    }
    
    .hero-content {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: var(--spacing-xl);
        align-items: center;
        text-align: left;
        max-width: 100%;
    }
    
    .hero-title {
        font-size: 1.5rem;
        margin-bottom: var(--spacing-xs);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-sm);
        margin-bottom: var(--spacing-sm);
    }
    
    .hero-stats {
        margin-bottom: var(--spacing-sm);
        gap: var(--spacing-lg);
    }
    
    .modal-content {
        max-height: 95vh;
        overflow-y: auto;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .video-thumbnail,
    .style-card {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

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

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #0f172a;
        --background-secondary: #1e293b;
        --background-dark: #020617;
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --text-muted: #64748b;
        --border-color: #334155;
    }
    
    .navbar {
        background: rgba(15, 23, 42, 0.95);
        border-bottom-color: var(--border-color);
    }
    
    .video-card,
    .style-card {
        background: var(--background-secondary);
        border-color: var(--border-color);
    }
    
    .modal-content {
        background: var(--background-secondary);
        border: 1px solid var(--border-color);
    }
    
    .nav-menu {
        background: var(--background);
    }
}

/* Print Styles */
@media print {
    .navbar,
    .nav-toggle,
    .cta-button,
    .filter-section,
    .video-overlay,
    .play-button,
    .load-more-section,
    .modal {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .hero,
    .videos,
    .about {
        padding: var(--spacing-lg) 0;
        background: white !important;
    }
    
    .video-card,
    .style-card {
        border: 1px solid #ccc;
        break-inside: avoid;
        margin-bottom: var(--spacing-md);
    }
    
    .section-title,
    .hero-title,
    .about-title {
        color: black !important;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .video-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.3);
    }
    
    .play-button,
    .tag-button,
    .cta-button,
    .nav-link {
        min-height: 44px;
        min-width: 44px;
    }
    
    .video-card:hover {
        transform: none;
    }
    
    .video-tag {
        min-height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Ultra-wide Screens */
@media (min-width: 1600px) {
    .container {
        max-width: 1600px;
    }
    
    .video-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .dance-styles-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Compact Layout for Smaller Heights */
@media (max-height: 600px) {
    .hero {
        padding: calc(var(--nav-height) + var(--spacing-sm)) 0 var(--spacing-lg);
    }
    
    .videos,
    .about {
        padding: var(--spacing-xl) 0;
    }
    
    .section-header {
        margin-bottom: var(--spacing-lg);
    }
}