/**
 * 3D Print Edumedia - Custom Styles
 * Complementary styles for Tailwind CSS
 */

/* ============================================
   Alpine.js Cloak (ocultar elementos antes de inicializar)
   ============================================ */
[x-cloak] { 
    display: none !important; 
}

/* ============================================
   CSS Variables (Theme)
   ============================================ */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e1e2e;
    --darker: #11111b;
    --light: #f8fafc;
    
    /* Colores de filamento 3D */
    --filament-pla-white: #f8fafc;
    --filament-pla-black: #1e1e2e;
    --filament-petg-blue: #0ea5e9;
    --filament-abs-red: #ef4444;
    --filament-nylon-silver: #94a3b8;
    --filament-tpu-neon: #22d3ee;
    --filament-silk-gold: #fbbf24;
    --filament-glow-green: #4ade80;
    
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-dark: linear-gradient(135deg, var(--dark) 0%, var(--darker) 100%);
    
    /* Gradiente proceso de impresión */
    --gradient-print: linear-gradient(180deg, var(--filament-petg-blue) 0%, var(--primary) 50%, var(--secondary) 100%);
    --gradient-layers: repeating-linear-gradient(180deg, transparent 0px, transparent 3px, rgba(99, 102, 241, 0.08) 3px, rgba(99, 102, 241, 0.08) 4px);
    
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-print: 0 4px 20px rgba(99, 102, 241, 0.2), 0 0 0 1px rgba(99, 102, 241, 0.1);
    
    /* Scrollbars (tema oscuro por defecto) */
    --scrollbar-track: rgba(255, 255, 255, 0.04);
    --scrollbar-thumb: rgba(99, 102, 241, 0.35);
    --scrollbar-thumb-hover: rgba(99, 102, 241, 0.55);
    --scrollbar-size: 8px;
}

/* Tema claro: colores de scrollbar */
[data-theme="light"] {
    --scrollbar-track: rgba(0, 0, 0, 0.04);
    --scrollbar-thumb: rgba(99, 102, 241, 0.35);
    --scrollbar-thumb-hover: rgba(99, 102, 241, 0.55);
}

/* ============================================
   Scrollbars globales (todo el sitio)
   ============================================ */
/* WebKit (Chrome, Safari, Edge) */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
    width: var(--scrollbar-size);
    height: var(--scrollbar-size);
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
*::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: calc(var(--scrollbar-size) / 2);
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: calc(var(--scrollbar-size) / 2);
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

html::-webkit-scrollbar-corner {
    background: var(--scrollbar-track);
}

/* Firefox (heredado en contenedores con overflow) */
html,
body {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* ============================================
   3D Background Container
   ============================================ */
.bg-3d-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.7;
}

.bg-3d-container canvas {
    display: block;
}

/* Reducir opacidad en tema claro */
[data-theme="light"] .bg-3d-container {
    opacity: 0.4;
}

/* Desactivar en dispositivos con reduced motion */
@media (prefers-reduced-motion: reduce) {
    .bg-3d-container {
        display: none;
    }
}

/* ============================================
   Infill Patterns - Patrones de relleno 3D
   ============================================ */

/* Patrón Honeycomb (panal de abeja) */
.infill-honeycomb {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%236366f1' fill-opacity='0.06'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Patrón Grid (rejilla) */
.infill-grid {
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Patrón Grid fino */
.infill-grid-fine {
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 10px 10px;
}

/* Patrón Lines (líneas horizontales tipo capas) */
.infill-lines {
    background-image: repeating-linear-gradient(
        180deg,
        transparent,
        transparent 3px,
        rgba(99, 102, 241, 0.04) 3px,
        rgba(99, 102, 241, 0.04) 4px
    );
}

/* Patrón Zigzag */
.infill-zigzag {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='12' viewBox='0 0 40 12'%3E%3Cpath fill='%236366f1' fill-opacity='0.05' d='M0 6l5-6h5l-5 6 5 6H5L0 6zm10 0l5-6h5l-5 6 5 6h-5l-5-6zm10 0l5-6h5l-5 6 5 6h-5l-5-6zm10 0l5-6h5l-5 6 5 6h-5l-5-6z'/%3E%3C/svg%3E");
}

/* Patrón Triangular */
.infill-triangular {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Cpath fill='%236366f1' fill-opacity='0.04' d='M36 0H0v36h36V0zM18 9l9 18H9l9-18z'/%3E%3C/svg%3E");
}

/* Patrón Gyroid (aproximación 2D) */
.infill-gyroid {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%236366f1' stroke-width='0.5' stroke-opacity='0.08'%3E%3Cpath d='M30 0c0 11 11 19 11 30s-11 19-11 30'/%3E%3Cpath d='M30 0c0 11-11 19-11 30s11 19 11 30'/%3E%3Cpath d='M0 30c11 0 19 11 30 11s19-11 30-11'/%3E%3Cpath d='M0 30c11 0 19-11 30-11s19 11 30 11'/%3E%3C/g%3E%3C/svg%3E");
}

/* Patrón Dots (puntos - simula relleno de bajo porcentaje) */
.infill-dots {
    background-image: radial-gradient(rgba(99, 102, 241, 0.1) 1px, transparent 1px);
    background-size: 16px 16px;
}

/* Patrón Concentric (círculos concéntricos) */
.infill-concentric {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='18' fill='none' stroke='%236366f1' stroke-width='0.5' stroke-opacity='0.06'/%3E%3Ccircle cx='20' cy='20' r='12' fill='none' stroke='%236366f1' stroke-width='0.5' stroke-opacity='0.06'/%3E%3Ccircle cx='20' cy='20' r='6' fill='none' stroke='%236366f1' stroke-width='0.5' stroke-opacity='0.06'/%3E%3C/svg%3E");
}

/* Patrón Cross (cruz/X) */
.infill-cross {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath fill='%236366f1' fill-opacity='0.05' d='M0 0h10v10H0V0zm10 10h10v10H10V10z'/%3E%3C/svg%3E");
}

/* Variantes para tema claro */
[data-theme="light"] .infill-honeycomb {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%234f46e5' fill-opacity='0.04'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9zM0 15l12.98-7.5V0h-2v6.35L0 12.69v2.3zm0 18.5L12.98 41v8h-2v-6.85L0 35.81v-2.3zM15 0v7.5L27.99 15H28v-2.31h-.01L17 6.35V0h-2zm0 49v-8l12.99-7.5H28v2.31h-.01L17 42.15V49h-2z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

[data-theme="light"] .infill-grid {
    background-image: 
        linear-gradient(rgba(79, 70, 229, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 70, 229, 0.04) 1px, transparent 1px);
}

[data-theme="light"] .infill-lines {
    background-image: repeating-linear-gradient(
        180deg,
        transparent,
        transparent 3px,
        rgba(79, 70, 229, 0.03) 3px,
        rgba(79, 70, 229, 0.03) 4px
    );
}

[data-theme="light"] .infill-dots {
    background-image: radial-gradient(rgba(79, 70, 229, 0.08) 1px, transparent 1px);
}

/* Clases de utilidad para aplicar infill */
.infill-subtle { opacity: 0.5; }
.infill-medium { opacity: 0.7; }
.infill-strong { opacity: 1; }

/* Infill animado (para elementos destacados) */
.infill-animated {
    animation: infillShift 20s linear infinite;
}

@keyframes infillShift {
    0% { background-position: 0 0; }
    100% { background-position: 100px 100px; }
}

/* ============================================
   Decorative Elements - Elementos decorativos
   ============================================ */

/* Separador con patrón de capas */
.separator-layers {
    height: 4px;
    background: var(--gradient-layers);
    border-radius: 2px;
    margin: 2rem 0;
}

/* Separador con efecto de extrusión */
.separator-extrusion {
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--primary) 20%, 
        var(--secondary) 50%, 
        var(--primary) 80%, 
        transparent 100%
    );
    position: relative;
}

.separator-extrusion::after {
    content: '';
    position: absolute;
    top: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
}

/* Badge de filamento */
.filament-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.filament-badge.pla { background: rgba(99, 102, 241, 0.15); color: var(--primary-light); }
.filament-badge.petg { background: rgba(14, 165, 233, 0.15); color: var(--filament-petg-blue); }
.filament-badge.abs { background: rgba(239, 68, 68, 0.15); color: var(--filament-abs-red); }
.filament-badge.tpu { background: rgba(34, 211, 238, 0.15); color: var(--filament-tpu-neon); }
.filament-badge.nylon { background: rgba(148, 163, 184, 0.15); color: var(--filament-nylon-silver); }

/* Indicador de estado de impresión */
.print-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.print-status.printing {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
}

.print-status.printing::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

.print-status.completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.print-status.completed::before {
    content: '✓';
    font-weight: bold;
}

.print-status.paused {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.print-status.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Tarjeta de modelo 3D */
.model-card {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.model-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--infill-grid);
    opacity: 0.5;
    pointer-events: none;
}

.model-card .preview {
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, var(--dark) 0%, var(--darker) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.model-card .info {
    padding: 1rem;
}

/* ============================================
   Base Styles
   ============================================ */
html {
    scroll-behavior: smooth;
}

/* Transición animada al cambiar tema */
html.theme-transition,
html.theme-transition body {
    transition: background 0.4s ease, color 0.35s ease;
}
html.theme-transition .glass-dark,
html.theme-transition .sidebar,
html.theme-transition .sidebar-link,
html.theme-transition .dashboard-card,
html.theme-transition .content-wrapper,
html.theme-transition .input-field,
html.theme-transition header,
html.theme-transition footer {
    transition: background 0.4s ease, border-color 0.35s ease, color 0.35s ease;
}

/* Logo del header: animación entrada/salida al cambiar tema */
#header-logo {
    transform-origin: center center;
    display: block;
}

/* Logo 3D Text Effect */
.logo-3d-text {
    display: flex;
    align-items: center;
    text-decoration: none;
    perspective: 500px;
}

.logo-3d-main {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #22d3ee 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    position: relative;
    display: inline-block;
    transform-style: preserve-3d;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sombra 3D simulada con pseudo-elementos */
.logo-3d-main::before {
    content: attr(data-text);
    position: absolute;
    left: 2px;
    top: 2px;
    z-index: -1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: blur(2px);
}

.logo-3d-main::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(129, 140, 248, 0.5) 50%, transparent 100%);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease, width 0.3s ease;
}

