/* ========== RESPONSIVE CSS - SpotiTube ========== */
/* Archivo: public/css/responsive.css */
/* Descripción: Media queries y estilos responsive */

/* ========== BREAKPOINTS ========== */
/* 
    xs: < 480px (móviles pequeños)
    sm: 480px - 767px (móviles)
    md: 768px - 1023px (tablets)
    lg: 1024px - 1279px (laptops)
    xl: >= 1280px (desktop)
*/

/* ========== MÓVILES PEQUEÑOS (< 480px) ========== */
@media (max-width: 479px) {
    :root {
        --logo-size-welcome: 200px;
        --logo-size-auth: 150px;
        --logo-size-main: 120px;
    }

    .app-title h1 {
        font-size: var(--font-size-xl);
    }

    .app-title p {
        font-size: var(--font-size-sm);
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: var(--font-size-sm);
    }

    .age-buttons {
        flex-direction: column;
    }

    .age-buttons .btn {
        width: 100%;
    }

    .user-info {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
    }

    .user-info > div {
        flex-direction: column;
    }

    .mode-selection {
        flex-direction: column;
    }

    .mode-option {
        min-width: 100%;
    }

    .modal-content {
        max-width: 95%;
        max-height: 90vh;
    }

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

    .cookie-buttons {
        width: 100%;
        justify-content: center;
    }
}

/* ========== MÓVILES (480px - 767px) ========== */
@media (min-width: 480px) and (max-width: 767px) {
    :root {
        --logo-size-welcome: 280px;
        --logo-size-auth: 200px;
        --logo-size-main: 150px;
    }

    .app-title h1 {
        font-size: var(--font-size-2xl);
    }

    .mode-selection {
        flex-direction: column;
    }

    .mode-option {
        min-width: 100%;
    }
}

/* ========== TABLETS (768px - 1023px) ========== */
@media (min-width: 768px) and (max-width: 1023px) {
    :root {
        --logo-size-welcome: 350px;
        --logo-size-auth: 250px;
        --logo-size-main: 180px;
    }

    .modal-content {
        width: 80%;
        max-width: 700px;
    }

    .mode-option {
        min-width: 180px;
    }
}

/* ========== LAPTOPS Y DESKTOP (>= 1024px) ========== */
@media (min-width: 1024px) {
    .main-content {
        max-width: 900px;
    }

    .modal-content {
        width: 700px;
    }
}

/* ========== AJUSTES GENERALES PARA MÓVILES (<= 768px) ========== */
@media (max-width: 768px) {
    .main-content {
        padding: var(--spacing-md);
    }

    .functionality-section {
        padding: var(--spacing-md);
    }

    .form-textarea {
        min-height: 100px;
    }

    .header {
        padding: var(--spacing-sm);
    }

    .language-selector {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: var(--font-size-xs);
    }

    .welcome-footer-links {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .footer-separator {
        display: none;
    }

    .footer-links {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .artists-controls {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .artists-controls > div {
        width: 100%;
        justify-content: center;
    }

    .playlist-item img,
    .artist-item img {
        width: 50px;
        height: 50px;
    }

    .main-tabs-container {
        padding: var(--spacing-sm);
    }

    .main-tab-button {
        padding: var(--spacing-sm);
        font-size: var(--font-size-sm);
    }

    #messageContainer {
        left: var(--spacing-sm);
        right: var(--spacing-sm);
        max-width: none;
    }
}

/* ========== DISPOSITIVOS CON HOVER (desktop) ========== */
@media (hover: hover) and (pointer: fine) {
    .btn:hover {
        transform: scale(1.05);
    }

    .mode-option:hover {
        transform: translateY(-2px);
    }

    .playlist-item:hover,
    .artist-item:hover {
        background: rgba(29, 185, 84, 0.15);
    }
}

/* ========== DISPOSITIVOS TÁCTILES ========== */
@media (hover: none) and (pointer: coarse) {
    .btn:active {
        transform: scale(0.98);
    }

    .mode-option:active {
        transform: scale(0.98);
    }

    /* Aumentar áreas de toque */
    .btn {
        min-height: 48px;
    }

    .playlist-item,
    .artist-item {
        min-height: 60px;
    }

    .modal-close {
        min-width: 44px;
        min-height: 44px;
    }
}

/* ========== ORIENTACIÓN LANDSCAPE EN MÓVILES ========== */
@media (max-height: 500px) and (orientation: landscape) {
    .welcome-screen,
    .auth-screen {
        padding: var(--spacing-md);
    }

    .welcome-logo {
        height: 150px;
    }

    .auth-logo {
        height: 100px;
    }

    .age-buttons {
        flex-direction: row;
    }

    .modal-content {
        max-height: 95vh;
    }
}

/* Para la clase .landscape que se añade dinámicamente */
.landscape .welcome-screen,
.landscape .auth-screen {
    padding: var(--spacing-md);
}

.landscape .welcome-logo {
    height: 150px;
    max-height: 150px;
}

.landscape .auth-logo {
    height: 100px;
    max-height: 100px;
}

.landscape .modal-content {
    max-height: 85vh;
}

/* ========== PANTALLAS DE ALTA RESOLUCIÓN ========== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ajustes para pantallas retina si es necesario */
}

/* ========== MODO OSCURO FORZADO (si el sistema lo soporta) ========== */
@media (prefers-color-scheme: dark) {
    /* Ya estamos en modo oscuro por defecto */
}

/* ========== IMPRESIÓN ========== */
@media print {
    .header,
    .cookie-banner,
    .modal-overlay,
    #messageContainer {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .app-title h1 {
        -webkit-text-fill-color: var(--spotify-green);
    }
}

/* ========== ACCESIBILIDAD - Alto contraste ========== */
@media (prefers-contrast: high) {
    :root {
        --spotify-gray: #666666;
        --text-secondary: #cccccc;
    }

    .btn {
        border: 2px solid currentColor;
    }

    .form-input,
    .form-textarea,
    .form-select {
        border-width: 2px;
    }
}

/* ========== BOTÓN YOUTUBE RESPONSIVE ========== */
@media (max-width: 767px) {
    /* Botón YouTube más pequeño en móvil */
    #googleSignInBtn {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.75rem !important;
        min-width: auto !important;
        max-width: 140px;
    }
    
    #googleSignInBtn svg {
        width: 14px !important;
        height: 14px !important;
    }
    
    #googleSignInBtnText {
        font-size: 0.7rem;
    }
    
    /* User info más compacto */
    .user-info {
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .user-info .btn-small {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
    
    /* Modal de bienvenida en móvil */
    .welcome-modal {
        padding: 1.5rem;
        max-width: 95%;
    }
    
    .welcome-modal-title {
        font-size: 1.25rem;
    }
    
    .welcome-feature {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
    
    .welcome-icon {
        font-size: 1.1rem;
    }
}

@media (max-width: 479px) {
    /* Botón YouTube aún más pequeño en móviles muy pequeños */
    #googleSignInBtn {
        padding: 0.35rem 0.6rem !important;
        font-size: 0.7rem !important;
        max-width: 120px;
    }
    
    #googleSignInBtnText {
        display: none;
    }
    
    #googleSignInBtn::after {
        content: 'YouTube';
        font-size: 0.7rem;
    }
    
    /* Usuario info en columna */
    .user-info > div:first-child {
        flex-wrap: wrap;
        justify-content: center;
    }
}
