/**
 * SMOOTH JAZZ CHICAGO V3 LITE - Styles
 * Basado en los colores y tema de Smooth Jazz Chicago V3
 * Ámbar Fuego / Dark / Minimalista
 */

/* ═══════════════════════════════════════════ */
/* RESET & VARIABLES                           */
/* ═══════════════════════════════════════════ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary:          #FF6B00;
    --secondary:        #FFA500;
    --accent:           #FFD700;
    --dark:             #1a1a1a;
    --light:            #ffffff;
    --inactive:         #666666;
    --bg-dark:          #0d0d0d;
    --bg-medium:        #1f1f1f;
    --bg-card:          #242424;
    --border:           rgba(255, 107, 0, 0.2);

    --gradient-primary: linear-gradient(135deg, #FF6B00 0%, #FFA500 100%);
    --gradient-dark:    linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    --gradient-card:    linear-gradient(135deg, #242424 0%, #1a1a1a 100%);

    --shadow-sm:   0 2px 8px  rgba(0,0,0,0.3);
    --shadow-md:   0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg:   0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 24px   rgba(255,107,0,0.35);

    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
            'Helvetica Neue', Arial, sans-serif;

    --radius-sm:   8px;
    --radius-md:  12px;
    --radius-lg:  16px;
    --radius-xl:  24px;
    --radius-full: 50%;

    --transition-fast:   0.15s ease;
    --transition-normal: 0.3s  ease;
    --transition-slow:   0.5s  ease;
}

/* ═══════════════════════════════════════════ */
/* BASE                                        */
/* ═══════════════════════════════════════════ */

html {
    height: 100%;
}

body {
    font-family: var(--font);
    background: var(--gradient-dark);
    color: var(--light);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#app {
    max-width: 500px;
    margin: 0 auto;
    padding: 28px 20px 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════ */
/* HEADER                                      */
/* ═══════════════════════════════════════════ */

.app-header {
    text-align: center;
    margin-bottom: 28px;
}

.app-title {
    font-size: 34px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
    line-height: 1.1;
}

.app-title span {
    font-weight: 300;
    letter-spacing: 2px;
}

.app-subtitle {
    font-size: 11px;
    color: var(--inactive);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 6px;
    opacity: 0.7;
}

/* ═══════════════════════════════════════════ */
/* CONTROLS AREA                               */
/* ═══════════════════════════════════════════ */

.controls-area {
    margin-bottom: 22px;
}

/* ── BIG PLAY BUTTON ────────────────────── */

.initial-play {
    width: 100%;
}

.big-play-btn {
    width: 100%;
    padding: 20px 24px;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    box-shadow: var(--shadow-md), var(--shadow-glow);
    letter-spacing: 0.5px;
    transition: transform var(--transition-fast),
                box-shadow var(--transition-normal);
    -webkit-tap-highlight-color: transparent;
}

.big-play-btn:hover {
    box-shadow: var(--shadow-lg), 0 0 32px rgba(255,107,0,0.5);
}

.big-play-btn:active {
    transform: scale(0.97);
}

/* ── PLAYER CONTROLS ────────────────────── */

.player-controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Progress bar */
.progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.time-label {
    font-size: 11px;
    color: var(--inactive);
    min-width: 34px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

.progress-track {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: visible;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    border-radius: 3px;
    transition: width 0.1s linear;
    pointer-events: none;
}

.progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: var(--secondary);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255,107,0,0.6);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.progress-track:hover .progress-thumb {
    opacity: 1;
}

/* Control buttons row */
.ctrl-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.ctrl-btn {
    background: transparent;
    border: none;
    color: var(--light);
    cursor: pointer;
    padding: 10px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast),
                background var(--transition-fast),
                transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.ctrl-btn:hover {
    color: var(--primary);
    background: rgba(255,107,0,0.1);
}

.ctrl-btn:active {
    transform: scale(0.9);
}

.main-ctrl-btn {
    width: 72px;
    height: 72px;
    background: var(--gradient-primary) !important;
    border-radius: var(--radius-full) !important;
    box-shadow: var(--shadow-md), var(--shadow-glow);
    color: #fff !important;
}

.main-ctrl-btn:hover {
    transform: scale(1.06) !important;
    box-shadow: var(--shadow-lg), 0 0 32px rgba(255,107,0,0.5) !important;
}

.main-ctrl-btn:active {
    transform: scale(0.96) !important;
}

/* ═══════════════════════════════════════════ */
/* SONG INFO                                   */
/* ═══════════════════════════════════════════ */

.song-info {
    text-align: center;
    margin-bottom: 20px;
    padding: 0 8px;
}

.song-title-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
    letter-spacing: 0.3px;
}

