/* Responsive Design */

/* Tablets y pantallas medianas */
@media (max-width: 1024px) {
    .nav-container {
        padding: 1rem;
    }
    
    .nav-menu {
        gap: 1.5rem;
    }
    
    .search-input {
        width: 250px;
    }
    
    .hero-title {
        font-size: clamp(2rem, 4vw, 3.5rem);
    }
    
    .hero-description {
        font-size: clamp(1rem, 2vw, 1.3rem);
    }
    
    .content-section {
        padding: 0 1rem;
    }
    
    .favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1.5rem;
        padding: 0 1rem;
    }
    
    .modal-content {
        margin: 1rem;
    }
    
    .modal-video {
        height: 300px;
    }
    
    .modal-info {
        padding: 1.5rem;
    }
}

/* Móviles y pantallas pequeñas */
@media (max-width: 768px) {
    .nav-container {
        padding: 0.75rem 1rem;
    }
    
    .nav-left {
        gap: 1rem;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--darker-color);
        border-top: 1px solid var(--border-color);
        flex-direction: column;
        padding: 1rem;
        gap: 0;
        box-shadow: var(--shadow-heavy);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li {
        padding: 1rem 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-right {
        gap: 1rem;
    }
    
    .search-container {
        order: 3;
        position: absolute;
        top: 100%;
        left: 1rem;
        right: 1rem;
        margin-top: 1rem;
        display: none;
    }
    
    .search-container.active {
        display: block;
    }
    
    .search-input {
        width: 100%;
    }
    
    .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);
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .hero-content {
        padding: 0 1rem;
    }
    
    .hero-title {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
        margin-bottom: 1rem;
    }
    
    .hero-description {
        font-size: clamp(0.9rem, 3vw, 1.1rem);
        margin-bottom: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .content-section {
        margin-bottom: 3rem;
        padding: 0 0.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .content-card {
        height: 250px;
    }
    
    .content-overlay {
        padding: 1.5rem 0.75rem 0.75rem;
    }
    
    .content-title {
        font-size: 1rem;
    }
    
    .content-meta {
        gap: 0.75rem;
        font-size: 0.8rem;
    }
    
    .favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
        padding: 0 0.5rem;
    }
    
    .favorite-item img {
        height: 240px;
    }
    
    .modal {
        padding: 1rem;
    }
    
    .modal-content {
        margin: 0;
        max-height: 95vh;
    }
    
    .modal-video {
        height: 200px;
    }
    
    .modal-info {
        padding: 1rem;
    }
    
    .modal-title {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .modal-meta {
        font-size: 0.8rem;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .modal-description {
        margin-bottom: 1.5rem;
        font-size: 0.9rem;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
    
    .swiper-button-next,
    .swiper-button-prev {
        width: 40px;
        height: 40px;
        margin-top: -20px;
    }
    
    .swiper-button-next::after,
    .swiper-button-prev::after {
        font-size: 14px;
    }
    
    .loading-logo {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .loading-spinner {
        width: 50px;
        height: 50px;
    }
    
    .empty-favorites {
        padding: 3rem 1rem;
    }
    
    .empty-favorites i {
        font-size: 3rem;
    }
}

/* Móviles muy pequeños */
@media (max-width: 480px) {
    .nav-container {
        padding: 0.5rem;
    }
    
    .logo h1 {
        font-size: 1.3rem;
    }
    
    .nav-right {
        gap: 0.75rem;
    }
    
    .theme-toggle,
    .profile-img {
        width: 35px;
        height: 35px;
    }
    
    .hero-title {
        font-size: clamp(1.5rem, 7vw, 2rem);
    }
    
    .hero-description {
        font-size: clamp(0.85rem, 4vw, 1rem);
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.85rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .content-card {
        height: 200px;
    }
    
    .favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .favorite-item img {
        height: 200px;
    }
    
    .modal-video {
        height: 160px;
    }
    
    .modal-title {
        font-size: 1.3rem;
    }
    
    .swiper-button-next,
    .swiper-button-prev {
        width: 35px;
        height: 35px;
        margin-top: -17px;
    }
    
    .swiper-button-next::after,
    .swiper-button-prev::after {
        font-size: 12px;
    }
}

/* Pantallas muy grandes */
@media (min-width: 1400px) {
    .nav-container {
        max-width: 1600px;
        padding: 1rem 3rem;
    }
    
    .hero-title {
        font-size: clamp(3rem, 5vw, 5rem);
    }
    
    .hero-description {
        font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    }
    
    .content-section {
        padding: 0 3rem;
    }
    
    .section-title {
        font-size: 2.5rem;
    }
    
    .content-card {
        height: 350px;
    }
    
    .favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 2.5rem;
        padding: 0 3rem;
    }
    
    .favorite-item img {
        height: 350px;
    }
    
    .modal-content {
        max-width: 1100px;
    }
    
    .modal-video {
        height: 500px;
    }
    
    .modal-info {
        padding: 3rem;
    }
    
    .modal-title {
        font-size: 2.5rem;
    }
}

/* Orientación horizontal en móviles */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        height: 100vh;
    }
    
    .hero-content {
        padding: 0 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .hero-buttons {
        flex-direction: row;
        gap: 1rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        width: auto;
    }
    
    .modal-video {
        height: 250px;
    }
    
    .modal-info {
        padding: 1rem;
    }
    
    .modal-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
}

/* Reducir movimiento para usuarios con preferencias de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .content-card:hover {
        transform: none;
    }
    
    .favorite-item:hover {
        transform: none;
    }
    
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
}

/* Alto contraste para accesibilidad */
@media (prefers-contrast: high) {
    :root {
        --border-color: rgba(255, 255, 255, 0.3);
        --text-muted: #cccccc;
    }
    
    .content-card {
        border: 2px solid var(--border-color);
    }
    
    .btn-secondary {
        border: 2px solid rgba(255, 255, 255, 0.5);
    }
}

/* Tema oscuro del sistema */
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --secondary-color: #0f1419;
        --dark-color: #141414;
        --darker-color: #0a0a0a;
        --text-color: #ffffff;
        --text-muted: #b3b3b3;
        --border-color: rgba(255, 255, 255, 0.1);
        --gradient-dark: linear-gradient(135deg, #0f1419 0%, #141414 100%);
    }
}

/* Tema claro del sistema */
@media (prefers-color-scheme: light) {
    [data-theme="auto"] {
        --secondary-color: #ffffff;
        --dark-color: #f8f9fa;
        --darker-color: #e9ecef;
        --text-color: #212529;
        --text-muted: #6c757d;
        --border-color: rgba(0, 0, 0, 0.1);
        --gradient-dark: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    }
}
