/* Responsive Styles for Social Video Theme */

/* Large Devices (Desktops, 1024px and up) */
@media (min-width: 1024px) and (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
    
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Medium Devices (Tablets, 768px to 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        max-width: 720px;
        padding: 0 15px;
    }
    
    /* Header */
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    /* Hero Section */
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    /* Video Grid */
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    /* Single Video Page */
    .video-content {
        flex-direction: column;
    }
    
    .video-sidebar {
        margin-top: 2rem;
        width: 100%;
    }
    
    /* Content Area Layout */
    .content-area {
        width: 100%;
    }
    
    .sidebar {
        width: 100%;
        margin-top: 2rem;
    }
    
    /* Posts Grid */
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* Small Devices (Phones, 480px to 767px) */
@media (min-width: 480px) and (max-width: 767px) {
    .container {
        padding: 0 15px;
    }
    
    /* Header */
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Hero Section */
    .hero {
        padding: 2rem 0;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    /* Video Grid */
    .video-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .video-card {
        margin-bottom: 1rem;
    }
    
    /* Platform Filters */
    .platform-filters {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .filter-btn {
        flex: 1;
        min-width: 120px;
        text-align: center;
    }
    
    /* Posts Grid */
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    /* Single Video Player */
    .video-player iframe {
        height: 300px;
    }
    
    /* Search Results */
    .search-result-item {
        flex-direction: column;
    }
    
    .result-thumbnail {
        margin-top: 1rem;
        margin-left: 0;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    /* Forms */
    .search-form input[type="search"] {
        width: 100%;
    }
    
    /* Pagination */
    .pagination .nav-links {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .pagination .page-numbers {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* Extra Small Devices (Phones, less than 480px) */
@media (max-width: 479px) {
    .container {
        padding: 0 10px;
    }
    
    /* Header */
    .logo h1 {
        font-size: 1.2rem;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0.3rem;
        padding: 0.5rem 0;
    }
    
    .main-nav a {
        padding: 0.3rem 0.5rem;
        font-size: 0.9rem;
    }
    
    /* Hero Section */
    .hero {
        padding: 1.5rem 0;
    }
    
    .hero h2 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    .hero p {
        font-size: 0.9rem;
    }
    
    /* Video Grid */
    .video-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .video-thumbnail {
        height: 180px;
    }
    
    .video-info h3 {
        font-size: 1rem;
    }
    
    /* Single Video Page */
    .video-player iframe {
        height: 250px;
    }
    
    .video-header h1 {
        font-size: 1.3rem;
    }
    
    .video-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Related Videos */
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    /* Forms */
    input, textarea, select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Buttons */
    .btn, .filter-btn, .read-more {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Meta Information */
    .entry-meta {
        flex-wrap: wrap;
        gap: 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Error 404 */
    .error-code h1 {
        font-size: 4rem;
    }
    
    .error-message h2 {
        font-size: 1.3rem;
    }
    
    .error-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .error-actions .btn {
        width: 100%;
        text-align: center;
    }
}

/* Print Styles */
@media print {
    .main-header,
    .main-footer,
    .platform-filters,
    .share-buttons,
    .sidebar,
    .video-player iframe,
    .hero {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff !important;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .content-area {
        width: 100% !important;
        float: none !important;
    }
    
    a {
        color: #000 !important;
        text-decoration: underline !important;
    }
    
    .entry-content {
        width: 100% !important;
    }
    
    h1, h2, h3, h4 {
        page-break-after: avoid;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    .video-card {
        page-break-inside: avoid;
    }
    
    /* Show URLs for links */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
    }
    
    /* Don't show URLs for these elements */
    a[href^="#"]:after,
    a[href^="javascript:"]:after {
        content: "";
    }
}

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

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .video-card {
        background: #2d2d2d;
        color: #fff;
    }
    
    .video-info h3 a {
        color: #fff;
    }
    
    .video-meta {
        color: #aaa;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .video-card:hover {
        transform: none !important;
    }
}

/* Landscape Orientation for Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .main-header {
        position: static;
    }
    
    .hero {
        padding: 1rem 0;
    }
    
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}