.song-artist-text {
    font-size: 14px;
    color: var(--inactive);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.5px;
}

.folder-badge {
    display: inline-block;
    margin-top: 8px;
    font-size: 11px;
    color: var(--primary);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.9;
    min-height: 16px;
}

/* ═══════════════════════════════════════════ */
/* CAROUSEL                                    */
/* ═══════════════════════════════════════════ */

.carousel-section {
    margin-bottom: 24px;
}

.carousel {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    position: relative;
    background: var(--bg-medium);
    touch-action: pan-y;
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    background: var(--bg-medium);
    overflow: hidden;
    flex-shrink: 0;
    position: relative;   /* ✅ Contiene todos los ::after dentro de su propio slide */
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;  /* ✅ Centra la imagen en iOS */
    display: block;
    position: absolute;              /* ✅ Fuerza a llenar el contenedor en iOS */
    top: 0;
    left: 0;
}

/* Cover placeholder (cuando no hay imagen) */
.cover-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #1f1f1f 0%, #141414 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.cover-placeholder svg {
    opacity: 0.15;
}

.cover-placeholder p {
    font-size: 12px;
    color: var(--inactive);
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.6;
}


/* Dots de navegación */
/* ═══════════════════════════════════════════ */

/*
 * #dw-indicator es un <div> real hermano del .carousel,
 * dentro de .carousel-section que tiene position:relative.
 * Flota sobre la esquina superior izquierda del carrusel
 * sin ser afectado por overflow:hidden.
 */

.carousel-section {
    position: relative; /* necesario para posicionar #dw-indicator */
}

#dw-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #FF6B00 0%, #FFA500 100%);
    border-radius: 9px;
    z-index: 20;
    display: none;           /* mostrado via JS */
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.45);
    animation: dwIndicatorPulse 2s ease-in-out infinite;
    transition: transform 0.15s ease;
}

#dw-indicator:hover  { transform: scale(1.12); }
#dw-indicator:active { transform: scale(0.95); }

@keyframes dwIndicatorPulse {
    0%, 100% { opacity: 0.85; transform: scale(1);    }
    50%       { opacity: 1;    transform: scale(1.1);  }
}

/* Badge "💎 Click para comprar" dentro del slide */
.carousel-slide.dw-available {
    cursor: pointer;
    position: relative;
}

.carousel-slide.dw-available::after {
    content: '💎 Click para comprar';
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #FF6B00 0%, #FF8C42 100%);
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.4);
    letter-spacing: 0.3px;
    opacity: 0;
    animation: dwBadgeIn 0.4s ease 0.3s forwards;
}

@keyframes dwBadgeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0);   }
}

@media (hover: none) {
    .carousel-slide.dw-available::after {
        opacity: 1;
        animation: dwBadgeIn 0.4s ease 0.3s both;
    }
}

/* Slides con link (promos) */
.slide-linkable {
    cursor: pointer;
    position: relative;
}

.slide-linkable::after {
    content: '↗';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    background: rgba(255, 107, 0, 0.85);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    line-height: 30px;
    text-align: center;
}

.slide-linkable:hover::after,
.slide-linkable:active::after {
    opacity: 1;
    transform: scale(1);
}

/* En móvil siempre visible (no hay hover) */
@media (hover: none) {
    .slide-linkable::after {
        opacity: 0.75;
        transform: scale(1);
    }
}

/* Dots de navegación */
.carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    margin-top: 14px;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    cursor: pointer;
    transition: background var(--transition-normal),
                transform var(--transition-normal),
                width var(--transition-normal);
    border: none;
}