.logo-3d-text:hover .logo-3d-main {
    transform: translateY(-2px) rotateX(10deg);
    filter: drop-shadow(0 8px 20px rgba(99, 102, 241, 0.4));
}

.logo-3d-text:hover .logo-3d-main::after {
    opacity: 1;
    width: 100%;
}

/* Efecto de brillo animado */
@keyframes logoShine {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.logo-3d-main {
    background-size: 200% auto;
    animation: logoShine 4s linear infinite;
}

/* Tema claro */
[data-theme="light"] .logo-3d-main {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #0891b2 100%);
    background-clip: text;
    -webkit-background-clip: text;
    background-size: 200% auto;
}

[data-theme="light"] .logo-3d-main::before {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.2) 0%, rgba(124, 58, 237, 0.2) 100%);
    background-clip: text;
    -webkit-background-clip: text;
}

html {
    background: var(--gradient-dark);
}

body {
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
    background: transparent;
    min-height: 100vh;
    position: relative;
}

/* Tema claro: sobrescribe variables y estilos */
[data-theme="light"] {
    --bg-page: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    --bg-dark: #f8fafc;
    --bg-darker: #f1f5f9;
    --text-primary: #1e293b;
    --text-muted: #64748b;
    --border-color: rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --sidebar-bg: rgba(248, 250, 252, 0.95);
    --card-bg: rgba(255, 255, 255, 0.9);
    --input-bg: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] {
    background: var(--bg-page);
}

[data-theme="light"] body {
    background: transparent;
    color: var(--text-primary);
}

[data-theme="light"] .glass-dark {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

[data-theme="light"] .sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
}

[data-theme="light"] .sidebar-link {
    color: var(--text-muted);
}

[data-theme="light"] .sidebar-link:hover,
[data-theme="light"] .sidebar-link.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

[data-theme="light"] .dashboard-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

[data-theme="light"] .dashboard-card:hover {
    border-color: var(--primary);
}

