
/* =============================================
   🗺️ SISTEMA DE MAPAS - Mental, Conceptual, Flujo
   ============================================= */
.map-fig-btn-active { border-color: var(--accent-primary) !important; background: rgba(0,212,170,0.08) !important; }
.map-mode canvas { cursor: crosshair; }
.map-type-btn svg { flex-shrink: 0; }
.conn-type-btn.active { border-color: var(--accent-primary) !important; background: rgba(0,212,170,0.06); }
#mapAITopic:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 2px rgba(0,212,170,0.15); }
:root {
    --bg-void: #030508;
    --bg-primary: #0a0e17;
    --bg-secondary: #0f1420;
    --bg-card: #141c2b;
    --bg-elevated: #1a2438;
    --bg-hover: #1f2d45;
    --fg-primary: #e8edf5;
    --fg-secondary: #8896ab;
    --fg-muted: #4d5b70;
    --accent-primary: #0d9488;
    --accent-secondary: #0f766e;
    --accent-tertiary: #134e4a;
    --accent-glow: rgba(13, 148, 136, 0.2);
    --highlight: #d97706;
    --highlight-glow: rgba(217, 119, 6, 0.15);
    --info: #2563eb;
    --error: #be185d;
    --success: #059669;
    --border: #1e293b;
    --border-light: #334155;
}

/* ==========================================
   TEMAS
   ========================================== */

/* Tema 2: Obsidiana (Extreme Dark + Púrpura) */
body[data-theme="obsidian"] {
    --bg-void: #000000;
    --bg-primary: #050505;
    --bg-secondary: #0a0a0a;
    --bg-card: #0f0f0f;
    --bg-elevated: #141414;
    --bg-hover: #1f1f1f;
    --fg-primary: #f9f9f9;
    --fg-secondary: #a1a1aa;
    --fg-muted: #52525b;
    --accent-primary: #8b5cf6;
    --accent-secondary: #7c3aed;
    --accent-tertiary: #6d28d9;
    --accent-glow: rgba(139, 92, 246, 0.2);
    --highlight: #ec4899;
    --highlight-glow: rgba(236, 72, 153, 0.15);
    --border: #18181b;
    --border-light: #27272a;
}

/* Tema 3: Claro Elegante (Estilo Facebook) */
body[data-theme="light"] {
    --bg-void: #f0f2f5;
    --bg-primary: #f7f8fa;
    --bg-secondary: #e4e6eb;
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --bg-hover: #e4e6eb;
    --fg-primary: #050505;
    --fg-secondary: #65676b;
    --fg-muted: #8c939d;
    --accent-primary: #1877f2;
    --accent-secondary: #166fe5;
    --accent-tertiary: #145dbf;
    --accent-glow: rgba(24, 119, 242, 0.15);
    --highlight: #f02849;
    --highlight-glow: rgba(240, 40, 73, 0.15);
    --border: #ced0d4;
    --border-light: #ccd0d5;
}

/* Tema 4: Apple (macOS Dark — Negro + Azul Sistema) */
body[data-theme="gray"] {
    --bg-void: #000000;
    --bg-primary: #1d1d1f;
    --bg-secondary: #2d2d2f;
    --bg-card: #1d1d1f;
    --bg-elevated: #3a3a3c;
    --bg-hover: #48484a;
    --fg-primary: #f5f5f7;
    --fg-secondary: #a1a1a6;
    --fg-muted: #6e6e73;
    --accent-primary: #0071e3;
    --accent-secondary: #0077ed;
    --accent-tertiary: #147ce5;
    --accent-glow: rgba(0, 113, 227, 0.25);
    --highlight: #ff375f;
    --highlight-glow: rgba(255, 55, 95, 0.2);
    --border: #3a3a3c;
    --border-light: #48484a;
}

/* Tema 5: Pizarra Verde (Estilo Rolex: Verde profundo + Oro + Marfil) */
body[data-theme="chalkboard"] {
    --bg-void: #003620;        /* Tono base extra oscuro */
    --bg-primary: #F4F1EA;     /* Champaña súper claro agradable a la vista */
    --bg-secondary: #EBE5D9;   /* Sombra marfil */
    --bg-card: #FDFCF8;        /* Tarjetas color marfil/crema luminoso */
    --bg-elevated: #FDFCF8;
    --bg-hover: #DFD7C4;       /* Resalte cálido */
    --fg-primary: #004227;     /* Texto verde rolex oscuro (hace gran contraste con marfil) */
    --fg-secondary: #70644D;   /* Texto secundario tono castaño/oro apagado */
    --fg-muted: #9E927A;
    --accent-primary: #D4AF37; /* Oro Rolex Metálico */
    --accent-secondary: #B3975B;
    --accent-tertiary: #92793D;
    --accent-glow: rgba(212, 175, 55, 0.25);
    --highlight: #006039;      /* Verde Rolex Clásico */
    --highlight-glow: rgba(0, 96, 57, 0.15);
    --border: #DBCDB4;         /* Borde dorado muy sutil */
    --border-light: #C0B195;
}

/* Tema 6: Starbucks (Blanco limpio + Verde Starbucks) */
body[data-theme="blueprint"] {
    --bg-void: #f2f2f2;
    --bg-primary: #ffffff;
    --bg-secondary: #f0f7f4;
    --bg-card: #ffffff;
    --bg-elevated: #ffffff;
    --bg-hover: #e6f3ee;
    --fg-primary: #1e3932;
    --fg-secondary: #3d6b5e;
    --fg-muted: #6a9e8e;
    --accent-primary: #00704a;
    --accent-secondary: #006241;
    --accent-tertiary: #004e32;
    --accent-glow: rgba(0, 112, 74, 0.2);
    --highlight: #cba258;
    --highlight-glow: rgba(203, 162, 88, 0.2);
    --border: #d5e8e2;
    --border-light: #b3d4c8;
}

