/* =====================================================
   DESIGN TOKENS â€” El CucharÃ³n Viajero
   "Black is the canvas, red is the pulse."
   Extracted from approved Stitch Design System.
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;800&display=swap');

:root {
    /* â”€â”€ Color Palette â”€â”€ */
    --color-black:           #000000;
    --color-surface:         #0a0a0a;
    --color-surface-raised:  #1a1a1a;
    --color-surface-high:    #2f2f2f;
    --color-border:          #2f2f2f;
    --color-red:             #E50914;
    --color-red-hover:       #ff1a25;
    --color-red-dark:        #b3060f;
    --color-white:           #ffffff;
    --color-text-primary:    #ffffff;
    --color-text-secondary:  #b3b3b3;
    --color-text-muted:      #808080;
    --color-overlay:         rgba(0, 0, 0, 0.6);
    --color-overlay-heavy:   rgba(0, 0, 0, 0.85);

    /* â”€â”€ Typography â”€â”€ */
    --font-family:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display:          800;
    --font-headline:         700;
    --font-body:             400;
    --font-label:            700;

    --fs-display:            clamp(2.5rem, 5vw, 4rem);
    --fs-headline-lg:        clamp(1.75rem, 3vw, 2.5rem);
    --fs-headline-md:        1.5rem;
    --fs-body-lg:            1.125rem;
    --fs-body-md:            1rem;
    --fs-label:              0.875rem;
    --fs-caption:            0.75rem;

    --lh-tight:              1.1;
    --lh-snug:               1.3;
    --lh-normal:             1.6;

    /* â”€â”€ Spacing (4px base) â”€â”€ */
    --sp-xs:                 4px;
    --sp-sm:                 8px;
    --sp-md:                 16px;
    --sp-lg:                 24px;
    --sp-xl:                 40px;
    --sp-xxl:                80px;
    --sp-gutter:             24px;
    --sp-margin-desktop:     60px;
    --sp-margin-mobile:      16px;

    /* â”€â”€ Shapes â”€â”€ */
    --radius-sm:             2px;
    --radius-md:             4px;
    --radius-lg:             8px;
    --radius-xl:             12px;
    --radius-full:           9999px;

    /* â”€â”€ Transitions â”€â”€ */
    --transition-fast:       150ms ease;
    --transition-normal:     300ms ease;
    --transition-slow:       500ms ease;

    /* â”€â”€ Z-index layers â”€â”€ */
    --z-base:                1;
    --z-card:                10;
    --z-header:              50;
    --z-overlay:             100;
    --z-modal:               200;
}

/* â”€â”€ Reset â”€â”€ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--fs-body-md);
    font-weight: var(--font-body);
    line-height: var(--lh-normal);
    color: var(--color-text-primary);
    background-color: var(--color-black);
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

ul, ol { list-style: none; }

/* â”€â”€ Utility Classes â”€â”€ */
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* â”€â”€ Buttons â”€â”€ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-sm);
    font-weight: var(--font-label);
    font-size: var(--fs-label);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: var(--radius-md);
    padding: var(--sp-md) var(--sp-xl);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-red);
    color: var(--color-white);
}
.btn-primary:hover {
    background: var(--color-red-hover);
    transform: scale(1.03);
}

.btn-secondary {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--color-white);
    border: 1px solid rgba(255,255,255,0.1);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.25);
}

/* â”€â”€ Card Component â”€â”€ */
.card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition-normal);
    flex-shrink: 0;
}
.card:hover {
    transform: scale(1.05);
    z-index: var(--z-card);
}
.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-badge {
    position: absolute;
    top: var(--sp-sm);
    left: var(--sp-sm);
    background: var(--color-red);
    color: var(--color-white);
    font-size: var(--fs-caption);
    font-weight: var(--font-label);
    padding: var(--sp-xs) var(--sp-sm);
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.card-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--color-surface-high);
}
.card-progress-bar {
    height: 100%;
    background: var(--color-red);
    transition: width var(--transition-normal);
}
.card-title {
    display: block;
    padding: var(--sp-sm) var(--sp-xs);
    font-size: var(--fs-label);
    font-weight: var(--font-label);
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--transition-fast);
}
.card:hover .card-title {
    color: var(--color-white);
}

/* â”€â”€ Carousel Row â”€â”€ */
.carousel-section {
    overflow: hidden;
}
.carousel-title {
    font-size: var(--fs-headline-md);
    font-weight: var(--font-headline);
    margin-bottom: var(--sp-lg);
}
.carousel-track {
    display: flex;
    gap: var(--sp-md);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--sp-md);
    scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track .card {
    scroll-snap-align: start;
}

/* â”€â”€ Hero Gradient Overlay â”€â”€ */
.hero-gradient {
    background: linear-gradient(0deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0.5) 40%, rgba(0,0,0,0) 100%);
}

/* â”€â”€ Material Icons (Google Fonts) â”€â”€ */
.icon {
    font-family: 'Material Symbols Outlined', sans-serif;
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
}

/* -- Form Inputs -- */
.form-input {
    width: 100%;
    padding: var(--sp-md);
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-family: var(--font-family);
    font-size: var(--fs-body-md);
    transition: border-color var(--transition-fast);
}
.form-input:focus {
    outline: none;
    border-color: var(--color-red);
}
.form-input::placeholder {
    color: var(--color-text-muted);
}