[data-theme="light"] .input-field {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

[data-theme="light"] .input-field::placeholder {
    color: var(--text-muted);
}

[data-theme="light"] .content-wrapper {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

[data-theme="light"] .lang-btn {
    color: var(--text-muted);
}

[data-theme="light"] .lang-btn.active {
    background: var(--primary);
    color: white;
}

[data-theme="light"] .lang-btn:hover {
    color: var(--text-primary);
}

[data-theme="light"] .btn-secondary {
    color: var(--primary);
    border-color: var(--primary);
}

[data-theme="light"] .btn-secondary:hover {
    background: var(--primary);
    color: white;
}

[data-theme="light"] header span,
[data-theme="light"] header button,
[data-theme="light"] header a,
[data-theme="light"] .theme-toggle {
    color: var(--text-primary) !important;
}

/* Menú desplegable del usuario en tema claro */
[data-theme="light"] header .glass-dark {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
}
[data-theme="light"] header .glass-dark a:not([class*="red"]) {
    color: var(--text-primary) !important;
}
[data-theme="light"] header .glass-dark a:not([class*="red"]):hover {
    background: rgba(99, 102, 241, 0.1) !important;
    color: var(--primary) !important;
}

[data-theme="light"] footer {
    color: var(--text-muted);
    border-color: var(--border-color);
}

[data-theme="light"] footer a {
    color: var(--primary);
}

/* Markdown en tema claro */
[data-theme="light"] .markdown-content {
    color: var(--text-primary);
}

[data-theme="light"] .markdown-content h1,
[data-theme="light"] .markdown-content h2,
[data-theme="light"] .markdown-content h3 {
    color: var(--text-primary);
}

[data-theme="light"] .markdown-content code {
    background: var(--input-bg);
}

[data-theme="light"] .markdown-content pre {
    background: var(--bg-darker);
}

[data-theme="light"] .markdown-content th,
[data-theme="light"] .markdown-content td {
    border-color: var(--border-color);
}

[data-theme="light"] .markdown-content th {
    background: rgba(99, 102, 241, 0.1);
}

/* Títulos y texto en main (perfil, dashboard, etc.) */
[data-theme="light"] main h1,
[data-theme="light"] main h2,
[data-theme="light"] main h3 {
    color: var(--text-primary) !important;
}

[data-theme="light"] main label {
    color: var(--text-muted) !important;
}

/* Perfil / formularios / dashboard: textos que en oscuro son text-white/xx */
[data-theme="light"] main [class*="text-white/90"] {
    color: var(--text-primary) !important;
}
[data-theme="light"] main [class*="text-white/80"] {
    color: var(--text-primary) !important;
}
[data-theme="light"] main [class*="text-white/70"] {
    color: var(--text-muted) !important;
}
[data-theme="light"] main [class*="text-white/60"] {
    color: var(--text-muted) !important;
}
[data-theme="light"] main [class*="text-white/50"] {
    color: var(--text-muted) !important;
}
[data-theme="light"] main [class*="text-white/40"] {
    color: var(--text-muted) !important;
}
[data-theme="light"] main [class*="text-white/30"] {
    color: var(--text-muted) !important;
    opacity: 0.85;
}
[data-theme="light"] main [class*="text-white/20"] {
    color: var(--text-muted) !important;
    opacity: 0.7;
}
[data-theme="light"] main .text-white {
    color: var(--text-primary) !important;
}

/* Badges y chips dentro de cards (ej. "Próximamente") */
[data-theme="light"] main .bg-white\/10 {
    background: rgba(0, 0, 0, 0.06) !important;
}
[data-theme="light"] main .bg-white\/10.text-white\/60,
[data-theme="light"] main .bg-white\/10 + span,
[data-theme="light"] main [class*="bg-white/10"] [class*="text-white/60"] {
    color: var(--text-muted) !important;
}

/* Sidebar: texto "CONTENIDO" y similares */
[data-theme="light"] .sidebar .text-white\/40 {
    color: var(--text-muted) !important;
}


/* ============================================
   3D Card Effect
   ============================================ */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.card-3d:hover {
    transform: translateY(-10px) rotateX(5deg);
    box-shadow: var(--shadow-glow);
}

/* ============================================
   Glassmorphism
   ============================================ */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-dark {
    background: rgba(17, 17, 27, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ============================================
   Buttons
   ============================================ */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-light);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid var(--primary);
    cursor: pointer;
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
}

/* ============================================
   Form Inputs
   ============================================ */
.input-field {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: white;
    width: 100%;
    transition: all 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.input-field::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   Sidebar Prisma 3D
   ============================================ */

/* Contenedor con perspectiva */
.sidebar-perspective {
    perspective: 800px;
    perspective-origin: 0% 50%;
    padding: 1rem;
    padding-top: 1.5rem;
}

/* Contenedor del prisma con transformación 3D */
.sidebar-prism {
    position: relative;
    transform-style: preserve-3d;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    /* Rotación Y para crear efecto de profundidad */
    transform: rotateY(-8deg) rotateX(2deg);
}

/* Estados expandido/colapsado */
.sidebar-expanded .sidebar-prism {
    width: 280px;
}

.sidebar-collapsed .sidebar-prism {
    width: 80px;
}

/* Cara frontal del prisma */
.sidebar-face {
    backface-visibility: hidden;
}

.sidebar-front {
    position: relative;
    width: 100%;
    min-height: 340px;
    background: linear-gradient(135deg, 
        rgba(30, 30, 46, 0.98) 0%, 
        rgba(24, 24, 38, 0.98) 50%,
        rgba(17, 17, 27, 0.98) 100%
    );
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 1rem;
    box-shadow: 
        /* Sombra principal de profundidad */
        20px 20px 60px rgba(0, 0, 0, 0.5),
        10px 10px 30px rgba(0, 0, 0, 0.3),
        /* Brillo superior izquierdo */
        inset 2px 2px 4px rgba(255, 255, 255, 0.1),
        inset -1px -1px 3px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

/* Grid decorativo en la cara frontal */
.sidebar-front::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        repeating-linear-gradient(
            180deg,
            transparent 0px,
            transparent 28px,
            rgba(99, 102, 241, 0.04) 28px,
            rgba(99, 102, 241, 0.04) 29px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 45px,
            rgba(99, 102, 241, 0.03) 45px,
            rgba(99, 102, 241, 0.03) 46px
        );
    pointer-events: none;
    border-radius: inherit;
}

/* Borde luminoso superior */
.sidebar-front::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 20%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0.3) 80%,
        transparent 100%
    );
}

/* Cara lateral derecha (profundidad real) */
.sidebar-right {
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(90deg,
        rgba(20, 20, 32, 0.98) 0%,
        rgba(12, 12, 20, 0.98) 100%
    );
    transform: rotateY(90deg);
    transform-origin: right center;
    border-radius: 0 1rem 1rem 0;
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-left: none;
}

/* Patrón de líneas en cara lateral (como capas de impresión) */
.sidebar-right::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        180deg,
        transparent 0px,
        transparent 4px,
        rgba(99, 102, 241, 0.08) 4px,
        rgba(99, 102, 241, 0.08) 5px
    );
    border-radius: inherit;
}

/* Borde luminoso en cara lateral */
.sidebar-right::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg,
        rgba(99, 102, 241, 0.6) 0%,
        rgba(139, 92, 246, 0.4) 50%,
        rgba(99, 102, 241, 0.6) 100%
    );
}

/* Cara inferior (base del prisma) */
.sidebar-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: linear-gradient(180deg,
        rgba(15, 15, 24, 0.98) 0%,
        rgba(8, 8, 14, 0.98) 100%
    );
    transform: rotateX(-90deg);
    transform-origin: bottom center;
    border-radius: 0 0 1rem 1rem;
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-top: none;
}

/* Patrón de grid en cara inferior (como cama de impresión) */
.sidebar-bottom::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 15px,
            rgba(99, 102, 241, 0.1) 15px,
            rgba(99, 102, 241, 0.1) 16px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 15px,
            rgba(99, 102, 241, 0.1) 15px,
            rgba(99, 102, 241, 0.1) 16px
        );
    border-radius: inherit;
}