/* Tema 7: Roblox (Rojo + Negro + Blanco) */
body[data-theme="gamer"] {
    --bg-void: #0a0a0a;
    --bg-primary: #141414;
    --bg-secondary: #1e1e1e;
    --bg-card: #181818;
    --bg-elevated: #252525;
    --bg-hover: #2e2e2e;
    --fg-primary: #ffffff;
    --fg-secondary: #c0c0c0;
    --fg-muted: #7a7a7a;
    --accent-primary: #e8002a;
    --accent-secondary: #ff1a3c;
    --accent-tertiary: #ff4d6a;
    --accent-glow: rgba(232, 0, 42, 0.3);
    --highlight: #ffffff;
    --highlight-glow: rgba(255, 255, 255, 0.2);
    --border: #2a2a2a;
    --border-light: #3a3a3a;
}

/* Tema 8: Kali (Obsidiana + Naranja Siemens A50) */
body[data-theme="kali"] {
    --bg-void: #000000;
    --bg-primary: #050505;
    --bg-secondary: #0a0a0a;
    --bg-card: #080808;
    --bg-elevated: #111111;
    --bg-hover: #1a1a1a;
    --fg-primary: #ffffff;
    --fg-secondary: #a0a0a0;
    --fg-muted: #505050;
    --accent-primary: #e85d04;
    --accent-secondary: #f48c06;
    --accent-tertiary: #faa307;
    --accent-glow: rgba(232, 93, 4, 0.4);
    --highlight: #ffba08;
    --highlight-glow: rgba(255, 186, 8, 0.2);
    --border: #151515;
    --border-light: #202020;
}

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

body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--bg-void);
    color: var(--fg-primary);
    overflow: hidden;
    height: 100vh;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Background atmosphere */
.bg-atmosphere {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 50% at 20% 40%, rgba(0, 212, 170, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 60%, rgba(240, 180, 41, 0.02) 0%, transparent 50%),
        radial-gradient(ellipse 100% 100% at 50% 100%, rgba(0, 0, 0, 0.5) 0%, transparent 50%);
    z-index: 0;
}

/* Asegurar que el main ocupe todo el espacio disponible */
main {
    flex: 0 0 calc(100vw - 72px);
    width: calc(100vw - 72px);
    height: 100vh;
    position: relative;
    overflow: hidden !important;
}

/* Canvas container - ocupa 100% del main */
#canvasContainer {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden;
    background: var(--bg-void);
    z-index: 1;
}

/* ==========================================
   CORRECCIÓN: Canvas con zoom
   ========================================== */
#mainCanvas {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    cursor: crosshair;
    touch-action: none;
    position: relative;
    z-index: 1;
    transform-origin: center center;
}

/* ==========================================
   CORRECCIÓN: Contenedor de formulas con zoom
   ========================================== */
#formulasContainer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
    transform-origin: center center;
}

/* Las formulas individuales pueden recibir eventos */
.draggable-formula {
    pointer-events: auto;
}

/* RGB and Hex Input Groups */
.color-input-group {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.color-input-field {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--fg-primary);
    padding: 4px 8px;
    border-radius: 4px;
    width: 100%;
    font-family: 'JetBrains Mono', monospace;
}

.color-input-field:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Tool buttons */
.tool-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.tool-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity 0.2s;
}

.tool-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.tool-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-void);
    box-shadow: 0 0 20px var(--accent-glow), 0 4px 12px rgba(0, 212, 170, 0.3);
    transform: scale(1.05);
}

.tool-btn.active svg {
    stroke: var(--bg-void);
}

/* Sidebar styling */
.sidebar-section {
    border-bottom: 1px solid var(--border);
    padding: 14px;
}

.sidebar-section:last-child {
    border-bottom: none;
}

/* Section headers */
.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.section-header::before {
    content: '';
    width: 3px;
    height: 12px;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 2px;
}

/* Color swatches */
.color-swatch {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
}

.color-swatch:hover {
    transform: scale(1.2);
}

.color-swatch.active {
    border-color: var(--fg-primary);
    transform: scale(1.2);
    box-shadow: 0 0 15px currentColor, 0 0 30px currentColor;
}

.rainbow-btn {
    width: 18px !important;
    height: 18px !important;
    background: #FF0000 !important; /* Fallback */
    background: linear-gradient(135deg, #FF0000, #FF8C00, #FFEB00, #00FF00, #00FFFF, #0000FF, #8B00FF, #FF0000) !important;
    background-size: 200% 200% !important;
    animation: rainbowWave 2s linear infinite !important;
    border: 1.5px solid rgba(0, 0, 0, 0.2) !important;
    border-radius: 50% !important;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3) !important;
    position: relative;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    cursor: pointer !important;
    overflow: hidden !important;
}

@keyframes rainbowWave {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.rainbow-btn svg {
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.5));
    stroke: #000000 !important;
    stroke-width: 3.5px !important;
}

@keyframes rainbowShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.animate-in {
    animation: fadeInScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

#expandedColorPalette {
    transform-origin: top center;
    background: rgba(26, 36, 56, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--accent-glow);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 30px var(--accent-glow);
}

#extendedSwatches .color-swatch:hover {
    transform: scale(1.3);
    box-shadow: 0 0 10px currentColor;
    z-index: 10;
}

/* Formula cards */
.formula-card {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.formula-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 170, 0.1), transparent);
    transition: left 0.5s;
}

.formula-card:hover::before {
    left: 100%;
}

.formula-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px) translateX(2px);
    box-shadow: 0 8px 25px var(--accent-glow), -4px 0 15px var(--accent-glow);
}

/* AI Chat */
.chat-message {
    animation: messageSlide 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ai-typing {
    display: inline-flex;
    gap: 5px;
}

.ai-typing span {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, var(--accent-primary), var(--highlight));
    border-radius: 50%;
    animation: typingPulse 1.4s infinite ease-in-out;
}

.ai-typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.ai-typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typingPulse {
    0%, 60%, 100% {
        transform: translateY(0) scale(0.8);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px) scale(1.2);
        opacity: 1;
    }
}

/* Inputs */
input, textarea, select {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--fg-primary);
    border-radius: 10px;
    transition: all 0.2s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Advanced Picker Input Styling */
.advanced-input-group {
    background: var(--bg-void);
    border: 1px solid var(--border);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.advanced-input-group:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-glow);
    background: var(--bg-elevated);
}

