/* ============================================
   AGC Dracin - Responsive Styles
   ============================================ */

@media (max-width: 1200px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 992px) {
    .nav-links {
        display: none;
    }

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

    .hero-title {
        font-size: 2.2rem;
    }

    .detail-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .detail-poster {
        width: 200px;
    }

    .detail-meta,
    .detail-genres,
    .detail-actions,
    .cast-list {
        justify-content: center;
    }

    .watch-info-grid {
        grid-template-columns: 1fr;
    }

    .drama-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .hero-section {
        height: 70vh;
        min-height: 400px;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-chinese-title {
        font-size: 1rem;
    }

    .hero-desc {
        -webkit-line-clamp: 2;
        font-size: 0.85rem;
    }

    .hero-slide-content {
        bottom: 20%;
        padding: 0 1.5rem;
    }

    .section-header h2 {
        font-size: 1.2rem;
    }

    .drama-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    .genre-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .search-box.active input {
        width: 180px;
    }

    .search-results {
        width: 280px;
    }

    .page-title {
        padding-top: 4rem;
    }

    .page-title h1 {
        font-size: 1.5rem;
    }

    .detail-title {
        font-size: 1.6rem;
    }

    .subtitle-text {
        font-size: 0.9rem;
    }

    .player-big-play {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .watch-header {
        padding: 0.8rem 1rem;
    }

    .watch-title {
        font-size: 0.95rem;
    }

    .episodes-grid {
        grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
    }

    .download-links {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero-section {
        height: 60vh;
        min-height: 350px;
    }

    .hero-title {
        font-size: 1.4rem;
    }

    .hero-meta {
        font-size: 0.8rem;
        gap: 0.5rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.85rem;
        width: 100%;
        justify-content: center;
    }

    .drama-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
    }

    .drama-card-info {
        padding: 0.5rem;
    }

    .drama-card-title {
        font-size: 0.8rem;
    }

    .drama-card-chinese {
        display: none;
    }

    .drama-card-meta {
        font-size: 0.7rem;
    }

    .genre-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.6rem;
    }

    .genre-card {
        padding: 1rem 0.5rem;
    }

    .genre-card-icon {
        font-size: 1.5rem;
    }

    .genre-card-name {
        font-size: 0.8rem;
    }

    .detail-poster {
        width: 160px;
    }

    .detail-title {
        font-size: 1.3rem;
    }

    .section {
        padding: 1.5rem 1rem;
    }

    .watch-ep-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }

    .ctrl-btn {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }

    .time-display {
        font-size: 0.7rem;
    }

    .subtitle-text {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }

    .subtitle-display {
        bottom: 50px;
    }
}

/* Landscape mobile optimization */
@media (max-height: 500px) and (orientation: landscape) {
    .player-container {
        padding-top: 0;
        height: 100vh;
    }

    .watch-header {
        display: none;
    }

    #navbar {
        display: none;
    }

    .subtitle-display {
        bottom: 40px;
    }
}

/* Tablet landscape */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .drama-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

/* High DPI */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .drama-card-poster img {
        image-rendering: -webkit-optimize-contrast;
    }
}

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

/* Print */
@media print {
    #navbar, #footer, .back-to-top, .player-controls,
    .hero-controls, .mobile-menu, .mobile-overlay,
    .toast-container, #preloader {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }
}