.dot.active {
    background: var(--primary);
    transform: scale(1.25);
    width: 18px;
    border-radius: 4px;
}

/* ═══════════════════════════════════════════ */
/* UPSELL BANNER                               */
/* ═══════════════════════════════════════════ */

.upsell-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,107,0,0.07);
    border: 1px solid rgba(255,107,0,0.18);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 20px;
    text-align: left;
}

.upsell-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.upsell-banner p {
    font-size: 13px;
    color: rgba(255,255,255,0.65);
    line-height: 1.5;
}

.upsell-banner a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.upsell-banner a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

/* ═══════════════════════════════════════════ */
/* FOOTER                                      */
/* ═══════════════════════════════════════════ */

.app-footer {
    margin-top: auto;
    padding: 18px 0 24px;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.app-footer p {
    font-size: 12px;
    color: #444;
    letter-spacing: 0.3px;
}

.app-footer a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.app-footer a:hover {
    color: var(--secondary);
}

/* ═══════════════════════════════════════════ */
/* MODAL DE CONTACTO                           */
/* ═══════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-box {
    background: #202020;
    border: 1px solid rgba(255,107,0,0.15);
    border-radius: var(--radius-xl);
    padding: 32px 24px 28px;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(0,0,0,0.5);
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.modal-close-btn {
    position: absolute;
    top: 14px;
    right: 18px;
    background: rgba(255,255,255,0.06);
    border: none;
    color: var(--inactive);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast),
                color var(--transition-fast);
}

.modal-close-btn:hover {
    background: rgba(255,255,255,0.12);
    color: var(--light);
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--light);
    margin-bottom: 22px;
    letter-spacing: 0.3px;
}

/* Inputs */
.modal-input,
.modal-textarea {
    display: block;
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    color: var(--light);
    font-family: var(--font);
    font-size: 14px;
    padding: 12px 14px;
    margin-bottom: 12px;
    outline: none;
    transition: border-color var(--transition-fast),
                background var(--transition-fast);
    resize: none;
    -webkit-appearance: none;
}

.modal-input:focus,
.modal-textarea:focus {
    border-color: var(--primary);
    background: rgba(255,107,0,0.04);
}

.modal-input::placeholder,
.modal-textarea::placeholder {
    color: #444;
}

/* Send button */
.modal-send-btn {
    width: 100%;
    padding: 15px;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transition: transform var(--transition-fast),
                box-shadow var(--transition-normal);
    margin-bottom: 0;
}

.modal-send-btn:hover {
    box-shadow: var(--shadow-lg), 0 0 32px rgba(255,107,0,0.5);
}

.modal-send-btn:active {
    transform: scale(0.97);
}

.modal-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Error */
.contact-error {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: var(--radius-sm);
    color: #fca5a5;
    font-size: 13px;
    padding: 10px 14px;
    margin-top: 10px;
    text-align: center;
    line-height: 1.4;
}

/* Éxito */
.contact-success {
    text-align: center;
    padding: 16px 0;
}

.success-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    margin: 0 auto 18px;
    box-shadow: var(--shadow-glow);
    animation: successPop 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes successPop {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.contact-success p {
    font-size: 16px;
    font-weight: 600;
    color: var(--light);
    letter-spacing: 0.3px;
}

/* ═══════════════════════════════════════════ */
/* UTILIDADES                                  */
/* ═══════════════════════════════════════════ */

.hidden {
    display: none !important;
}

/* Loading spinner */
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,107,0,0.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════ */
/* RESPONSIVE                                  */
/* ═══════════════════════════════════════════ */

@media (max-width: 380px) {
    #app {
        padding: 20px 16px 0;
    }

    .app-title {
        font-size: 28px;
    }

    .big-play-btn {
        font-size: 16px;
        padding: 18px 20px;
    }

    .main-ctrl-btn {
        width: 62px;
        height: 62px;
    }

    .song-title-text {
        font-size: 18px;
    }
}

@media (min-width: 501px) {
    .carousel {
        max-width: 460px;
        margin: 0 auto;
        display: block;
    }
}