/* Numeric inputs specifically for RGB */
input[type="number"]::-webkit-inner-spin-button, 
input[type="number"]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
input[type="number"] {
    -moz-appearance: textfield;
    appearance: none;
}

/* Range inputs */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-elevated);
    height: 6px;
    border-radius: 3px;
    border: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.4);
    transition: transform 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-void);
    font-weight: 600;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn-primary:hover::after {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    box-shadow: 0 6px 20px var(--accent-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.btn-highlight {
    background: linear-gradient(135deg, var(--highlight), #e5a520);
    color: var(--bg-void);
    font-weight: 600;
}

.btn-highlight:hover {
    box-shadow: 0 6px 20px var(--highlight-glow);
}

/* Tabs */
.tab-btn {
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    position: relative;
}

.tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--highlight));
}

/* Modal */
.modal-backdrop {
    background: rgba(3, 5, 8, 0.92);
    backdrop-filter: blur(12px);
}

/* Draggable formulas */
.draggable-formula {
    position: absolute;
    cursor: move;
    user-select: none;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px var(--accent-glow);
    z-index: 100;
    animation: formulaPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes formulaPop {
    from {
        transform: scale(0.7) rotate(-5deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

/* Tooltips */
[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* ==========================================
   FLOATING TEXT EDITOR (RTE)
   ========================================== */

#textOverlay {
    backdrop-filter: blur(12px);
    background: rgba(20, 28, 43, 0.85); /* var(--bg-card) with alpha */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px var(--accent-glow);
    animation: windowAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

#textOverlayHandle:active {
    cursor: grabbing;
}

.rte-btn {
    color: var(--fg-secondary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.rte-btn:hover {
    color: var(--accent-primary);
    background: rgba(0, 212, 170, 0.1) !important;
}

.rte-editor {
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.rte-editor::-webkit-scrollbar {
    width: 4px;
}

.rte-editor::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 2px;
}

/* .rte-editor:focus behavior handled by placeholder/padding */


/* Symbol palette (Integrated) */
.symbol-btn {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--fg-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 14px;
}

.symbol-btn:hover {
    background: rgba(0, 212, 170, 0.1) !important;
    border-color: var(--accent-primary) !important;
    color: var(--accent-primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.symbol-btn:active {
    transform: scale(0.9) translateY(0);
}


/* Provider selector */
.provider-option {
    transition: all 0.25s;
    border: 2px solid var(--border);
    position: relative;
    overflow: hidden;
}

.provider-option:hover {
    border-color: var(--border-light);
    background: var(--bg-hover);
}

.provider-option.selected {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1), rgba(0, 184, 148, 0.05));
    box-shadow: inset 0 0 20px var(--accent-glow);
}

.provider-option.selected::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background: var(--accent-primary);
    clip-path: polygon(100% 0, 0 0, 100% 100%);
}

/* Stats cards */
.stat-card {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated));
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    transition: all 0.25s;
}

.stat-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

/* Session card */
.session-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    transition: all 0.2s;
    cursor: pointer;
}

.session-card:hover {
    border-color: var(--highlight);
    background: var(--bg-hover);
}

/* Progress ring */
.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring circle {
    transition: stroke-dashoffset 0.5s ease;
}

/* Floating action button */
.fab {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 6px 20px var(--accent-glow), 0 0 40px var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-5px) rotate(2deg);
    }
}

/* Anillo de pulso */
.fab-pulse-ring {
    position: absolute;
    inset: -4px;
    border-radius: 20px;
    border: 2px solid var(--accent-primary);
    opacity: 0;
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.9);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Robot Activo / Escribiendo */
.fab.listening .robot-icon svg {
    animation: robot-dance 0.5s ease-in-out infinite;
}

@keyframes robot-dance {
    0%, 100% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(5deg);
    }
}

/* Ojos parpadeando al buscar */
.fab.listening .robot-eye {
    animation: blink 0.3s ease-in-out infinite alternate;
}

@keyframes blink {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0.3;
        transform: scaleY(0.5);
    }
}

/* Hover suave */
.fab:hover {
    animation: none;
    transform: scale(1.1) rotate(5deg);
}

/* Notification toast */
.toast {
    animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* Glow effects */
.glow-accent {
    box-shadow: 0 0 20px var(--accent-glow), 0 0 40px var(--accent-glow);
}

.glow-highlight {
    box-shadow: 0 0 20px var(--highlight-glow), 0 0 40px var(--highlight-glow);
}

/* Right panel (AI) transition */
.panel-slide {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 20;
    background: var(--bg-secondary);
    box-shadow: -5px 0 25px rgba(0,0,0,0.3);
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

body.ai-sidebar-open #aiPanel,
body.workspace-config-open #workspaceConfigPanel,
body.tools-panel-open #leftPanel {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.panel-slide.collapsed {
    transform: translateX(110%);
    opacity: 0;
    pointer-events: none;
}

/* Tools panel transition (formerly Left panel) */
.left-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
    z-index: 20;
    background: var(--bg-secondary);
    box-shadow: -5px 0 25px rgba(0,0,0,0.3);
}

.left-panel.collapsed {
    transform: translateX(110%);
    opacity: 0;
}



/* Badge */
.badge {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-new {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-void);
}

.badge-pro {
    background: linear-gradient(135deg, var(--highlight), #e5a520);
    color: var(--bg-void);
}

/* Indicador de Estado en la esquina */
.mode-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 10px;
    height: 10px;
    z-index: 10;
    background: transparent;
    padding: 0;
    border: none;
}

.mode-indicator .dot {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--fg-muted);
    transition: background-color 0.3s, box-shadow 0.3s;
}

/* Estados heredados al punto */
.mode-indicator.online .dot {
    background-color: var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-primary);
}

.mode-indicator.offline .dot {
    background-color: var(--error);
    box-shadow: 0 0 8px var(--error);
}

.mode-indicator.checking .dot {
    background-color: var(--highlight);
    animation: pulse 1s infinite;
}

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

/* Ajustar el toolbar superior para que no interfiera con el canvas */
.absolute.top-4.left-4.right-4 {
    z-index: 20;
}

/* Ajustar la barra de estado inferior */
.absolute.bottom-4.left-4.right-4 {
    z-index: 20;
}