/* Botón toggle flotante */
.sidebar-toggle-btn {
    position: absolute;
    top: 50%;
    right: -22px;
    transform: translateY(-50%);
    width: 32px;
    height: 64px;
    background: linear-gradient(135deg, 
        #6366f1 0%, 
        #8b5cf6 100%
    );
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-left: none;
    border-radius: 0 1rem 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    box-shadow: 
        4px 4px 20px rgba(99, 102, 241, 0.5),
        0 0 30px rgba(139, 92, 246, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.sidebar-toggle-btn:hover {
    background: linear-gradient(135deg, 
        #818cf8 0%, 
        #a78bfa 100%
    );
    box-shadow: 
        6px 6px 30px rgba(99, 102, 241, 0.6),
        0 0 40px rgba(139, 92, 246, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: translateY(-50%) scale(1.05);
}

.sidebar-toggle-btn:active {
    transform: translateY(-50%) scale(0.98);
}

.sidebar-toggle-btn svg {
    color: white;
    width: 18px;
    height: 18px;
}

/* Enlaces del sidebar */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.25rem;
    color: rgba(255, 255, 255, 0.75);
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    white-space: nowrap;
    font-size: 0.9375rem;
}

.sidebar-icon {
    flex-shrink: 0;
    transition: all 0.3s ease;
    width: 22px;
    height: 22px;
}

.sidebar-label {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar-badge {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.7rem;
}

/* Estado colapsado - ocultar labels y badges */
.sidebar-collapsed .sidebar-label,
.sidebar-collapsed .sidebar-badge,
.sidebar-collapsed .sidebar-section-title {
    opacity: 0;
    width: 0;
    max-width: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 1rem;
    margin: 0.25rem 0.5rem;
}

.sidebar-collapsed .sidebar-icon {
    margin: 0;
    width: 24px;
    height: 24px;
}

.sidebar-collapsed .sidebar-front nav {
    padding: 0.75rem 0.25rem;
}

/* Efecto de brillo al hover */
.sidebar-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(99, 102, 241, 0.15) 50%, 
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.sidebar-link:hover::before {
    transform: translateX(100%);
}

.sidebar-link:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.2);
    color: white;
    box-shadow: 
        0 4px 15px rgba(99, 102, 241, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sidebar-link.active {
    background: linear-gradient(90deg, 
        rgba(99, 102, 241, 0.25) 0%, 
        rgba(139, 92, 246, 0.15) 100%
    );
    border-color: rgba(99, 102, 241, 0.3);
    color: white;
    border-left: 3px solid var(--primary);
    box-shadow: 
        0 4px 20px rgba(99, 102, 241, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sidebar-link.active .sidebar-icon {
    filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.6));
}

/* Título de sección */
.sidebar-section-title {
    overflow: hidden;
    transition: all 0.4s ease;
}

/* Sidebar móvil */
.sidebar-mobile {
    background: linear-gradient(180deg, 
        rgba(17, 17, 27, 0.98) 0%, 
        rgba(30, 30, 46, 0.98) 100%
    );
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Tema claro */
[data-theme="light"] .sidebar-front {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.98) 0%, 
        rgba(248, 250, 252, 0.98) 50%,
        rgba(241, 245, 249, 0.98) 100%
    );
    border-color: rgba(79, 70, 229, 0.2);
    box-shadow: 
        20px 20px 60px rgba(0, 0, 0, 0.15),
        10px 10px 30px rgba(0, 0, 0, 0.1),
        inset 2px 2px 4px rgba(255, 255, 255, 0.8),
        inset -1px -1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .sidebar-front::before {
    background: 
        repeating-linear-gradient(
            180deg,
            transparent 0px,
            transparent 28px,
            rgba(79, 70, 229, 0.03) 28px,
            rgba(79, 70, 229, 0.03) 29px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 45px,
            rgba(79, 70, 229, 0.02) 45px,
            rgba(79, 70, 229, 0.02) 46px
        );
}

[data-theme="light"] .sidebar-front::after {
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(79, 70, 229, 0.2) 20%,
        rgba(79, 70, 229, 0.3) 50%,
        rgba(79, 70, 229, 0.2) 80%,
        transparent 100%
    );
}

[data-theme="light"] .sidebar-right {
    background: linear-gradient(90deg,
        rgba(241, 245, 249, 0.98) 0%,
        rgba(226, 232, 240, 0.98) 100%
    );
}

[data-theme="light"] .sidebar-right::before {
    background: repeating-linear-gradient(
        180deg,
        transparent 0px,
        transparent 4px,
        rgba(79, 70, 229, 0.05) 4px,
        rgba(79, 70, 229, 0.05) 5px
    );
}

[data-theme="light"] .sidebar-right::after {
    background: linear-gradient(180deg,
        rgba(79, 70, 229, 0.4) 0%,
        rgba(139, 92, 246, 0.3) 50%,
        rgba(79, 70, 229, 0.4) 100%
    );
}

[data-theme="light"] .sidebar-bottom {
    background: linear-gradient(180deg,
        rgba(226, 232, 240, 0.98) 0%,
        rgba(203, 213, 225, 0.98) 100%
    );
}

[data-theme="light"] .sidebar-bottom::before {
    background: 
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            transparent 15px,
            rgba(79, 70, 229, 0.08) 15px,
            rgba(79, 70, 229, 0.08) 16px
        ),
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 15px,
            rgba(79, 70, 229, 0.08) 15px,
            rgba(79, 70, 229, 0.08) 16px
        );
}

[data-theme="light"] .sidebar-prism::before {
    background: rgba(203, 213, 225, 0.98);
}

[data-theme="light"] .sidebar-link {
    color: rgba(30, 41, 59, 0.75);
}

[data-theme="light"] .sidebar-link:hover {
    background: rgba(79, 70, 229, 0.1);
    border-color: rgba(79, 70, 229, 0.15);
    color: #1e293b;
}

[data-theme="light"] .sidebar-link.active {
    background: linear-gradient(90deg, 
        rgba(79, 70, 229, 0.15) 0%, 
        rgba(139, 92, 246, 0.1) 100%
    );
    border-color: rgba(79, 70, 229, 0.2);
    color: #1e293b;
}

/* Iconos del sidebar en tema claro */
[data-theme="light"] .sidebar-icon {
    color: #64748b;
}

[data-theme="light"] .sidebar-link:hover .sidebar-icon {
    color: #4f46e5;
}

[data-theme="light"] .sidebar-link.active .sidebar-icon {
    color: #4f46e5;
    filter: drop-shadow(0 0 4px rgba(79, 70, 229, 0.4));
}

/* Título de sección del sidebar en tema claro */
[data-theme="light"] .sidebar-section-title {
    color: #475569;
}

[data-theme="light"] .sidebar-section-title p,
[data-theme="light"] .sidebar-section-title span {
    color: #475569 !important;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    display: inline-block;
}

/* Badge "Próximamente" en tema claro */
[data-theme="light"] .sidebar-badge {
    background: rgba(100, 116, 139, 0.15);
    color: #64748b;
    border: 1px solid rgba(100, 116, 139, 0.2);
}

/* Textos del sidebar en tema claro */
[data-theme="light"] .sidebar-label {
    color: #475569;
}

[data-theme="light"] .sidebar-link:hover .sidebar-label {
    color: #1e293b;
}

[data-theme="light"] .sidebar-link.active .sidebar-label {
    color: #1e293b;
    font-weight: 600;
}