/* %% Video Player (Cloaking & Tracking) %% */
.player-container {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.player-back-btn {
    position: absolute;
    top: var(--sp-lg);
    left: var(--sp-lg);
    z-index: 30;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
    font-size: var(--fs-body-md);
    background: rgba(0,0,0,0.5);
    padding: var(--sp-xs) var(--sp-sm);
    border-radius: var(--radius-sm);
    transition: background 0.2s, opacity 0.3s, transform 0.3s;
}
.player-back-btn:hover {
    background: rgba(0,0,0,0.8);
    color: var(--color-red);
}
.player-wrapper {
    position: relative;
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.player-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    cursor: pointer;
    background: transparent;
}
#youtubePlayer {
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.custom-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
    padding: var(--sp-lg);
    display: flex;
    flex-direction: column;
    gap: var(--sp-sm);
    transition: opacity 0.3s, transform 0.3s;
}
.progress-bar-container {
    height: 6px;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    border-radius: 3px;
    position: relative;
    transition: height 0.2s;
}
.progress-bar-container:hover {
    height: 8px;
}
.progress-bar-fill {
    height: 100%;
    background: var(--color-red);
    width: 0%;
    border-radius: 3px;
    position: relative;
}
.progress-bar-fill::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: var(--color-red);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}
.progress-bar-container:hover .progress-bar-fill::after {
    opacity: 1;
}
.control-buttons {
    display: flex;
    align-items: center;
    gap: var(--sp-md);
}
.control-btn {
    color: white;
    font-size: 1.5rem;
    padding: var(--sp-xs);
    transition: color 0.2s, transform 0.2s;
}
.control-btn:hover {
    color: var(--color-red);
    transform: scale(1.1);
}
.time-display {
    color: white;
    font-size: 0.9rem;
    font-family: monospace;
}
.video-info {
    flex: 1;
    text-align: center;
    color: white;
}
.video-info h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: var(--font-headline);
}

/* New CSS for auto-hiding and volume controls */
.hide-controls {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}
.player-back-btn.hide-controls {
    transform: translateY(-10px);
}

.volume-container {
    display: flex;
    align-items: center;
    gap: var(--sp-xs);
}

.volume-slider {
    -webkit-appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    outline: none;
    opacity: 0;
    transition: opacity 0.2s, width 0.2s;
    cursor: pointer;
}

.volume-container:hover .volume-slider {
    opacity: 1;
    width: 80px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-red);
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-red);
    cursor: pointer;
    border: none;
}

/* ── User Dropdown Menu ── */
.user-menu-container {
    position: relative;
    display: inline-flex;
}
.user-menu-trigger {
    position: relative;
    z-index: 2;
}
.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--sp-sm) 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.97);
    transition: all 200ms ease;
    z-index: var(--z-modal);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}
.user-menu-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.user-menu-header {
    padding: var(--sp-md) var(--sp-lg);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.user-menu-name {
    font-size: var(--fs-body-md);
    font-weight: var(--font-headline);
    color: var(--color-white);
}
.user-menu-role {
    font-size: var(--fs-caption);
    color: var(--color-red);
    font-weight: var(--font-label);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.user-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: var(--sp-xs) 0;
}
.user-menu-item {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    padding: var(--sp-sm) var(--sp-lg);
    font-size: var(--fs-label);
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
    text-decoration: none;
}
.user-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-white);
}
.user-menu-item .icon {
    font-size: 20px;
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}
.user-menu-item:hover .icon {
    color: var(--color-white);
}
.user-menu-admin {
    color: var(--color-red);
}
.user-menu-admin .icon {
    color: var(--color-red);
}
.user-menu-admin:hover {
    background: rgba(229, 9, 20, 0.1);
    color: var(--color-red-hover);
}
.user-menu-logout:hover {
    color: var(--color-red);
}
.user-menu-logout:hover .icon {
    color: var(--color-red);
}
 
 /* ── Legal Modals (Popups) ── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--color-overlay-heavy);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal);
}
.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -45%) scale(0.95);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8);
}
.modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}
.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}
.modal-close {
    position: absolute;
    top: var(--sp-md);
    right: var(--sp-md);
    color: var(--color-text-secondary);
    transition: color var(--transition-fast);
    z-index: 10;
}
.modal-close:hover {
    color: var(--color-white);
}
.modal-header {
    padding: var(--sp-lg);
    border-bottom: 1px solid var(--color-border);
}
.modal-header h2 {
    font-size: var(--fs-headline-md);
    font-weight: var(--font-headline);
    margin: 0;
}
.modal-body {
    padding: var(--sp-lg);
    overflow-y: auto;
    color: var(--color-text-secondary);
    line-height: var(--lh-normal);
}
.modal-body strong {
    color: var(--color-white);
}
.modal-body p {
    margin-bottom: var(--sp-md);
}
.modal-body ul {
    margin-bottom: var(--sp-md);
    padding-left: var(--sp-md);
    list-style-type: disc;
}
.modal-body li {
    margin-bottom: var(--sp-sm);
}

/* Speed Menu */
.speed-container {
    position: relative;
    display: flex;
    align-items: center;
}
.speed-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: var(--sp-xs);
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--sp-xs) 0;
    display: none;
    flex-direction: column;
    min-width: 120px;
    z-index: 100;
}
.speed-menu.active {
    display: flex;
}
.speed-menu button {
    padding: var(--sp-sm) var(--sp-md);
    color: white;
    text-align: left;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    cursor: pointer;
}
.speed-menu button:hover {
    background: rgba(255, 255, 255, 0.1);
}
.speed-menu button.active {
    color: var(--color-red);
    font-weight: bold;
}
.speed-menu button.active::after {
    content: '✓';
    margin-left: 10px;
}