/* Botón flotante de IA */
.fab {
    z-index: 30;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
/* Mejoras para las tarjetas de cursos */
.course-card {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.course-card:hover {
    transform: translateY(-2px);
}

/* Línea de progreso animada */
.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--highlight), var(--accent-primary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
    border-radius: 3px 3px 0 0;
}

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

/* Estilo para truncar texto */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Animación de entrada para cursos */
@keyframes courseFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.course-card {
    animation: courseFadeIn 0.4s ease-out;
}

/* Mejoras para botones */
.course-card button {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.course-card button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.course-card button:active::after {
    width: 100px;
    height: 100px;
}

/* ==========================================
   Módulo de Investigación & Whiteboard
   ========================================== */

/* Botones de toolbar del whiteboard */
.wb-tool-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--fg-secondary);
}

.wb-tool-btn:hover {
    background-color: var(--bg-hover);
    color: var(--fg-primary);
    transform: translateY(-1px);
}

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

/* Tarjetas de recursos de investigación */
.research-resource-card {
    transition: all 0.2s ease;
}

.research-resource-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

/* Botones de tipo de recurso activos */
.active-res-type {
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

/* Previsualización de investigación */
.investigation-preview {
    background: linear-gradient(180deg, var(--bg-void) 0%, var(--bg-card) 100%);
}

.investigation-preview h1 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #3b82f6;
    margin-bottom: 0.5rem;
}

.investigation-preview h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #60a5fa;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

.investigation-preview p {
    margin-bottom: 0.5rem;
}

/* Contenido del Whiteboard Editor */
#whiteboardEditorContent {
    font-family: 'Space Grotesk', sans-serif;
}

/* Tipografía del reporte generado */
#whiteboardEditorContent h1 {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1.2;
    color: #1d4ed8;
    margin-bottom: 1.5rem;
}

#whiteboardEditorContent h2 {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.3;
    color: #2563eb;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #3b82f6;
    padding-left: 12px;
}

#whiteboardEditorContent h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #374151;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

#whiteboardEditorContent h4 {
    font-size: 1.2rem;
    font-weight: 500;
    color: #1d4ed8;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

#whiteboardEditorContent p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #4b5563;
    margin-bottom: 1.25rem;
    text-align: justify;
}

#whiteboardEditorContent blockquote {
    border-left: 4px solid #93c5fd;
    padding: 1rem 1.25rem;
    color: #4b5563;
    font-style: italic;
    background: #eff6ff;
    margin: 1.5rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
}

#whiteboardEditorContent ul, #whiteboardEditorContent ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
    color: #4b5563;
}

#whiteboardEditorContent li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

#whiteboardEditorContent a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
}

#whiteboardEditorContent table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}

#whiteboardEditorContent th {
    background: #1d4ed8;
    color: white;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
}

#whiteboardEditorContent td {
    border: 1px solid #d1d5db;
    padding: 0.75rem 1rem;
    color: #4b5563;
}

#whiteboardEditorContent tr:nth-child(even) {
    background: #f9fafb;
}

#whiteboardEditorContent img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin: 1.5rem auto;
    display: block;
}

/* ==========================================
   Módulo de Color Adobe-Style
   ========================================== */
.ts-color-widget {
    position: relative;
    width: 44px;
    height: 44px;
    margin-left: 5px;
}

.ts-color-stroke, .ts-color-fill {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.19, 1, 0.22, 1);
}

.ts-color-stroke {
    top: 0;
    left: 0;
    background: #ffffff;
    z-index: 10;
}

.ts-color-fill {
    bottom: 0;
    right: 0;
    background: transparent;
    border-color: rgba(255, 255, 255, 0.4);
    z-index: 5;
}

/* El elemento activo sobresale */
.ts-color-stroke.active, .ts-color-fill.active {
    z-index: 15;
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--accent-glow);
    border-color: var(--accent-primary) !important;
}

.ts-color-fill:not(.active) {
    opacity: 0.8;
}

.ts-color-reset {
    position: absolute;
    bottom: -6px;
    left: -6px;
    width: 18px;
    height: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-muted);
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.ts-color-reset:hover {
    color: var(--accent-primary);
    background: var(--bg-hover);
    transform: rotate(-90deg);
}

.ts-color-fill[style*="transparent"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background: #ff4757;
    transform: rotate(45deg);
}

/* ==========================================
   Rediseño Bento: Controles Premium (HUD) y Sliders Compactos
   ========================================== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 8px;
    margin-top: 10px;
}

.bento-tile {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.bento-tile:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.bento-tile-label {
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--fg-muted);
    opacity: 0.7;
}

/* Rotation Tile (Square) */
.rotation-bento {
    grid-row: span 2;
    width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.bento-dial {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border);
    position: relative;
    cursor: ew-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, var(--bg-card) 0%, var(--bg-elevated) 100%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.bento-dial::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px dashed var(--border);
    opacity: 0.3;
}

.bento-dial-hand {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 4px;
    transform-origin: 0% 50%;
    box-shadow: 0 0 10px var(--accent-glow);
}

.bento-dial-value {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 800;
    color: var(--fg-primary);
    pointer-events: none;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Scrubber Bento */
.bento-scrubber {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: var(--bg-void);
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: ew-resize;
    transition: all 0.2s;
}

.bento-scrubber:hover {
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
}

.bento-scrubber-icon {
    color: var(--fg-muted);
    opacity: 0.8;
}

.bento-scrubber-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    color: var(--fg-primary);
}

.bento-scrubber-unit {
    font-size: 8px;
    color: var(--fg-muted);
    margin-left: 2px;
}

/* Dual Controls in one tile */
.bento-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

/* Aspect Ratio Link */
.bento-link {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fg-muted);
    opacity: 0.4;
    cursor: pointer;
    transition: all 0.2s;
}

.bento-link.active {
    color: var(--accent-primary);
    opacity: 1;
}

/* Animation for active tile */
.bento-tile.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Input manual mode */
.bento-scrubber input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--accent-primary);
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    text-align: right;
    display: none;
}

.bento-scrubber.editing .bento-scrubber-value,
.bento-scrubber.editing .bento-scrubber-unit {
    display: none;
}

