/* ==========================================================================
   UIXTRA DESIGN SYSTEM v3.0 (Premium Engine)
   Theme: Deep Space Slate & Reactive Glass
   ========================================================================== */

:root {
    /* Palette Core */
    --bg-app: #0f172a;       /* Slate 950 */
    --bg-panel: #1e293b;     /* Slate 800 */
    --border-subtle: #334155;/* Slate 700 */
    --border-active: #475569;/* Slate 600 */
    
    /* Brand Accents */
    --brand-primary: #0ea5e9; /* Sky 500 */
    --brand-glow: rgba(14, 165, 233, 0.25);
    
    /* Status Colors */
    --status-premium: #f59e0b; /* Amber 500 */
    --status-free: #10b981;    /* Emerald 500 */

    /* Typography */
    --font-ui: 'Inter', system-ui, sans-serif;
    --font-code: 'JetBrains Mono', monospace;
}

/* 1. GLOBAL RESET & SCROLLBARS (The "Editor" Feel)
   ========================================================================== */
html, body {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-app);
    /* Fondo sutil degradado para profundidad */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(14, 165, 233, 0.05), transparent 25%), 
        radial-gradient(circle at 85% 30%, rgba(168, 85, 247, 0.05), transparent 25%);
    background-attachment: fixed;
}

/* Scrollbar estilo MacOS / VS Code */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 99px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
    background-color: #475569;
}

/* 2. SIDEBAR NAVIGATION (Collapsible Logic)
   ========================================================================== */
details > summary {
    list-style: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Eliminar triángulo default */
details > summary::-webkit-details-marker { display: none; }

/* Efecto de selección en enlaces */
.comp-link {
    position: relative;
    border-left: 2px solid transparent;
}

.comp-link:hover {
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 0%, transparent 100%);
    color: #f1f5f9;
}

.comp-link.active {
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.1) 0%, transparent 100%);
    border-left-color: var(--brand-primary);
    color: var(--brand-primary);
    font-weight: 500;
}

/* 3. COMPONENT CARDS (Glass & Lift)
   ========================================================================== */
.comp-card {
    background: rgba(30, 41, 59, 0.4); /* Glass Effect */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    /* Optimización de renderizado */
    will-change: transform, box-shadow; 
}

.comp-card:hover {
    transform: translateY(-6px);
    border-color: rgba(14, 165, 233, 0.3); /* Brand border on hover */
    box-shadow: 
        0 20px 40px -10px rgba(0, 0, 0, 0.5),
        0 0 20px -5px var(--brand-glow);
}

/* Imagen y Overlay */
.card-media {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #020617;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.comp-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s;
}

.comp-card:hover .comp-card-img {
    transform: scale(1.08);
    opacity: 1;
}

/* Badges (Pills) */
.type-pill {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 0.05em;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    border-width: 1px;
    z-index: 10;
}

/* Content Text */
.card-content {
    padding: 1.25rem;
}
.card-cat {
    display: block;
    font-family: var(--font-code);
    font-size: 0.7rem;
    color: var(--brand-primary);
    margin-bottom: 0.35rem;
    letter-spacing: 0.02em;
}

/* 4. WORKBENCH / STAGE (Canvas de Diseño)
   ========================================================================== */
/* Botones de resolución */
.res-btn {
    position: relative;
    opacity: 0.6;
    transition: all 0.2s;
}
.res-btn:hover { opacity: 1; background: rgba(255,255,255,0.1); }
.res-btn.active { opacity: 1; color: white; background: rgba(255,255,255,0.15); }

/* Canvas de previsualización */
#stage {
    /* Patrón de puntos "Blueprint" */
    background-image: 
        radial-gradient(#334155 1px, transparent 1px);
    background-size: 20px 20px;
    background-color: transparent;
    
    /* Transiciones suaves al cambiar tamaño */
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    margin: 0 auto; /* Centrado */
    box-shadow: 0 0 0 1px rgba(255,255,255,0.05), 0 20px 50px -20px rgba(0,0,0,0.5);
}

/* Tabs de Información */
.tab-trigger {
    position: relative;
    transition: color 0.2s;
}
.tab-trigger::after {
    content: '';
    position: absolute;
    bottom: -1px; /* Pegado a la línea base */
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--brand-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}
.tab-trigger.active::after {
    transform: scaleX(1);
}

/* 5. PRISM JS OVERRIDES (Code Editor Look)
   ========================================================================== */
/* Contenedor del código */
pre[class*="language-"] {
    margin: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    text-shadow: none !important;
    font-family: var(--font-code) !important;
    font-size: 0.8rem !important;
    line-height: 1.6 !important;
    padding: 1.5rem !important;
}

/* Tokens de color (Ajuste para tema Dark Slate) */
code[class*="language-"], 
pre[class*="language-"] {
    color: #e2e8f0 !important;
}
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #64748b !important; font-style: italic; }
.token.punctuation { color: #94a3b8 !important; }
.token.property, .token.tag, .token.constant, .token.symbol, .token.deleted { color: #f472b6 !important; /* Pink */ }
.token.boolean, .token.number { color: #c084fc !important; /* Purple */ }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #2dd4bf !important; /* Teal */ }
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: #e2e8f0 !important; }
.token.atrule, .token.attr-value, .token.keyword { color: #38bdf8 !important; /* Sky */ }
.token.function, .token.class-name { color: #818cf8 !important; /* Indigo */ }

/* 6. ANIMATIONS & UTILS
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.fade-in {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Loader Skeleton Shimmer */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* Clase para el contenedor de código bloqueado (Glass + Blur) */
.locked-code-blur {
    filter: blur(8px);
    opacity: 0.4;
    user-select: none;
    pointer-events: none;
    transition: all 0.5s ease;
}