/* Botón toggle del sidebar en tema claro */
[data-theme="light"] .sidebar-toggle-btn {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-color: rgba(79, 70, 229, 0.3);
    box-shadow: 
        4px 4px 20px rgba(79, 70, 229, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

[data-theme="light"] .sidebar-toggle-btn:hover {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 
        6px 6px 30px rgba(79, 70, 229, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

[data-theme="light"] .sidebar-mobile {
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.98) 0%, 
        rgba(248, 250, 252, 0.98) 100%
    );
}

/* ============================================
   Floating Button - Toggle 3D Background
   ============================================ */
.floating-btn-3d {
    box-shadow: 
        0 4px 20px rgba(99, 102, 241, 0.4),
        0 0 40px rgba(99, 102, 241, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.floating-btn-3d:hover {
    box-shadow: 
        0 6px 30px rgba(99, 102, 241, 0.5),
        0 0 60px rgba(99, 102, 241, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.floating-btn-3d:active {
    transform: scale(0.95);
}

/* Estado apagado del botón */
.floating-btn-3d.bg-off {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.floating-btn-3d.bg-off:hover {
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Botón flotante: subir rápido (visible al hacer scroll) */
.scroll-to-top-btn {
    transition: opacity 0.25s ease, transform 0.2s ease;
}
.scroll-to-top-btn.scroll-to-top-visible {
    opacity: 1 !important;
    pointer-events: auto !important;
}
.scroll-to-top-btn:active {
    transform: scale(0.95);
}

/* ============================================
   Dashboard Cards
   ============================================ */
.dashboard-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Glass Card - Efecto cristal mejorado */
.glass-card {
    background: rgba(17, 17, 27, 0.6);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 4px 30px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.glass-card:hover {
    background: rgba(17, 17, 27, 0.7);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 
        0 8px 40px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(99, 102, 241, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Tema claro: glass-card */
[data-theme="light"] .glass-card {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 
        0 4px 30px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .glass-card:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(99, 102, 241, 0.3);
}

/* ============================================
   Tema claro: Propuestas didácticas
   ============================================ */

/* Contenedor glass-dark en tema claro */
[data-theme="light"] .glass-dark {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Textos blancos con opacidad -> oscuros */
[data-theme="light"] .glass-dark .text-white {
    color: #1e293b !important;
}

[data-theme="light"] .glass-dark .text-white\/90,
[data-theme="light"] .glass-dark [class*="text-white/90"] {
    color: #1e293b !important;
}

[data-theme="light"] .glass-dark .text-white\/80,
[data-theme="light"] .glass-dark [class*="text-white/80"] {
    color: #334155 !important;
}

[data-theme="light"] .glass-dark .text-white\/70,
[data-theme="light"] .glass-dark [class*="text-white/70"] {
    color: #475569 !important;
}

[data-theme="light"] .glass-dark .text-white\/60,
[data-theme="light"] .glass-dark [class*="text-white/60"] {
    color: #64748b !important;
}

[data-theme="light"] .glass-dark .text-white\/50,
[data-theme="light"] .glass-dark [class*="text-white/50"] {
    color: #64748b !important;
}

[data-theme="light"] .glass-dark .text-white\/40,
[data-theme="light"] .glass-dark [class*="text-white/40"] {
    color: #94a3b8 !important;
}

/* ============================================
   Navegación interna de propuestas (tema claro)
   ============================================ */

/* Contenedor de navegación */
[data-theme="light"] .glass-dark nav h3 {
    color: #475569 !important;
}

/* Links de navegación interna */
[data-theme="light"] .glass-dark .nav-interno {
    color: #475569 !important;
}

[data-theme="light"] .glass-dark .nav-interno:hover {
    background: rgba(99, 102, 241, 0.1) !important;
    color: #1e293b !important;
}

[data-theme="light"] .glass-dark .nav-interno.active {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.15) 100%) !important;
    color: #1e293b !important;
}

/* Etiquetas de texto en navegación */
[data-theme="light"] .glass-dark .nav-interno-label {
    color: #334155 !important;
}

[data-theme="light"] .glass-dark .nav-interno:hover .nav-interno-label {
    color: #1e293b !important;
}

[data-theme="light"] .glass-dark .nav-interno.active .nav-interno-label {
    color: #1e293b !important;
    font-weight: 600;
}

/* Iconos en la navegación interna - más visibles */
[data-theme="light"] .glass-dark .nav-interno span[class*="bg-"] {
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Colores de fondo de iconos más intensos */
[data-theme="light"] .glass-dark .nav-interno .bg-amber-500\/20 { 
    background: rgba(245, 158, 11, 0.2) !important; 
}
[data-theme="light"] .glass-dark .nav-interno .bg-emerald-500\/20 { 
    background: rgba(16, 185, 129, 0.2) !important; 
}
[data-theme="light"] .glass-dark .nav-interno .bg-indigo-500\/20 { 
    background: rgba(99, 102, 241, 0.2) !important; 
}
[data-theme="light"] .glass-dark .nav-interno .bg-cyan-500\/20 { 
    background: rgba(6, 182, 212, 0.2) !important; 
}
[data-theme="light"] .glass-dark .nav-interno .bg-violet-500\/20 { 
    background: rgba(139, 92, 246, 0.2) !important; 
}
[data-theme="light"] .glass-dark .nav-interno .bg-rose-500\/20 { 
    background: rgba(244, 63, 94, 0.2) !important; 
}
[data-theme="light"] .glass-dark .nav-interno .bg-teal-500\/20 { 
    background: rgba(20, 184, 166, 0.2) !important; 
}
[data-theme="light"] .glass-dark .nav-interno .bg-sky-500\/20 { 
    background: rgba(14, 165, 233, 0.2) !important; 
}
[data-theme="light"] .glass-dark .nav-interno .bg-purple-500\/20 { 
    background: rgba(168, 85, 247, 0.2) !important; 
}

/* Colores de iconos más saturados */
[data-theme="light"] .glass-dark .nav-interno .text-amber-400 { color: #d97706 !important; }
[data-theme="light"] .glass-dark .nav-interno .text-emerald-400 { color: #059669 !important; }
[data-theme="light"] .glass-dark .nav-interno .text-indigo-400 { color: #4f46e5 !important; }
[data-theme="light"] .glass-dark .nav-interno .text-cyan-400 { color: #0891b2 !important; }
[data-theme="light"] .glass-dark .nav-interno .text-violet-400 { color: #7c3aed !important; }
[data-theme="light"] .glass-dark .nav-interno .text-rose-400 { color: #e11d48 !important; }
[data-theme="light"] .glass-dark .nav-interno .text-teal-400 { color: #0d9488 !important; }
[data-theme="light"] .glass-dark .nav-interno .text-sky-400 { color: #0284c7 !important; }
[data-theme="light"] .glass-dark .nav-interno .text-purple-400 { color: #9333ea !important; }

/* Iconos coloreados: mantener pero con más saturación */
[data-theme="light"] .glass-dark .text-amber-400 { color: #d97706 !important; }
[data-theme="light"] .glass-dark .text-emerald-400 { color: #059669 !important; }
[data-theme="light"] .glass-dark .text-indigo-400 { color: #4f46e5 !important; }
[data-theme="light"] .glass-dark .text-cyan-400 { color: #0891b2 !important; }
[data-theme="light"] .glass-dark .text-violet-400 { color: #7c3aed !important; }
[data-theme="light"] .glass-dark .text-rose-400 { color: #e11d48 !important; }
[data-theme="light"] .glass-dark .text-teal-400 { color: #0d9488 !important; }
[data-theme="light"] .glass-dark .text-sky-400 { color: #0284c7 !important; }
[data-theme="light"] .glass-dark .text-purple-400 { color: #9333ea !important; }

/* Fondos de iconos con más contraste */
[data-theme="light"] .bg-amber-500\/20 { background: rgba(217, 119, 6, 0.15) !important; }
[data-theme="light"] .bg-emerald-500\/20 { background: rgba(5, 150, 105, 0.15) !important; }
[data-theme="light"] .bg-indigo-500\/20 { background: rgba(79, 70, 229, 0.15) !important; }
[data-theme="light"] .bg-cyan-500\/20 { background: rgba(8, 145, 178, 0.15) !important; }
[data-theme="light"] .bg-violet-500\/20 { background: rgba(124, 58, 237, 0.15) !important; }
[data-theme="light"] .bg-rose-500\/20 { background: rgba(225, 29, 72, 0.15) !important; }
[data-theme="light"] .bg-teal-500\/20 { background: rgba(13, 148, 136, 0.15) !important; }
[data-theme="light"] .bg-sky-500\/20 { background: rgba(2, 132, 199, 0.15) !important; }
[data-theme="light"] .bg-purple-500\/20 { background: rgba(147, 51, 234, 0.15) !important; }

/* Hero en tema claro */
[data-theme="light"] .propuesta-hero,
[data-theme="light"] .propuesta-fracciones .propuesta-hero,
[data-theme="light"] .propuesta-angulos .propuesta-hero {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

[data-theme="light"] .propuesta-hero .text-white {
    color: #1e293b !important;
}

[data-theme="light"] .propuesta-hero .text-white\/90 {
    color: #334155 !important;
}

[data-theme="light"] .propuesta-hero .text-white\/50 {
    color: #64748b !important;
}

/* Títulos de sección en propuestas */
[data-theme="light"] .glass-dark h2,
[data-theme="light"] .glass-dark h3,
[data-theme="light"] .glass-dark h4 {
    color: #1e293b;
}

/* Párrafos en propuestas */
[data-theme="light"] .glass-dark p {
    color: #475569;
}

/* Listas en propuestas */
[data-theme="light"] .glass-dark li {
    color: #475569;
}

/* Bordes laterales coloridos */
[data-theme="light"] .border-amber-500 { border-color: #d97706 !important; }
[data-theme="light"] .border-emerald-500 { border-color: #059669 !important; }
[data-theme="light"] .border-indigo-500 { border-color: #4f46e5 !important; }
[data-theme="light"] .border-cyan-500 { border-color: #0891b2 !important; }
[data-theme="light"] .border-violet-500 { border-color: #7c3aed !important; }
[data-theme="light"] .border-rose-500 { border-color: #e11d48 !important; }
[data-theme="light"] .border-teal-500 { border-color: #0d9488 !important; }
[data-theme="light"] .border-purple-500 { border-color: #9333ea !important; }

/* Badge/etiqueta de materia */
[data-theme="light"] .propuesta-hero .text-emerald-300 {
    color: #059669 !important;
}

[data-theme="light"] .propuesta-hero .text-amber-300 {
    color: #d97706 !important;
}

[data-theme="light"] .propuesta-hero .bg-emerald-500\/20,
[data-theme="light"] .propuesta-hero .bg-amber-500\/20 {
    background: rgba(5, 150, 105, 0.2) !important;
}

/* Galería de imágenes */
[data-theme="light"] .glass-dark img {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Botón hover en galería */
[data-theme="light"] .bg-white\/5:hover {
    background: rgba(99, 102, 241, 0.1) !important;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.dashboard-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-glow);
    border-color: var(--primary);
}

.dashboard-card:hover::before {
    transform: scaleX(1);
}

.dashboard-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dashboard-card.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ============================================
   Print Cards - Efecto Capas 3D
   ============================================ */
.print-card {
    position: relative;
    background: 
        var(--gradient-layers),
        rgba(255, 255, 255, 0.05);
    border-radius: 1rem !important;
    overflow: hidden;
}

/* Para print-card, el borde superior con gradiente aparece al hover */
.dashboard-card.print-card::before {
    top: auto;
    bottom: 0;
    height: 3px;
    border-radius: 0 0 1rem 1rem;
    transform: scaleX(1);
    opacity: 1;
}

/* Efecto glow en hover */
.print-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        to top,
        rgba(99, 102, 241, 0.08) 0%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    border-radius: inherit;
    z-index: 0;
}

.print-card:hover::after {
    opacity: 1;
}

/* Efecto wireframe en hover */
.print-card .wireframe-overlay {
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    border-radius: inherit;
}

.print-card:hover .wireframe-overlay {
    opacity: 1;
}

/* Layer effect - líneas horizontales tipo impresión */
.layer-effect {
    position: relative;
}

.layer-effect::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        180deg,
        transparent 0px,
        transparent 2px,
        rgba(255, 255, 255, 0.02) 2px,
        rgba(255, 255, 255, 0.02) 4px
    );
    pointer-events: none;
    border-radius: inherit;
}

/* Animación de construcción capa por capa */
.build-animation {
    animation: buildLayers 0.8s ease-out forwards;
}

@keyframes buildLayers {
    0% {
        clip-path: inset(100% 0 0 0);
        opacity: 0;
    }
    100% {
        clip-path: inset(0);
        opacity: 1;
    }
}

/* Card con efecto de objeto impreso (elevación 3D) */
.printed-object {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.printed-object:hover {
    transform: translateY(-8px) rotateX(2deg) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(99, 102, 241, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Efecto de nozzle/extrusor animado en hover */
.print-card .nozzle-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0;
    box-shadow: 0 0 10px var(--accent);
    transition: opacity 0.3s ease;
}

.print-card:hover .nozzle-indicator {
    opacity: 1;
    animation: nozzleMove 2s linear infinite;
}

@keyframes nozzleMove {
    0% { left: 0; top: 0; }
    25% { left: calc(100% - 8px); top: 0; }
    50% { left: calc(100% - 8px); top: 4px; }
    75% { left: 0; top: 4px; }
    100% { left: 0; top: 8px; }
}

/* Tema claro: ajustes para print-card */
[data-theme="light"] .print-card {
    background: 
        repeating-linear-gradient(180deg, transparent 0px, transparent 3px, rgba(99, 102, 241, 0.04) 3px, rgba(99, 102, 241, 0.04) 4px),
        rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .print-card:hover::after {
    background: linear-gradient(
        to top,
        rgba(99, 102, 241, 0.08) 0%,
        transparent 30%
    );
}

[data-theme="light"] .layer-effect::before {
    background: repeating-linear-gradient(
        180deg,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.02) 2px,
        rgba(0, 0, 0, 0.02) 4px
    );
}

/* ============================================
   Content Area
   ============================================ */
.content-wrapper {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 1rem;
    padding: 2rem;
}

/* Markdown Content Styles */
.markdown-content {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
}

.markdown-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
}

.markdown-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--primary-light);
}

.markdown-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: white;
}

.markdown-content p {
    margin-bottom: 1rem;
}

.markdown-content ul,
.markdown-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.markdown-content li {
    margin-bottom: 0.5rem;
}

.markdown-content img {
    max-width: 100%;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.markdown-content a {
    color: var(--accent);
    text-decoration: underline;
}

.markdown-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: monospace;
}

.markdown-content pre {
    background: var(--darker);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
}

.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.markdown-content th,
.markdown-content td {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem;
    text-align: left;
}

.markdown-content th {
    background: rgba(99, 102, 241, 0.2);
}

/* ============================================
   Loading Spinner
   ============================================ */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
}

/* ============================================
   Print Loader - Cubo imprimiéndose
   ============================================ */
.print-loader {
    position: relative;
    width: 60px;
    height: 60px;
    perspective: 200px;
}

/* Base de la impresora (cama) */
.print-loader::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) rotateX(60deg);
    width: 50px;
    height: 50px;
    background: 
        linear-gradient(90deg, rgba(99, 102, 241, 0.2) 1px, transparent 1px),
        linear-gradient(rgba(99, 102, 241, 0.2) 1px, transparent 1px);
    background-size: 5px 5px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 2px;
}

/* Cubo que se imprime */
.print-loader .cube {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 0;
    background: linear-gradient(180deg, 
        var(--primary) 0%, 
        var(--secondary) 100%
    );
    border-radius: 2px;
    animation: printCube 2s ease-out infinite;
    box-shadow: 
        0 0 10px rgba(99, 102, 241, 0.5),
        inset 0 0 5px rgba(255, 255, 255, 0.2);
}

/* Nozzle/Extrusor */
.print-loader .nozzle {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 16px;
    background: linear-gradient(180deg, #64748b 0%, #475569 100%);
    clip-path: polygon(20% 0%, 80% 0%, 100% 60%, 70% 100%, 30% 100%, 0% 60%);
    animation: nozzleFloat 2s ease-in-out infinite;
}

/* Gota de filamento */
.print-loader .nozzle::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
    animation: filamentDrop 0.5s ease-in-out infinite;
}

@keyframes printCube {
    0% {
        height: 0;
        opacity: 0.5;
    }
    10% {
        opacity: 1;
    }
    80% {
        height: 28px;
    }
    100% {
        height: 28px;
        opacity: 0;
    }
}

@keyframes nozzleFloat {
    0%, 100% {
        top: 5px;
    }
    80% {
        top: 20px;
    }
}

@keyframes filamentDrop {
    0%, 100% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translateX(-50%) scale(0.8);
    }
}

/* Loader alternativo: Capas apilándose */
.layer-loader {
    position: relative;
    width: 40px;
    height: 40px;
}

.layer-loader span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--gradient-primary);
    border-radius: 2px;
    animation: stackLayers 1.5s ease-in-out infinite;
}

.layer-loader span:nth-child(1) { bottom: 0; animation-delay: 0s; }
.layer-loader span:nth-child(2) { bottom: 8px; animation-delay: 0.15s; }
.layer-loader span:nth-child(3) { bottom: 16px; animation-delay: 0.3s; }
.layer-loader span:nth-child(4) { bottom: 24px; animation-delay: 0.45s; }
.layer-loader span:nth-child(5) { bottom: 32px; animation-delay: 0.6s; }

@keyframes stackLayers {
    0% {
        transform: scaleX(0);
        opacity: 0;
    }
    20% {
        transform: scaleX(1);
        opacity: 1;
    }
    80% {
        transform: scaleX(1);
        opacity: 1;
    }
    100% {
        transform: scaleX(0);
        opacity: 0;
    }
}

/* Loader de extrusor moviéndose */
.extruder-loader {
    position: relative;
    width: 60px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.extruder-loader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    animation: extruderMove 1.5s ease-in-out infinite;
}

.extruder-loader::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--accent);
    animation: extruderMove 1.5s ease-in-out infinite;
}

@keyframes extruderMove {
    0%, 100% {
        left: 0;
    }
    50% {
        left: calc(100% - 20px);
    }
}

/* Tema claro: ajustes para loaders */
[data-theme="light"] .print-loader::before {
    background: 
        linear-gradient(90deg, rgba(99, 102, 241, 0.15) 1px, transparent 1px),
        linear-gradient(rgba(99, 102, 241, 0.15) 1px, transparent 1px);
    border-color: rgba(99, 102, 241, 0.2);
}

[data-theme="light"] .extruder-loader {
    background: rgba(0, 0, 0, 0.1);
    animation: spin 1s linear infinite;
}

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

/* ============================================
   Animations
   ============================================ */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

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

.slide-in-left {
    animation: slideInLeft 0.5s ease forwards;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Staggered animation delay */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

/* ============================================
   STL Viewer
   ============================================ */
.stl-viewer-container {
    background: var(--darker);
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
}

.stl-viewer-controls {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 0.5rem;
}

/* ============================================
   Alerts / Notifications
   ============================================ */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: #06b6d4;
}

/* ============================================
   Breadcrumb (navegación con iconos 3D)
   ============================================ */
.breadcrumb-trail {
    display: inline-flex;
    padding: 0.5rem 0;
    border-radius: 0.75rem;
    position: relative;
    z-index: 100;
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    background: rgba(17, 17, 27, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    padding: 0.375rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.breadcrumb-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.breadcrumb-link {
    color: rgba(255, 255, 255, 0.7);
}

.breadcrumb-link:hover {
    color: #fff;
    background: rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.breadcrumb-link:hover .breadcrumb-icon {
    transform: scale(1.1);
}

/* Contenedor del separador con dropdown */
.breadcrumb-sep-container {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 50;
}

.breadcrumb-sep-container:has(.breadcrumb-dropdown[style*="display: block"]),
.breadcrumb-sep-container:has(.breadcrumb-dropdown:not([style*="display: none"])) {
    z-index: 9999;
}

.breadcrumb-sep {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0 0.125rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Botón de flecha clickeable */
.breadcrumb-sep-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem;
    margin: 0 0.125rem;
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.4);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.breadcrumb-sep-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.3);
}

.breadcrumb-sep-btn:active {
    transform: scale(0.95);
}

/* Dropdown del breadcrumb */
.breadcrumb-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    z-index: 9999;
    min-width: 220px;
    max-width: 280px;
    max-height: 400px;
    overflow-y: auto;
}

.breadcrumb-dropdown-content {
    background: rgba(17, 17, 27, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 0.75rem;
    padding: 0.5rem;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.breadcrumb-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breadcrumb-dropdown-item:hover {
    background: rgba(99, 102, 241, 0.2);
    color: white;
    transform: translateX(2px);
}

.breadcrumb-dropdown-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.breadcrumb-dropdown-icon svg {
    width: 18px;
    height: 18px;
}

/* Flecha indicadora del dropdown */
.breadcrumb-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 12px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid rgba(99, 102, 241, 0.3);
}

.breadcrumb-dropdown::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 13px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid rgba(17, 17, 27, 0.95);
}

/* Tema claro */
[data-theme="light"] .breadcrumb-sep-btn {
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] .breadcrumb-sep-btn:hover {
    color: rgba(0, 0, 0, 0.8);
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.25);
}

[data-theme="light"] .breadcrumb-dropdown-content {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(99, 102, 241, 0.15);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .breadcrumb-dropdown-item {
    color: rgba(30, 41, 59, 0.75);
}

[data-theme="light"] .breadcrumb-dropdown-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #1e293b;
}

[data-theme="light"] .breadcrumb-dropdown::before {
    border-bottom-color: rgba(99, 102, 241, 0.2);
}

[data-theme="light"] .breadcrumb-dropdown::after {
    border-bottom-color: rgba(255, 255, 255, 0.98);
}

.breadcrumb-current {
    color: #fff;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.2) 100%);
    border: 1px solid rgba(129, 140, 248, 0.3);
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.05) inset, 
        0 4px 15px rgba(99, 102, 241, 0.25);
}

.breadcrumb-current .breadcrumb-icon {
    filter: drop-shadow(0 0 4px currentColor);
}

.breadcrumb-label {
    white-space: nowrap;
}

/* Tema claro: ajustes del breadcrumb */
[data-theme="light"] .breadcrumb-nav {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .breadcrumb-sep {
    color: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .breadcrumb-link {
    color: rgba(30, 41, 59, 0.7);
}

[data-theme="light"] .breadcrumb-link:hover {
    color: #1e293b;
    background: rgba(99, 102, 241, 0.1);
}

[data-theme="light"] .breadcrumb-current {
    color: #312e81;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.12) 100%);
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.5) inset, 
        0 4px 15px rgba(99, 102, 241, 0.15);
}

/* ============================================
   Main Content Container - Page Transitions
   ============================================ */
.main-content {
    /* Estado inicial oculto - será revelado por JavaScript */
    opacity: 0;
    transform: translateY(12px);
}

/* Fallback: si JavaScript no carga, mostrar contenido después de 1s */
@keyframes showContentFallback {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content {
    animation: showContentFallback 0.3s ease-out 1s forwards;
}

/* Cuando JS está listo, cancelar el fallback */
.main-content.js-ready {
    animation: none;
}

/* Efecto de transición para los títulos de sección */
.section-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-title-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.15) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.section-title-icon:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
    transform: scale(1.05);
}

/* Reducir movimiento si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
    .main-content {
        animation: none;
    }
}

/* ============================================
   Language Switcher
   ============================================ */
.lang-switcher {
    display: flex;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem;
    border-radius: 0.5rem;
}

.lang-btn {
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
    border: none;
    background: transparent;
    cursor: pointer;
}

.lang-btn:hover {
    color: white;
}

.lang-btn.active {
    background: var(--primary);
    color: white;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .dashboard-card {
        padding: 1.5rem;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
}

/* ============================================
   Subject Cards Grid
   ============================================ */
.subject-card {
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.subject-card:hover {
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(99, 102, 241, 0.2);
    transform: translateY(-4px) scale(1.02);
}

/* Borde inferior con gradiente para subject-card */
.subject-card.print-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    z-index: 2;
}

/* Efecto de brillo al hover */
.subject-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
    pointer-events: none;
}

.subject-card:hover::before {
    opacity: 1;
}

/* ============================================
   Content Tree
   ============================================ */
.content-tree-item {
    position: relative;
}

.content-tree-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: transparent;
    transition: background 0.3s ease;
}

.content-tree-item:hover::before {
    background: var(--primary);
}

/* Custom Scrollbar (usa variables globales del proyecto) */
.custom-scrollbar::-webkit-scrollbar {
    width: var(--scrollbar-size);
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: calc(var(--scrollbar-size) / 2);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: calc(var(--scrollbar-size) / 2);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* ============================================
   Table of Contents (TOC)
   ============================================ */
.toc-nav {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.toc-link {
    position: relative;
    transition: all 0.2s ease;
}

.toc-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary);
    transition: height 0.2s ease;
    border-radius: 2px;
}

.toc-link.active::before,
.toc-link:hover::before {
    height: 60%;
}

.toc-link.active {
    font-weight: 500;
}

/* ============================================
   Section Accordions
   ============================================ */
.section-accordion {
    transition: all 0.3s ease;
}

.section-accordion:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.section-content {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Section type specific styles */
.section-content[data-section-type="reto"] {
    background: rgba(239, 68, 68, 0.05);
    border-radius: 0 0 0.75rem 0.75rem;
    padding: 1.5rem;
}

.section-content[data-section-type="glosario"] {
    background: rgba(20, 184, 166, 0.05);
}

.section-content[data-section-type="procedimiento"] ol {
    counter-reset: step;
    list-style: none;
    padding-left: 0;
}

.section-content[data-section-type="procedimiento"] ol li {
    counter-increment: step;
    position: relative;
    padding-left: 3rem;
    margin-bottom: 1rem;
}

.section-content[data-section-type="procedimiento"] ol li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

/* ============================================
   Questions / Answer Fields
   ============================================ */
.question-item {
    position: relative;
}

.question-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent);
    border-radius: 4px 0 0 4px;
}

.question-answer,
.inline-answer {
    font-size: 0.95rem;
    line-height: 1.6;
}

.question-answer:focus,
.inline-answer:focus {
    background: rgba(6, 182, 212, 0.1);
}

/* ============================================
   Image Gallery
   ============================================ */
.image-gallery {
    gap: 1rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover::after {
    opacity: 1;
}

.gallery-item img {
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* ============================================
   Lightbox
   ============================================ */
#lightbox {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#lightbox-image {
    animation: lightboxZoom 0.3s ease;
}

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

/* ============================================
   Content Viewer Enhancements
   ============================================ */
.content-viewer .markdown-content img {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.content-viewer .markdown-content img:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

/* Metadata card */
.content-viewer .metadata-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
}

/* External links */
.content-viewer .external-link {
    transition: all 0.2s ease;
}

.content-viewer .external-link:hover {
    transform: translateX(4px);
}

/* ============================================
   Floating Action Buttons
   ============================================ */
.content-viewer .fixed button {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.content-viewer .fixed button:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Animations
   ============================================ */
@keyframes animate-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: animate-fade-in 0.3s ease forwards;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .no-print {
        display: none !important;
    }
    
    .markdown-content {
        color: black;
    }
    
    .markdown-content h1,
    .markdown-content h2,
    .markdown-content h3 {
        color: black;
    }
    
    .glass-dark {
        background: white;
        border: 1px solid #ddd;
    }
    
    .section-accordion {
        break-inside: avoid;
    }
    
    .question-answer,
    .inline-answer {
        border: 1px solid #ccc;
        min-height: 80px;
    }
}

/* =============================================
   Notes Panel Styles
   ============================================= */

/* Note card hover effect */
.note-card {
    transition: all 0.2s ease;
}

.note-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Line clamp for note preview */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Quill Editor dark mode customizations */
#notes-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#notes-editor .ql-toolbar.ql-snow {
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 41, 59, 0.5);
    padding: 8px;
}

#notes-editor .ql-container.ql-snow {
    border: none;
    flex: 1;
    overflow-y: auto;
    font-family: 'Poppins', sans-serif;
}

#notes-editor .ql-editor {
    padding: 16px;
    color: #e2e8f0;
    font-size: 14px;
    line-height: 1.6;
    min-height: 200px;
}

#notes-editor .ql-editor.ql-blank::before {
    color: rgba(255, 255, 255, 0.3);
    font-style: normal;
}

#notes-editor .ql-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 8px 0;
}

#notes-editor .ql-editor a {
    color: #818cf8;
}

/* Quill toolbar buttons */
#notes-editor .ql-snow .ql-stroke {
    stroke: rgba(255, 255, 255, 0.6);
}

#notes-editor .ql-snow .ql-fill {
    fill: rgba(255, 255, 255, 0.6);
}

#notes-editor .ql-snow .ql-picker {
    color: rgba(255, 255, 255, 0.6);
}

#notes-editor .ql-snow button:hover .ql-stroke,
#notes-editor .ql-snow .ql-picker-label:hover .ql-stroke {
    stroke: white;
}

#notes-editor .ql-snow button:hover .ql-fill,
#notes-editor .ql-snow .ql-picker-label:hover .ql-fill {
    fill: white;
}

#notes-editor .ql-snow button.ql-active .ql-stroke {
    stroke: #818cf8;
}

#notes-editor .ql-snow button.ql-active .ql-fill {
    fill: #818cf8;
}

#notes-editor .ql-snow .ql-picker-options {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
}

/* Quill tooltip (for links) */
#notes-editor .ql-snow .ql-tooltip {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#notes-editor .ql-snow .ql-tooltip input[type=text] {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
}

#notes-editor .ql-snow .ql-tooltip a.ql-action::after,
#notes-editor .ql-snow .ql-tooltip a.ql-remove::before {
    color: #818cf8;
}

/* Notes panel scrollbar */
.notes-panel-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.notes-panel-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.notes-panel-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.notes-panel-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Storage indicator colors */
.storage-bar-green {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.storage-bar-yellow {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.storage-bar-red {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Notes panel animation */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Color picker button active state */
.color-picker-btn.active {
    box-shadow: 0 0 0 2px white;
    transform: scale(1.1);
}

/* Light theme adjustments for notes panel */
[data-theme="light"] .note-card {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .note-card:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* Light theme for Quill */
[data-theme="light"] #notes-editor .ql-toolbar.ql-snow {
    background: rgba(241, 245, 249, 0.95);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] #notes-editor .ql-editor {
    color: #1e293b;
}

[data-theme="light"] #notes-editor .ql-editor.ql-blank::before {
    color: rgba(0, 0, 0, 0.4);
}

[data-theme="light"] #notes-editor .ql-snow .ql-stroke {
    stroke: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] #notes-editor .ql-snow .ql-fill {
    fill: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] #notes-editor .ql-snow .ql-picker {
    color: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] #notes-editor .ql-snow button:hover .ql-stroke {
    stroke: #1e293b;
}

[data-theme="light"] #notes-editor .ql-snow button:hover .ql-fill {
    fill: #1e293b;
}

[data-theme="light"] #notes-editor .ql-snow .ql-tooltip {
    background: white;
    border-color: rgba(0, 0, 0, 0.1);
    color: #1e293b;
}

[data-theme="light"] #notes-editor .ql-snow .ql-tooltip input[type=text] {
    background: #f1f5f9;
    border-color: rgba(0, 0, 0, 0.2);
    color: #1e293b;
}