.bento-scrubber.editing input {
    display: block;
}

/* ==========================================
   Sliders Compactos (NUEVO DISEÑO)
   ========================================== */
.compact-slider-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.compact-slider-container:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.compact-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compact-slider-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--fg-secondary);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.compact-slider-value {
    font-size: 10px;
    font-family: monospace;
    font-weight: 600;
    color: var(--fg-primary);
    background: var(--bg-void);
    padding: 1px 4px;
    border-radius: 4px;
    min-width: 24px;
    text-align: center;
    border: 1px solid transparent;
}

.compact-slider-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--bg-void);
    border-radius: 2px;
    outline: none;
    transition: background 0.2s;
}

.compact-slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    border: 2px solid var(--bg-card);
    transition: transform 0.1s, background 0.2s;
}

.compact-slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--highlight);
}

.compact-slider-input:active::-webkit-slider-thumb {
    transform: scale(1.1);
}

/* Grid de sliders */
.sliders-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 6px;
}

.sliders-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 6px;
}

.sliders-grid-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
    margin-top: 6px;
}

/* Variante ultra compacta para 3 columnas */
.compact-slim {
    padding: 4px 5px;
    gap: 3px;
}

.compact-slim .compact-slider-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

.compact-slim .compact-slider-label {
    font-size: 8px;
    letter-spacing: 0.3px;
    gap: 2px;
}

.compact-slim .compact-slider-value {
    font-size: 9px;
    padding: 0 3px;
    min-width: 18px;
    align-self: flex-end;
}

.compact-slim .compact-slider-input {
    height: 3px;
}

.compact-slim .compact-slider-input::-webkit-slider-thumb {
    width: 10px;
    height: 10px;
}

/* Dimensions specific */
.dimensions-bento {
    min-width: 160px;
}

/* 3D Depth */
#depthBentoTile.hidden {
    display: none !important;
}

/* ==========================================
   PRO ASIDE - PANEL PROFESIONAL DE DIBUJO
   ========================================== */
.pro-aside {
    width: 72px;
    background: linear-gradient(180deg, #0d1320 0%, #0a0e17 100%);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    gap: 0;
    box-shadow: 2px 0 30px rgba(0,0,0,0.5);
    scrollbar-width: none;
    position: relative;
    z-index: 50;
}

.pro-aside::-webkit-scrollbar { display: none; }

/* LOGO AREA */
.pro-aside-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 4px 8px;
    margin-bottom: 4px;
    position: relative;
}

/* SEPARATORS */
.pro-separator {
    width: 32px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-light), transparent);
    margin: 10px 0;
    flex-shrink: 0;
}

/* TOOL GROUPS */
.pro-tool-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 4px;
    padding: 0 6px;
    width: 100%;
}

/* GROUP LABEL */
.pro-group-label {
    grid-column: span 2;
    font-size: 7.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--fg-muted);
    margin-bottom: 2px;
    margin-top: 6px;
    text-align: center;
    user-select: none;
    line-height: 1;
}

/* TOOL BUTTON BASE */
.pro-tool-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.2;
    transition: transform 0.2s ease;
}
.pro-tool-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--fg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    flex-shrink: 0;
    overflow: visible;
}

.pro-tool-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0;
    transition: opacity 0.18s;
}

.pro-tool-btn svg {
    position: relative;
    z-index: 1;
    transition: all 0.18s;
    flex-shrink: 0;
}

/* HOVER */
.pro-tool-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--border-light);
    color: var(--fg-primary);
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

/* ACTIVE (selected tool) */
.pro-tool-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: rgba(0, 212, 170, 0.4);
    color: var(--bg-void);
    box-shadow: 0 0 16px var(--accent-glow), 0 3px 10px rgba(0,212,170,0.25);
    transform: none;
}

.pro-tool-btn.active svg {
    stroke: var(--bg-void);
    filter: brightness(0);
}

/* ADOBE-STYLE CORNER INDICATOR */
.corner-indicator {
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 4.5px 4.5px;
    border-color: transparent transparent var(--fg-muted) transparent;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.2s;
}

.pro-tool-btn:hover .corner-indicator {
    border-color: transparent transparent var(--fg-primary) transparent;
}

/* TOOL CATALOG (FLYOUT) */
.pro-tool-catalog {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    display: grid;
    grid-template-columns: repeat(4, 38px);
    gap: 4px;
    background: var(--bg-card);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--accent-primary);
    border-radius: 0 0 12px 12px;
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
}

.pro-tool-catalog.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}

/* Tool density adjustment for catalog */
.pro-tool-catalog .pro-tool-btn {
    width: 38px;
    height: 38px;
}

.pro-tool-catalog .pro-tool-btn svg {
    width: 18px;
    height: 18px;
}

/* Support for text-based triggers (2D/3D buttons) */
.pro-tool-btn span {
    pointer-events: none;
    z-index: 2;
}


/* FLOATING TOOL LABEL - Hidden as requested */
.floating-tool-label {
    display: none !important;
    position: fixed;
    background: linear-gradient(135deg, rgb(0, 212, 170), rgb(0, 150, 120)); /* Fully opaque */
    color: var(--bg-void);
    padding: 3px 12px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 2000;
    opacity: 0;
    transform: translateY(10px) scale(0.96);
    transition: opacity 0.2s, transform 0.25s cubic-bezier(0.19, 1, 0.22, 1);
    font-family: 'Space Grotesk', sans-serif;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
}

.floating-tool-label.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Tool indicator dot */
.floating-tool-label::after {
    content: '';
    position: absolute;
    left: -8px;
    bottom: -4px;
    width: 4px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 50%;
    opacity: 0.6;
}

/* Hide tooltips for pro-tool-btn in the top toolbar */
.top-floating-toolbar [data-tooltip]::after,
.top-floating-toolbar [data-tooltip]::before {
    display: none !important;
}


/* Animación de entrada para cursos */
@keyframes courseFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.course-card {
    animation: courseFadeIn 0.4s ease-out;
}

