/* ═══ Sin cursor de texto ni selección en elementos interactivos ═══ */
/* Al hacer click/doble-click en botones, enlaces, pestañas o chips el navegador
   seleccionaba el texto de dentro y mostraba el cursor de escritura. Feo. */
button,
a,
label,
summary,
[role="button"],
[role="tab"],
.btn,
.tab,
.chip,
.pill,
.badge,
.card-action,
.action-btn,
.nav-item,
.nav-link {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    cursor: pointer;
}

/* Excepción: dentro de un control interactivo puede haber un input/textarea
   editable (ej. un botón con campo), ahí sí se puede seleccionar/escribir. */
button input, button textarea,
a input, a textarea,
label input, label textarea,
.btn input, .btn textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    cursor: auto;
}

/* ═══ Scrollbars globales oscuros (override del default del navegador) ═══ */
* {
    scrollbar-width: thin;
    scrollbar-color: #334155 #0a0e17;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: #0a0e17; border-radius: 0; }
*::-webkit-scrollbar-thumb { background: #334155; border-radius: 8px; border: 2px solid #0a0e17; }
*::-webkit-scrollbar-thumb:hover { background: #475569; }
*::-webkit-scrollbar-corner { background: #0a0e17; }

:root {
    --bg-primary: var(--color-bg-base, #1E1E1E);
    --bg-secondary: var(--color-bg-base, #1E1E1E);
    --bg-tertiary: var(--color-bg-elevated, #2A2A2A);
    --text-primary: var(--color-text-primary, #FFFFFF);
    --text-secondary: var(--color-text-secondary, #A0A0A0);
    --accent-primary: var(--color-brand, #A445FF);
    --accent-hover: #ffffff;
    --border-color: var(--color-border, #3A3A3A);
    --input-bg: var(--color-bg-elevated, #2A2A2A);
    --font-main: 'Montserrat', -apple-system, sans-serif;
}

.fa-solid,
.fas {
    font-weight: 900;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.light-mode {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f3f4;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --border-color: #dadce0;
    --input-bg: #ffffff;
    --accent-hover: #202124;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
}

/* Prime layout (trends sin sidebar): el wrapper scrollea, no el body */
body.trends-prime-view .prime-wrapper {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

body.trends-prime-view .prime-wrapper::-webkit-scrollbar {
    width: 6px;
}

body.trends-prime-view .prime-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

body.trends-prime-view .prime-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

body.trends-prime-view .prime-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Layout with Sidebar */
.app-wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-secondary);
}

.sidebar {
    /* 270px: con 240 el logo iba pegado y los títulos largos del menú
       ("Miniaturas Studio" + su badge) se cortaban. Sobra ancho a la derecha
       en cualquier pantalla, así que el sitio sale de ahí. */
    width: 270px;
    background-color: var(--bg-secondary);

    display: flex;
    flex-direction: column;
    padding: 2rem 0.5rem;
    height: 100vh;
    z-index: 100;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-logo {
    display: block;
    margin-bottom: 2rem;
    text-align: center;
    text-decoration: none;
    flex-shrink: 0;
}

.sidebar-logo img {
    width: 100%;
    height: auto;
    margin-left: 4px;
    margin-bottom: -17px;
    margin-top: -23px;
}

.logo-img {
    height: 27px;
    width: auto;
    margin-right: -8px;
    vertical-align: middle;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex: 1;
    /* Ocupa el espacio y empuja el footer. Si hay muchos accesos y no caben, la zona
       de navegación scrollea por dentro — así el footer (créditos/iconos) queda SIEMPRE
       visible abajo. min-height:0 es necesario para que el overflow funcione en flex. */
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;              /* nunca scroll horizontal */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.nav-menu::-webkit-scrollbar { width: 5px; }
.nav-menu::-webkit-scrollbar-track { background: transparent; }
.nav-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
.nav-menu::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.8rem 0.3rem;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    /* Evitar salto de línea */
}

.nav-item:hover {
    background-color: #df0dfb26;
    color: #ffffff;
}


.nav-item.active {
    background-color: #7a19fa;
    color: #ffffff;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    color: var(--color-brand) !important;
}

/* Cuando el ítem está activo/hover, el fondo es morado; el icono (que por defecto
   es morado) quedaría invisible. Forzamos blanco para que se vea. Aplica a todos. */
.nav-item.active i,
.nav-item:hover i {
    color: #ffffff !important;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    flex-shrink: 0;
    overflow: visible;
}

.footer-icons {
    display: flex;
    justify-content: center;
    gap: 0rem;
    overflow: visible;
    margin-top: -15px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 1.1rem;
    background-color: transparent;
    border: none;
    padding: 0;
    box-sizing: border-box;
    flex-shrink: 0;
    position: relative;
}

.icon-btn:hover {
    color: #2978ed;
}

/* Notif Tray Styles */
.notification-tray {
    position: relative;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff4081;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

.notif-dropdown {
    position: absolute;
    bottom: 60px;
    left: 0;
    width: 300px;
    background: #1a1a1a;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    overflow: hidden;
    display: none;
    animation: slideUpNotif 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes slideUpNotif {
    from {
        transform: translateY(15px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.notif-header {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    justify-content: space-between;
}

.notif-list {
    max-height: 350px;
    overflow-y: auto;
}

.notif-item {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
    transition: background 0.2s;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.notif-item-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.2rem;
}

.notif-item-msg {
    font-size: 0.75rem;
    color: #888;
    line-height: 1.4;
}

.notif-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: #555;
    font-size: 0.85rem;
}

/* Modal de lectura de notificacion */
.notif-read-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    padding: 1rem;
}

.notif-read-box {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.notif-read-head {
    padding: 1.4rem 1.6rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.notif-read-title {
    margin: 0 0 0.3rem;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
}

.notif-read-date {
    color: #6b7280;
    font-size: 0.75rem;
}

.notif-read-body {
    padding: 1.2rem 1.6rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

.notif-read-actions {
    padding: 0.9rem 1.6rem 1.3rem;
    display: flex;
    gap: 0.7rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.notif-read-btn-later,
.notif-read-btn-ok {
    padding: 0.6rem 1.1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.notif-read-btn-later {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #9898a8;
}

.notif-read-btn-ok {
    background: #a855f7;
    border: none;
    color: #fff;
}

.main-content {
    flex: 1;
    height: calc(100vh - 16px);
    margin: 8px 8px 8px 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    padding-bottom: 4rem;
    background: #101010;
    border-radius: 0 12px 12px 0;
    border: 1px solid var(--border-color);
}

.main-content::-webkit-scrollbar {
    width: 6px;
}
.main-content::-webkit-scrollbar-track {
    background: transparent;
}
.main-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
.main-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.app-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 2rem;
   
    flex-direction: column;
    gap: 0rem;
}

/* Páginas fullwidth (mis-guiones, dashboards, listados) */
body.fullwidth-page .app-container {
    max-width: 100% !important;
    padding: 0 1.5rem !important;
}

/* Admin: expandir a ancho completo (todas las páginas) */
body.admin-view .app-container,
body.admin-view .app-container > div {
    max-width: 100% !important;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
}

/* Header */
.main-header {
    text-align: center;
    margin-bottom: 0px;
}

.search-title {
    font-size: 3.20px;
    font-weight: 900;
    margin: 0;
    letter-spacing: -1.5px;
    line-height: 1.1;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
    transition: transform 0.2s, text-shadow 0.2s;
}





.search-subtitle {
    font-size: 3.2rem;
    color: #a445ff;
    margin-top: 23px;
    font-weight: bold;
}

/* Tabs & Toggle Mode */
.tabs-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.tab-item {
    font-size: 1.2rem;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
    color: var(--text-secondary);
    transition: color 0.3s;
}

.tab-item.active {
    color: #015767;
    /* Green requested by user */
    font-weight: bold;
}

/* Custom Toggle Switch for Mode */
.toggle-mode-btn {
    position: relative;
    width: 48px;
    height: 24px;
    background-color: var(--bg-tertiary);
    border-radius: 12px;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s, border-color 0.3s;
}

.toggle-mode-btn.active {
    background-color: #015767 !important;
    /* Green requested by user */
    border-color: #015767 !important;
}

.toggle-mode-btn:hover {
    border-color: var(--accent-primary);
}

.toggle-track {
    width: 100%;
    height: 100%;
}

.toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), background-color 0.3s;
}

.toggle-thumb.idea-mode {
    transform: translateX(24px);
    background-color: var(--text-primary);
}

/* Inputs */
.st-input,
.st-textarea {
    width: 100%;
    background-color: #19344e4f;
    border: solid 1.5px #0e4c77;
    color: var(--text-primary);
    font-size: 15px;
    padding: 1rem 1.5rem;
    border-radius: 19px;
    outline: none;
    transition: border 0.3s;
    font-family: var(--font-main);
}

/* Eliminar estilos de autofill del navegador (raya morada al seleccionar sugerencia) */
@keyframes autofill-fix {
    0%, 100% {
        background-color: #0a1929 !important;
        color: #e0e0e0 !important;
    }
}

input#input-query:-webkit-autofill,
input#input-query:-webkit-autofill:hover,
input#input-query:-webkit-autofill:focus,
input#input-query:-webkit-autofill:active,
.st-input:-webkit-autofill,
.st-input:-webkit-autofill:hover,
.st-input:-webkit-autofill:focus,
.st-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 9999px #0a1929 inset !important;
    box-shadow: 0 0 0 9999px #0a1929 inset !important;
    -webkit-text-fill-color: #e0e0e0 !important;
    background-color: #0a1929 !important;
    background-image: none !important;
    border: solid 1.5px #0e4c77 !important;
    transition: background-color 5000s ease-in-out 0s !important;
    caret-color: #e0e0e0 !important;
    animation: autofill-fix 0s forwards !important;
}

/* Estándar (Firefox y navegadores modernos) */
input#input-query:autofill,
.st-input:autofill {
    -webkit-box-shadow: 0 0 0 9999px #0a1929 inset !important;
    box-shadow: 0 0 0 9999px #0a1929 inset !important;
    -webkit-text-fill-color: #e0e0e0 !important;
    background-color: #0a1929 !important;
    border: solid 1.5px #0e4c77 !important;
    caret-color: #e0e0e0 !important;
}




.st-textarea {
    resize: none;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.st-textarea::-webkit-scrollbar {
    display: none;
}

/* THE ALIGNED ROW (User Request) */
.helper-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    /* The Magic Number */
    padding: 0 5px;
}

.helper-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    display: none;
}

.toggle-label {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Switch UI */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #be2985 !important;
    /* Green requested by user */
}

.toggle-label.active {
    color: #015767 !important;
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Buttons */
.btn-primary {
    background: #01306773;
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 2.4rem;
    font-weight: 700;
    border-radius: 22px;
    width: 44%;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 2rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.btn-primary:active {
    transform: translateY(2px) scale(0.96);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    opacity: 0.85;
    transition: all 0.05s;
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
    font-weight: 600;
    margin-top: 1rem;
    width: 100%;
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
}

/* Config Expander */
.config-expander {
    margin-top: 2rem;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}



.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.75rem;
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
    align-items: end;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.reset-container {
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 5px;
}

.btn-reset-filters {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.7rem;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px;
    transition: all 0.2s;
    text-decoration: underline;
    white-space: nowrap;
}

.btn-reset-filters:hover {
    color: var(--danger-color, #ff4b4b);
    transform: translateY(-1px);
}


.config-item label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.config-item input {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 6px;
}

/* Chips */
.chips-container {
    margin-top: 1.5rem;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chips-container::-webkit-scrollbar {
    display: none;
}

.chips-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.chip {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--accent-primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chip-close {
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
    font-weight: bold;
    font-size: 1.3rem;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 50%;
    transition: background 0.2s;
}
.chip-close:hover {
    background: rgba(255,255,255,0.15);
}

/* Results Grid */
.results-section {
    margin-top: 2rem;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.video-grid > .no-results-container {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
}

.video-card {
    position: relative;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
}

.video-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
}

.thumb-container {
    position: relative;
    padding-top: 56.25%;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

.thumb-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-container iframe,
.thumb-container #yt-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.vsr-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
    cursor: default;
    z-index: 10;
    transition: opacity 0.3s ease;
}
.video-card:hover .vsr-badge { opacity: 0; pointer-events: none; }
.vsr-inline { display: none; }

.vsr-tooltip {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 100;
    width: 220px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.72rem;
    font-weight: normal;
    color: #cbd5e1;
    line-height: 1.5;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    pointer-events: none;
}

.vsr-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 12px;
    width: 10px;
    height: 10px;
    background: #1a1a2e;
    border-left: 1px solid rgba(255,255,255,0.12);
    border-top: 1px solid rgba(255,255,255,0.12);
    transform: rotate(45deg);
}

.vsr-tooltip-highlight {
    display: inline-block;
    margin-top: 4px;
    color: #a445ff;
    font-weight: 600;
}

.vsr-badge:hover .vsr-tooltip {
    display: block;
}

.vsr-badge.vsr-high {
    background-color: #ff4b4b;
}

.vsr-badge.vsr-medium {
    background-color: #f9ab00;
}

.vsr-badge.vsr-good {
    background-color: #2ba640;
}

.vsr-badge.vsr-default {
    background-color: #666;
}

.video-info {
    padding: 1rem;
}

.video-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Footer Recent Jobs */
.recent-jobs {
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.jobs-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.job-card {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
}

.job-thumb {
    height: 154px;
    background-size: cover;
    background-position: center;
}

.job-info {
    padding: 0.8rem;
}

.job-title {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-mini-meta {
    margin-top: 0.35rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.job-mini-meta-item i {
    margin-right: 0.3rem;
    opacity: 0.9;
}

.job-mini-stats {
    margin-top: 0.35rem;
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.job-mini-stat i {
    margin-right: 0.3rem;
    opacity: 0.9;
}

.job-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* =========================================
   Home: Recent Rails (Netflix style)
   ========================================= */

.recent-rails {
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

.rail-section {
    margin-top: 1.25rem;
}

.rail-track {
    margin-top: 0.8rem;
    display: flex;
    gap: 0.9rem;
    overflow-x: auto;
    padding: 0.2rem 0.2rem 0.8rem 0.2rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}

.rail-track.dragging {
    cursor: grabbing;
    user-select: none;
}

.rail-track::-webkit-scrollbar {
    height: 10px;
}

.rail-track::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}

.rail-card {
    flex: 1 5 280px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
    scroll-snap-align: start;
    transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.32s ease, box-shadow 0.32s ease;
}

.rail-card:hover {
    transform: translateY(-3px) scale(1.04);
    border-color: #0a630d;
    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.35),
        0 0 18px rgba(10, 99, 13, 0.45);
}

.rail-thumb {
    height: 156px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

/* Sombra animada (izq -> der) sobre miniatura */
.rail-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.0), rgba(0,0,0,0.55), rgba(0,0,0,0.15));
    transform: translateX(-110%);
    transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
}

.rail-card:hover .rail-thumb::after {
    transform: translateX(0%);
}

.rail-analysis-card .rail-thumb {
    position: relative;
}
.rail-analysis-card .rail-thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(182deg, rgb(0 0 0 / 95%), rgb(0 0 0 / 69%));
    z-index: 1;
}
.analysis-overlay {
    position: absolute;
    /* inset: -3px; */
    z-index: 2;
    display: flex;
    flex-direction: column;
    /* justify-content: flex-start; */
    gap: 16px;
    padding: 10px;
    color: #e5e7eb;
}
.analysis-overlay-title {
    font-weight: 800;
    font-size: 0.95rem;
    line-height: 1.2;
    color: #e5e7eb;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.analysis-overlay-scores {
    display: flex;
    gap: 28px;
    align-items: center;
}
.analysis-score {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.analysis-score-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #a3a7a2;
    letter-spacing: 0.08em;
}
.analysis-score-value {
    font-size:27px;
    font-weight: 900;
    color: #a445ff;
}
.analysis-overlay-cta {
    margin-top: -8px;
    align-self: flex-end;
    background: #0f6b039e;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.82rem;
    border-radius: 8px;
    padding: 9px 10px;
    margin-left: 126px;
}
.analysis-overlay-meta {
    display: flex;
    gap: 16px;
    margin-top: -1px;
    flex-wrap: nowrap;
}
.analysis-meta-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.analysis-meta-value {
    font-size: 11px;
    font-weight: 800;
}
.analysis-meta-item:nth-child(1) .analysis-meta-value {
    color: #00ff9d;
}
.analysis-meta-item:nth-child(2) .analysis-meta-value {
    color: #ff4757;
}
.analysis-meta-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #b0b5bd;
    letter-spacing: 0.08em;
}
.rail-overlay-metrics {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2;
}

.rail-overlay-metrics .overlay-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 6px 8px;
    border-radius: 10px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.14);
    text-shadow: 0 2px 6px rgba(0,0,0,0.85);
}

.rail-overlay-metrics .overlay-val {
    font-weight: 900;
    font-size: 1.2rem;
    line-height: 1;
    letter-spacing: -0.3px;
}

.rail-overlay-metrics .overlay-lbl {
    margin-top: 3px;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.85;
}

.rail-overlay-metrics .views {
    color: #00ff9d;
}

.rail-overlay-metrics .subs {
    color: #ff4757;
}

.rail-metric {
    position: absolute;
    left: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    font-weight: 900;
    letter-spacing: -0.3px;
    line-height: 1;
    font-size: 1.05rem;
    text-shadow: 0 2px 6px rgba(0,0,0,0.85);
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.16);
    z-index: 2;
}

.rail-metric span {
    display: block;
    margin-top: 4px;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    opacity: 0.85;
}

.rail-metric-views {
    top: 10px;
    color: #38d66b;
}

.rail-metric-subs {
    bottom: 10px;
    color: #ff4d4d;
}

.rail-search-thumb {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.16), rgba(156, 39, 176, 0.14));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.75rem;
}

.rail-search-icon {
    font-size: 1.35rem;
    opacity: 0.9;
}

.rail-search-meta {
    text-align: right;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.rail-search-date {
    color: #e8eaed;
    font-weight: 700;
}

.rail-search-count {
    margin-top: 0.15rem;
}

.rail-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.18);
}

.rail-body {
    padding: 0.75rem;
}

.rail-title {
    font-size: 0.9rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rail-sub {
    margin-top: 0.45rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.rail-sub i {
    margin-right: 0.3rem;
    opacity: 0.9;
}

.rail-search-card .rail-thumb {
    display: none;
}

.rail-search-card {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.12), rgba(156, 39, 176, 0.10));
}

.rail-empty {
    margin-top: 0.6rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgb(226 162 19 / 97%);
    border-top: 5px solid #9e9e9e17;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* =========================================
   PAGES STYLES
   ========================================= */

/* JOBS PAGE */
.jobs-list-container {
    width: 100%;
}

.jobs-grid-large {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    grid-auto-rows: 1fr;  /* fuerza todas las filas a misma altura */
    gap: 16px;
    align-items: stretch;
}

/* Tarjeta estilo trends pero con acento verde/cyan (para diferenciar de trends) */
.job-card-large {
    background: linear-gradient(180deg, #131826 0%, #0b1120 100%);
    border: 1px solid rgba(16, 185, 129, 0.18);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.job-card-large:hover {
    transform: translateY(-4px);
    border-color: rgba(16, 185, 129, 0.55);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
}

.job-thumb-large {
    aspect-ratio: 16 / 9;
    background-size: cover;
    background-position: center;
    position: relative;
}

.job-thumb-large .status-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.65rem;
    font-weight: 800;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.status-badge.pendiente {
    background-color: #f9ab00;
    color: #000;
}

.status-badge.extrayendo {
    background-color: #2196F3;
}

.status-badge.analizando {
    background-color: #9C27B0;
}

.status-badge.completado {
    background-color: #4CAF50;
}

.status-badge.error {
    background-color: #F44336;
}

.job-details {
    padding: 12px 14px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}
.job-details-top { display: flex; flex-direction: column; gap: 8px; }
.job-details-bottom { display: flex; flex-direction: column; gap: 8px; }

.job-title-large {
    margin: 0;
    color: #fff;
    font-size: 0.82rem;
    line-height: 1.3;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.5em;
}

.job-meta {
    font-size: 0.7rem;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    margin: 0;
    gap: 8px;
    flex-wrap: wrap;
}

.job-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.job-actions {
    margin-top: 4px;
    display: flex;
    gap: 6px;
}

.btn-action {
    padding: 9px 12px;
    border-radius: 10px;
    border: none;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
    font-weight: 700;
    font-size: 0.82rem;
    text-decoration: none;
    text-align: center;
    transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
}

.btn-action.view {
    flex: 1;
    background: #af0dff87;
    color: #fff;
    border: solid 1px #5a1b933b;
}

.btn-action.delete {
    background-color: rgba(244, 67, 54, 0.1);
    color: #F44336;
    width: 38px;
    flex-shrink: 0;
}

.btn-action.view:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(103, 16, 185, 0.45);
}

.btn-action.view:active {
    transform: scale(0.96);
    background-color: #a445ff;
    color: #fff;
    border-color: #a445ff;
}

.btn-action.delete:hover {
    transform: scale(1.08);
    background-color: rgba(244, 67, 54, 0.2);
}

.btn-action.delete:active {
    transform: scale(0.92);
    background-color: rgba(244, 67, 54, 0.3);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--bg-secondary);
    border-radius: 16px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* SETTINGS PAGE */
.settings-container {
    width: 100%;
    max-width: none;
    margin: 0;
}

.settings-section {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.settings-section h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ANALYSIS PAGE */
.analysis-header {
    margin-bottom: 2rem;
}


.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #888;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    font-size: 23px;
}

.btn-back:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}


.job-meta-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.analysis-container {
    display: grid;
    grid-template-columns: 1fr;
    /* Mobile first, but usually 2 cols */
    gap: 2rem;
}

@media (min-width: 900px) {
    .analysis-container {
        grid-template-columns: 1.2fr 0.8fr;
    }
}

.video-preview-section {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.video-embed-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background-color: black;
}

.video-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.analysis-results {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.placeholder-box {
    text-align: center;
    padding: 2rem;
    background-color: var(--bg-tertiary);
    border-radius: 8px;
    margin-top: 1rem;
}

/* --- ADDED / RESTORED SECTIONS BELOW --- */

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-secondary);
    margin: 10% auto;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    color: var(--text-primary);
}

.close-modal {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
}

.close-modal:hover {
    color: var(--text-primary);
}

.modal-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.modal-body li {
    margin-bottom: 0.5rem;
}

.modal-note {
    background-color: rgba(0, 137, 255, 0.1);
    border-left: 4px solid #015767;
    padding: 1rem;
    border-radius: 4px;
}

/* Provider Logos */
.provider-logo {
    height: 24px;
    width: auto;
    margin-right: 10px;
    vertical-align: middle;
}

.provider-header img {
    height: 24px;
    width: auto;
    margin-right: 10px;
    vertical-align: middle;
}

/* Roles Configuration */
.roles-container {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.role-card {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.role-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.role-body small {
    display: block;
    color: #0091d3;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.role-body select {
    width: 100%;
    margin-bottom: 0.5rem;
    background: #363636;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 4px;
}

/* Vision Icon & Model Select Container */
.model-select-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.model-select-container select {
    flex-grow: 1;
    margin-bottom: 0 !important;
    /* Override previous margin */
}

.vision-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    display: none;
    /* Default hidden, toggled by JS */
    object-fit: contain;
}

/* Password Input Group */
.password-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.password-input-group input {
    flex: 1;
}

.password-toggle {
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
    color: var(--text-secondary);
    padding: 0.5rem;
}

.password-toggle:hover {
    color: var(--text-primary);
}

.btn-verify {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.btn-verify:hover {
    border-color: #015767;
    color: #015767;
}


/* Status Classes for Settings */
.btn-success {
    background-color: #2e7d32 !important;
    color: white !important;
    border-color: #2e7d32 !important;
}

.btn-error {
    background-color: #c62828 !important;
    color: white !important;
    border-color: #c62828 !important;
}

.header-success {
    color: #4CAF50 !important;
    border-bottom-color: #4CAF50 !important;
}

/* ST-SELECT (Selects Nativos) */
.st-select-native {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    -webkit-border-radius: 6px;
    -moz-border-radius: 6px;
    font-family: var(--font-main);
    font-size: 0.9rem;
    width: 100%;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0a0a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.2rem;
    padding-right: 2.5rem;
}

.st-select-native:hover {
    border-color: var(--accent-primary);
}

.st-select-native:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(158, 158, 158, 0.1);
}

.st-select-native option {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 0.5rem;
}

/* Video Type Toggles */
.video-type-toggles {
    display: flex;
    gap: 0.75rem;
}

.toggle-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 6px;
    font-family: var(--font-main);
    font-size: 0.9rem;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.toggle-btn.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
    font-weight: 600;
}

/* Mode Toggles */
.mode-toggles {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

/* Months Toggles */
.months-toggles {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
}

.toggle-btn-single {
    padding: 0.6rem 0.75rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 20px;
    font-family: var(--font-main);
    font-size: 0.85rem;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
    transition: all 0.2s ease;
}

.toggle-btn-single:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.toggle-btn-single.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
    font-weight: 600;
}

/* Manual Chip Input - Añadido para mejorar la UI en Modo Idea */
.add-manual {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    align-items: center;
}

.add-manual input {
    flex: 1;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    /* Más alto para match con botón */
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.add-manual input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(255, 64, 129, 0.1);
    outline: none;
}

.add-manual button {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--accent-primary);
    /* Color acento para el + */
    width: 46px;
    /* Cuadrado */
    height: 46px;
    border-radius: 10px;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    padding: 0;
}

.add-manual button:hover {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 64, 129, 0.2);
}

/* Custom Slider Styling */
.slider-custom {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #3b82f6, #2563eb);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider-custom::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 2px solid #3b82f6;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
}

.slider-custom::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.6);
}

.slider-custom::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 2px solid #3b82f6;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
    transition: all 0.2s ease;
}

.slider-custom::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.6);
}

.slider-custom::-moz-range-track {
    background: transparent;
    border: none;
}

/* Reset Button Style */
.btn-reset-small-v2 {
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 12px;
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='24' viewBox='0 0 22 24'><path d='M8 10 L8 3.5 C8 2.3 9 1.5 10 1.5 C11 1.5 12 2.3 12 3.5 L12 11 L12 8 C12 7 13 6.3 14 6.3 C15 6.3 16 7 16 8 L16 12 L16 9.5 C16 8.5 17 7.8 18 7.8 C19 7.8 20 8.5 20 9.5 L20 16 C20 20 17 22.5 13.5 22.5 L11 22.5 C8.5 22.5 6.5 20.8 5.5 18.5 L3 12.5 C2.5 11.3 3.3 10.3 4.3 10.3 C5 10.3 5.5 10.6 5.8 11.1 L8 14 Z' fill='%23a445ff' stroke='white' stroke-width='1.2' stroke-linejoin='round'/></svg>") 6 1, pointer;
    transition: all 0.2s ease;
}

.btn-reset-small-v2:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* Config Grid Layout */
.config-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.slider-item {
    grid-column: span 1;
}

/* Sidebar Upgrade Card (Pro Lifetime) */
.sidebar-upgrade-card {
    background: linear-gradient(135deg, #7c3aed 0%, #db2777 50%, #f97316 100%);
    border-radius: 20px;
    padding: 2.5rem 1rem;
    margin: 1.5rem 0.6rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(219, 39, 119, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.sidebar-upgrade-card:hover {
    transform: translateY(-5px);
}

.upgrade-card-crown-top {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 0.9rem;
    color: #a445ff;
    opacity: 0.6;
}

.upgrade-card-main-icon {
    font-size: 3.5rem;
    color: #a445ff;
    margin-bottom: 0.5rem;
    position: relative;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
    z-index: 1;
}

.upgrade-card-sparkle {
    position: absolute;
    color: white;
    opacity: 0;
    font-size: 0.6rem;
    animation: sparkle-rise 3s infinite linear;
}

@keyframes sparkle-rise {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }

    20% {
        opacity: 1;
        transform: translateY(-10px) scale(1);
    }

    80% {
        opacity: 1;
        transform: translateY(-40px) scale(1);
    }

    100% {
        transform: translateY(-50px) scale(0.5);
        opacity: 0;
    }
}

.sparkle-1 {
    top: 20%;
    left: 15%;
    animation-delay: 0.1s;
}

.sparkle-2 {
    top: 10%;
    right: 30%;
    animation-delay: 0.5s;
}

.sparkle-3 {
    bottom: 40%;
    left: 10%;
    animation-delay: 0.8s;
}

.upgrade-card-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0.5rem 0 1.2rem 0;
    letter-spacing: -0.5px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);
}

.upgrade-card-price {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: baseline;
    justify-content: center;
}

.upgrade-card-price span {
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.8;
    margin-left: 4px;
}

.upgrade-btn-link {
    background: white;
    color: #9333ea;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    width: 100%;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.upgrade-btn-link:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(255, 255, 255, 0.2);
    background: #ffffff;
}

.upgrade-btn-link i {
    font-size: 0.85rem;
    color: #9333ea;
}

/* =========================================
   MODO CARRUSEL (Netflix) - Sidebar blur + fullwidth
   ========================================= */

/* Sidebar con blur y auto-ocultación */
.trends-carousel-view .sidebar {
    background: rgba(17, 17, 17, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateX(0);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
}

.trends-carousel-view .sidebar:not(:hover) {
    transform: translateX(-180px);
    opacity: 0.4;
}

.trends-carousel-view .sidebar:hover {
    transform: translateX(0);
    opacity: 1;
}

/* Contenido ocupa todo el ancho cuando sidebar está oculto */
/* NOTE: con app shell flex, margin-left ya no aplica — el sidebar collapsed con
   translateX sigue ocupando 212px en el layout. Pendiente de revisión en Fase 2. */
.trends-carousel-view .main-content {
    transition: none;
}

/* Header también con blur y auto-ocultación */
.trends-carousel-view .trends-header-fixed {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.trends-carousel-view .trends-header-fixed:not(:hover) {
    transform: translateY(-100%);
    opacity: 0;
}

.trends-carousel-view .trends-header-fixed:hover {
    transform: translateY(0);
    opacity: 1;
}

/* Contenedor de videos a ancho completo */
.trends-carousel-view .trends-container {
    max-width: 100%;
    padding-left: 2rem;
    padding-right: 2rem;
}

.trends-carousel-view .rows-container {
    max-width: 100%;
}

/* ============================================
   APP SHELL - RESPONSIVE BREAKPOINTS
   ============================================ */

/* Sidebar compacto en pantallas pequeñas */
@media (max-height: 768px) {
    .sidebar .nav-item {
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }
    .sidebar .sidebar-footer {
        padding-bottom: 0.25rem;
    }
    .sidebar .sidebar-logo {
        margin-bottom: 0.25rem;
    }
    .main-content {
        height: calc(100vh - 12px);
        margin: 6px 6px 6px 0;
        border-radius: 10px;
    }
}

/* Windows con escalado 125% (1536×864) */
@media (min-width: 1537px) and (max-width: 1919px) {
    .app-container:not(body.fullwidth-page .app-container) {
        max-width: 1400px;
    }
}

/* Monitores QHD (2560×1440) */
@media (min-width: 2560px) {
    .main-content {
        margin: 12px 12px 12px 0;
        height: calc(100vh - 24px);
        border-radius: 14px;
    }
    .app-container:not(body.fullwidth-page .app-container) {
        max-width: 1600px;
    }
}

/* Ultrawide (3440×1440+) */
@media (min-width: 3000px) {
    .app-container:not(body.fullwidth-page .app-container) {
        max-width: 1800px;
    }
}

/* 4K (3840×2160) */
@media (min-width: 3840px) {
    .main-content {
        margin: 16px 16px 16px 0;
        height: calc(100vh - 32px);
        border-radius: 16px;
    }
    .app-container:not(body.fullwidth-page .app-container) {
        max-width: 2000px;
    }
}

/* Páginas fullwidth: ocupan TODO el ancho sin importar pantalla */
body.fullwidth-page .app-container {
    max-width: 100% !important;
    padding: 0 !important;
    width: 100% !important;
}

/* Icono fuego de Tendencias — gradiente amarillo→rojo ascendente */
.trend-fire-icon {
    color: var(--color-brand) !important;
    -webkit-text-fill-color: var(--color-brand) !important;
}

.btn-pepitas i {
    color: #10b981 !important;
}

/* Impresión — restaurar layout normal */
@media print {
    html, body {
        height: auto !important;
        overflow: visible !important;
    }
    .app-wrapper {
        height: auto !important;
        overflow: visible !important;
    }
    .sidebar {
        display: none !important;
    }
    .main-content {
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border: none !important;
    }
}







/* Badge NEW del menú lateral (Radar de Nichos y futuros estrenos) */
.nav-badge-new {
    margin-left: auto;
    background: linear-gradient(135deg, #fbbf24, #f97316);
    color: #1a1200;
    font-size: 0.62rem;
    font-weight: 800;
    font-style: italic;
    letter-spacing: 0.5px;
    padding: 2px 8px 2px 7px;
    border-radius: 6px;
    transform: skewX(-8deg) rotate(-3deg);
    box-shadow: 0 2px 8px rgba(249,115,22,0.35);
    line-height: 1.4;
    flex-shrink: 0;
}

/* Variante "próximamente" del badge del menú (texto largo, letra menor) */
.nav-badge-open { background: linear-gradient(135deg, #10b981, #22c55e); color: #052e16; box-shadow: 0 2px 8px rgba(34,197,94,.45); animation: navOpenPulse 2s ease-in-out infinite; }
@keyframes navOpenPulse { 0%,100% { box-shadow: 0 2px 8px rgba(34,197,94,.4); } 50% { box-shadow: 0 2px 16px rgba(34,197,94,.85); } }
/* "Miniaturas Studio" + PRÓXIMAMENTE no caben en los 240px del sidebar, y el
   sidebar recorta (overflow:hidden), asi que subir el z-index no sirve de nada:
   lo que se sale se corta igual. La solucion es que el badge ceda espacio antes
   que el texto — se le quita el margin-left:auto y se le deja encoger. */
.nav-item:has(.nav-badge-soon) { gap: 0.35rem; }
.nav-item:has(.nav-badge-soon) > span:not([class]) {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-badge-soon {
    margin-left: 0;
    flex-shrink: 1;
    min-width: 0;
    font-size: 0.52rem;
    letter-spacing: 0.3px;
    padding: 2px 6px;
    background: linear-gradient(135deg, #64748b, #475569);
    color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(71, 85, 105, 0.35);
}