/* Mejoras para botones */
.course-card button {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.course-card button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.course-card button:active::after {
    width: 100px;
    height: 100px;
}

/* ==========================================
   Módulo de Investigación & Whiteboard
   ========================================== */

/* Botones de toolbar del whiteboard */
.wb-tool-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--fg-secondary);
}

.wb-tool-btn:hover {
    background-color: var(--bg-hover);
    color: var(--fg-primary);
    transform: translateY(-1px);
}

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

/* Tarjetas de recursos de investigación */
.research-resource-card {
    transition: all 0.2s ease;
}

.research-resource-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

/* Botones de tipo de recurso activos */
.active-res-type {
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

/* Previsualización de investigación */
.investigation-preview {
    background: linear-gradient(180deg, var(--bg-void) 0%, var(--bg-card) 100%);
}

.investigation-preview h1 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #3b82f6;
    margin-bottom: 0.5rem;
}

.investigation-preview h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #60a5fa;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

.investigation-preview p {
    margin-bottom: 0.5rem;
}

/* Contenido del Whiteboard Editor */
#whiteboardEditorContent {
    font-family: 'Space Grotesk', sans-serif;
}

/* Tipografía del reporte generado */
#whiteboardEditorContent h1 {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1.2;
    color: #1d4ed8;
    margin-bottom: 1.5rem;
}

#whiteboardEditorContent h2 {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.3;
    color: #2563eb;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #3b82f6;
    padding-left: 12px;
}

#whiteboardEditorContent h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #374151;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

#whiteboardEditorContent h4 {
    font-size: 1.2rem;
    font-weight: 500;
    color: #1d4ed8;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

#whiteboardEditorContent p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #4b5563;
    margin-bottom: 1.25rem;
    text-align: justify;
}

#whiteboardEditorContent blockquote {
    border-left: 4px solid #93c5fd;
    padding: 1rem 1.25rem;
    color: #4b5563;
    font-style: italic;
    background: #eff6ff;
    margin: 1.5rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
}

#whiteboardEditorContent ul, #whiteboardEditorContent ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
    color: #4b5563;
}

#whiteboardEditorContent li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

#whiteboardEditorContent a {
    color: #2563eb;
    text-decoration: underline;
    text-underline-offset: 2px;
}

#whiteboardEditorContent table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}

#whiteboardEditorContent th {
    background: #1d4ed8;
    color: white;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
}

#whiteboardEditorContent td {
    border: 1px solid #d1d5db;
    padding: 0.75rem 1rem;
    color: #4b5563;
}

#whiteboardEditorContent tr:nth-child(even) {
    background: #f9fafb;
}

#whiteboardEditorContent img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin: 1.5rem auto;
    display: block;
}

/* ==========================================
   UNIFIED MINIMALIST TOP TOOLBAR
   ========================================== */
.top-toolbar-container {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    pointer-events: none;
    display: flex;
    justify-content: center;
    width: auto;
}

.top-floating-toolbar {
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--accent-primary);
    border-radius: 12px; /* More minimalist, less pill-shaped */
    padding: 4px;
    display: flex;
    align-items: center;
    gap: 2px; /* Tighter gap */
    box-shadow: none;
    pointer-events: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-floating-toolbar:hover {
    border-color: var(--accent-primary);
    box-shadow: none;
}

.toolbar-separator {
    width: 1px;
    height: 20px; /* Shorter separator */
    background: rgb(39 39 39 / 20%);
    margin: 0 1px;
}

.top-floating-toolbar button {
    width: 32px !important; /* Smaller buttons for minimalism */
    height: 32px !important;
    padding: 0 !important;
    display: flex;
    flex-direction: row !important;
    align-items: center;
    justify-content: center;
    border-radius: 8px !important; /* Squarer buttons match minimalism */
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--fg-secondary);
}

.top-floating-toolbar button:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-primary);
    transform: translateY(-2px);
    border-color: rgba(0, 212, 170, 0.2);
}

.top-floating-toolbar button.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-void);
    box-shadow: 0 0 15px var(--accent-glow);
}

.top-floating-toolbar button.btn-primary:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 0 25px var(--accent-glow);
}

.top-floating-toolbar #zoomDisplay {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 38px;
    padding: 0 12px;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 11px;
    color: var(--accent-primary);
    font-weight: 700;
}

#svSquare {
    background-image: 
        linear-gradient(to top, #000, transparent),
        linear-gradient(to right, #fff, transparent);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

#svPointer {
    transition: transform 0.05s ease-out;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.3), inset 0 0 0 1px rgba(255,255,255,0.8);
}

#hueTrack {
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

#huePointer {
    pointer-events: none;
    box-shadow: 0 0 3px rgba(0,0,0,0.5);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#integratedColorPicker {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#integratedColorPicker:not(.hidden) {
    display: flex !important;
    flex-direction: column;
}

.animate-in {
    animation: panelIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes panelIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.shadow-3xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

/* ==========================================
   SELECTION TOOLBAR — COMPACT MINIMALIST
   ========================================== */
/* ---- Drag Handle ---- */
.toolbar-drag-handle {
    width: 100%;
    height: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    margin-bottom: 4px;
    flex-shrink: 0;
}

.toolbar-drag-handle:active {
    cursor: grabbing;
}

.drag-dots {
    width: 30px;
    height: 4px;
    background-image: radial-gradient(rgba(13, 148, 136, 0.5) 1px, transparent 1px);
    background-size: 5px 5px;
    opacity: 0.6;
}

.top-selection-toolbar {
    position: absolute;
    top: 80px;
    right: 18px;
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border: 1px solid rgba(13, 148, 136, 0.3);
    border-radius: 18px;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    pointer-events: auto;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
    opacity: 0;
    transform: translateX(30px) scale(0.95);
    width: 245px;
    max-height: 78vh;
    padding-top: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    /* Custom minimal scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(13, 148, 136, 0.45) transparent;
}

/* Webkit scrollbar — styled to match the theme */
.top-selection-toolbar::-webkit-scrollbar {
    width: 3px;
}
.top-selection-toolbar::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}
.top-selection-toolbar::-webkit-scrollbar-thumb {
    background: rgba(13, 148, 136, 0.45);
    border-radius: 10px;
    transition: background 0.2s;
}
.top-selection-toolbar::-webkit-scrollbar-thumb:hover {
    background: rgba(13, 148, 136, 0.75);
}

.top-selection-toolbar:not(.hidden) {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* ---- Groups ---- */
.selection-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.selection-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(13, 148, 136, 0.85);
    margin-bottom: 2px;
    padding-left: 2px;
}

.selection-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    width: 100%;
    justify-content: flex-start;
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 25px);
    gap: 5px;
    width: 100%;
    justify-content: space-between;
}

.toolbar-separator-h {
    height: 1px;
    width: calc(100% + 4px);
    margin-left: -2px;
    background: linear-gradient(to right, transparent, rgba(13, 148, 136, 0.2), transparent);
    margin-top: 0;
    margin-bottom: 0;
}

/* ---- Buttons ---- */
.top-selection-toolbar button {
    width: 25px !important;
    height: 25px !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 !important;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(148, 163, 184, 0.85);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.top-selection-toolbar button svg {
    width: 12px !important;
    height: 12px !important;
}

.top-selection-toolbar button:hover {
    background: rgba(13, 148, 136, 0.2);
    color: var(--accent-primary);
    transform: translateY(-1px);
    border-color: rgba(13, 148, 136, 0.4);
    box-shadow: 0 3px 10px rgba(13, 148, 136, 0.15);
}

.top-selection-toolbar button.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-void);
    border-color: transparent;
    box-shadow: 0 0 10px rgba(13, 148, 136, 0.3);
}

/* ---- Sliders ---- */
.top-selection-toolbar input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: #808080;
    height: 3px;
    border-radius: 3px;
    outline: none;
    width: 100%;
    margin: 6px 0;
}

.top-selection-toolbar input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 11px;
    height: 11px;
    background: var(--accent-primary);
    border: 2px solid rgba(10, 14, 23, 0.8);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 0 6px rgba(13, 148, 136, 0.5);
}

.top-selection-toolbar input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    box-shadow: 0 0 12px rgba(13, 148, 136, 0.7);
}

.top-selection-toolbar input[type="range"]::-moz-range-thumb {
    width: 11px;
    height: 11px;
    background: var(--accent-primary);
    border: 2px solid rgba(10, 14, 23, 0.8);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(13, 148, 136, 0.5);
}

/* ══════════════════════════════════════════════════════════
   WORKSPACE CONFIG PANEL — Design System (wcp-*)
   ══════════════════════════════════════════════════════════ */

/* ── Tab Strip ── */
.wcp-tab-strip {
    position: relative;
}

.wcp-tab-btn {
    flex: 1;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 8px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 10px;
    color: var(--fg-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}

.wcp-tab-btn:hover {
    color: var(--fg-secondary);
    background: rgba(255,255,255,0.04);
}

.wcp-tab-btn.active {
    color: var(--fg-primary);
    background: var(--bg-elevated);
    box-shadow: 0 1px 6px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
}

/* ── Cards ── */
.wcp-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    transition: box-shadow 0.25s;
}

.wcp-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.wcp-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.wcp-card-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-hover));
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.wcp-card-title {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--fg-primary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ── Fields & Labels ── */
.wcp-field {
    margin-bottom: 12px;
}

.wcp-field:last-child {
    margin-bottom: 0;
}

.wcp-label {
    display: block;
    font-size: 8.5px;
    font-weight: 700;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 7px;
}

/* ── Unit Pill Buttons ── */
.wcp-pill-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 7px 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.wcp-pill-btn:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
    transform: translateY(-1px);
}

.wcp-pill-btn.selected {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(13,148,136,0.12), rgba(13,148,136,0.06));
    box-shadow: 0 0 0 1px var(--accent-primary), 0 3px 10px rgba(13,148,136,0.15);
}

.wcp-pill-main {
    font-size: 10px;
    font-weight: 800;
    color: var(--fg-primary);
    line-height: 1;
}

.wcp-pill-btn.selected .wcp-pill-main {
    color: var(--accent-primary);
}

.wcp-pill-sub {
    font-size: 7px;
    color: var(--fg-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ── Grid Visual Preview Buttons ── */
.wcp-grid-opt {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 10px;
    font-weight: 600;
    color: var(--fg-secondary);
}

.wcp-grid-opt:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--fg-primary);
}

.wcp-grid-opt.selected {
    background: linear-gradient(135deg, rgba(13,148,136,0.1), rgba(13,148,136,0.02));
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.wcp-grid-icon {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    flex-shrink: 0;
}

.wcp-grid-opt.selected .wcp-grid-icon {
    opacity: 1;
}

/* ── Custom Selects ── */
.wcp-select-wrap {
    position: relative;
}

.wcp-select {
    width: 100%;
    padding: 8px 28px 8px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--fg-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Space Grotesk', sans-serif;
}

.wcp-select:hover {
    border-color: var(--border-light);
}

.wcp-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(13,148,136,0.18);
}

.wcp-select-arrow {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    pointer-events: none;
    color: var(--fg-muted);
}

/* ── Provider Buttons ── */
.wcp-provider {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 9px 6px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.wcp-provider:hover {
    border-color: var(--border-light);
    background: var(--bg-hover);
}

.wcp-provider.selected {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(13,148,136,0.12), rgba(13,148,136,0.04));
    box-shadow: 0 0 0 1px var(--accent-primary), 0 3px 12px rgba(13,148,136,0.12);
}

.wcp-provider.selected::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background: var(--accent-primary);
    clip-path: polygon(100% 0, 0 0, 100% 100%);
}

.wcp-provider-name {
    font-size: 10.5px;
    font-weight: 800;
    color: var(--fg-primary);
    letter-spacing: -0.01em;
}

.wcp-provider.selected .wcp-provider-name {
    color: var(--accent-primary);
}

.wcp-provider-sub {
    font-size: 8px;
    color: var(--fg-muted);
    font-weight: 500;
}

/* ── Inputs ── */
.wcp-input {
    width: 100%;
    padding: 9px 12px;
    font-size: 11px;
    color: var(--fg-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: 'Space Grotesk', sans-serif;
}

.wcp-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(13,148,136,0.15);
}

/* ── Toggle Switch ── */
.wcp-toggle {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: background 0.25s, border-color 0.25s;
    cursor: pointer;
}

.wcp-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: var(--fg-muted);
    border-radius: 50%;
    transition: transform 0.25s, background 0.25s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.peer:checked ~ .wcp-toggle,
input:checked + .wcp-toggle {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.peer:checked ~ .wcp-toggle::after,
input:checked + .wcp-toggle::after {
    transform: translateX(14px);
    background: var(--bg-void);
}

/* ── Card: Apariencia & Slider ── */
.wcp-slider-wrapper {
    position: relative;
    width: 100%;
    margin-top: 10px;
}

/* Máscara de desvanecimiento en los bordes */
.wcp-slider-wrapper::before,
.wcp-slider-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.3s;
}

.wcp-slider-wrapper::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-card), transparent);
}

.wcp-slider-wrapper::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-card), transparent);
}

.wcp-theme-slider {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 4px 10px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.custom-scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.custom-scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.wcp-theme-slider .theme-btn {
    flex: 0 0 120px; /* Ancho fijo para cada slide */
    scroll-snap-align: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    justify-content: center;
    flex-direction: column;
    padding: 12px 8px;
    height: auto;
    min-height: 70px;
}

.wcp-theme-slider .theme-btn:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
    transform: translateY(-2px);
}

.wcp-theme-slider .theme-btn.selected {
    background: linear-gradient(135deg, rgba(13,148,136,0.1), rgba(13,148,136,0.02));
    border-color: var(--accent-primary);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2), 0 0 0 1px var(--accent-primary);
}

.wcp-theme-slider .wcp-grid-icon {
    margin-bottom: 6px;
    opacity: 0.8;
}

.wcp-theme-slider span {
    font-size: 9.5px;
    font-weight: 700;
    white-space: nowrap;
}

/* ── Tab content animation ── */
.wcp-tab-content {
    animation: wcpFadeIn 0.2s ease-out;
}

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

/* Isolated Logo Submenu Styles (Independiente de etiquetas button) */
#logoSubmenu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 160px;
    background: var(--bg-card);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--accent-primary);
    border-radius: 0 0 12px 12px;
    padding: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    z-index: 1000;
    display: none;
    flex-direction: column;
    gap: 2px;
}

#logoSubmenu:not(.hidden) {
    display: flex;
    animation: panelIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pro-file-menu-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    padding: 12px 18px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--fg-primary);
    -webkit-user-select: none;
    user-select: none;
}

.pro-file-menu-item span {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    opacity: 0.8;
}

.pro-file-menu-item svg {
    width: 15px;
    height: 15px;
    stroke: var(--accent-primary);
    stroke-width: 2.2;
    transition: all 0.2s ease;
}

.pro-file-menu-item:hover {
    background: var(--accent-primary);
    color: var(--bg-void);
    transform: translateX(4px);
}

.pro-file-menu-item:hover span {
    opacity: 1;
}

.pro-file-menu-item:hover svg {
    stroke: var(--bg-void);
    transform: scale(1.15);
}

.pro-file-menu-item:active {
    transform: scale(0.96) translateX(2px);
}

/* ==========================================
   ?? ESTILOS: M�TODOS DE ESTUDIO IA
   ========================================== */

.sd-opt-btn {
    background: var(--bg-void);
    border: 1px solid var(--border);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sd-opt-btn:hover {
    border-color: var(--accent-primary);
    background: rgba(13, 148, 136, 0.05);
    transform: translateX(4px);
}

.sd-disc-btn.active {
    background: var(--accent-glow);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    font-weight: 700;
}

.report-content h1 { font-size: 15px; font-weight: bold; color: var(--accent-primary); margin-bottom: 8px; margin-top: 16px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.report-content h2 { font-size: 13px; font-weight: bold; color: var(--highlight); margin-bottom: 8px; margin-top: 12px; }
.report-content h3 { font-size: 12px; font-weight: bold; color: var(--info); margin-bottom: 4px; margin-top: 8px; }
.report-content p { margin-bottom: 8px; line-height: 1.5; color: var(--fg-primary); }
.report-content ul { list-style-type: disc; margin-left: 20px; margin-bottom: 12px; color: var(--fg-secondary); }
.report-content li { margin-bottom: 4px; }
.report-content strong { color: var(--accent-primary); font-weight: 600; }

.report-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin: 10px 0;
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-spin-slow {
    animation: spin-slow 3s linear infinite;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 10px;
}

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

/* ==========================================
   PRESENTATION MODE (PREZI STYLE)
   ========================================== */

/* State class added to body when presenting */
body.is-presenting {
    overflow: hidden !important;
}

body.is-presenting .top-floating-toolbar,
body.is-presenting #leftPanel,
body.is-presenting #aiSidebar,
body.is-presenting #configSidebar,
body.is-presenting #clearBtn,
body.is-presenting #themeToggle,
body.is-presenting #zoomControls {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(-20px) !important;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* Ensure canvas expands cleanly if needed, though it's typically full screen anyway */
body.is-presenting main {
    flex: 1 1 100vw !important;
    width: 100vw !important;
}

#presentationOverlay {
    transform: translate(-50%, 20px) scale(0.9);
}

#presentationOverlay.opacity-100 {
    transform: translate(-50%, 0) scale(1);
}

/* Frame list specific styles */
#presentationFramesList::-webkit-scrollbar {
    width: 4px;
}
#presentationFramesList::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 4px;
}



/* Ocultar UI durante modo presentaci�n */
body.is-presenting #selectionToolbar,
body.is-presenting #selectionToolbarHandle,
body.is-presenting .top-toolbar-container,
body.is-presenting .absolute.bottom-4.left-4 {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Tooltip abajo para el bot�n de limpiar */
#clearBtn[data-tooltip]:hover::after {
    left: 50%;
    top: calc(100% + 4px);
    transform: translateX(-50%);
    animation: tooltipFadeInBottom 0.2s ease-out forwards;
}

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

#clearBtn[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    left: 50%;
    top: calc(100% + 4px);
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--bg-elevated);
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    animation: tooltipFadeInBottom 0.2s ease-out forwards;
}



