/* css/styles.css - Estilos Premium Cyberpunk / Glassmorphic para Nexia */

:root {
    --bg-base: hsl(230, 30%, 6%);
    --bg-surface: rgba(17, 19, 36, 0.65);
    --bg-surface-opaque: hsl(230, 25%, 10%);
    --bg-sidebar: hsl(230, 28%, 5%);
    
    --color-primary: hsl(265, 85%, 62%);
    --color-primary-glow: hsla(265, 85%, 62%, 0.35);
    --color-secondary: hsl(192, 95%, 50%);
    --color-secondary-glow: hsla(192, 95%, 50%, 0.3);
    --color-success: hsl(145, 85%, 45%);
    --color-warning: hsl(35, 95%, 55%);
    --color-danger: hsl(350, 85%, 55%);
    
    --text-main: hsl(220, 30%, 94%);
    --text-muted: hsl(220, 14%, 65%);
    --text-dark: hsl(220, 20%, 15%);
    
    --border-light: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(140, 66, 255, 0.25);
    
    --shadow-premium: 0 15px 35px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 25px rgba(140, 66, 255, 0.15);
    
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* RESET GENERAL */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-body);
    height: 100vh;
    overflow: hidden;
    position: relative;
    display: flex;
}

/* EFECTO DE RESPLANDOR DE FONDO */
body::before {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, hsla(265, 85%, 62%, 0.12) 0%, rgba(0,0,0,0) 70%);
    z-index: -2;
    pointer-events: none;
}

body::after {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, hsla(192, 95%, 50%, 0.08) 0%, rgba(0,0,0,0) 70%);
    z-index: -2;
    pointer-events: none;
}

/* SCROLLBAR PERSONALIZADO */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: rgba(140, 66, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
    box-shadow: 0 0 8px var(--color-primary-glow);
}

/* APP LAYOUT */
.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* SIDEBAR STYLES */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 45px;
    padding-left: 10px;
}

.logo-icon-wrapper {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--color-primary-glow);
}

.brain-glow-icon {
    font-size: 1.25rem;
    color: #fff;
    animation: pulseGlow 3s infinite ease-in-out;
}

.sidebar-logo h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-logo h2 span {
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 18px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 12px;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.menu-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    transition: var(--transition-smooth);
}

.menu-item:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.03);
}

.menu-item.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(140, 66, 255, 0.15) 0%, rgba(0, 229, 255, 0.05) 100%);
    border: 1px solid var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.menu-item.active i {
    color: var(--color-secondary);
    text-shadow: 0 0 10px var(--color-secondary-glow);
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-indicator-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background-color: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
}

.status-dot.offline {
    background-color: var(--color-danger);
    box-shadow: 0 0 8px var(--color-danger);
}

.status-text {
    color: var(--text-muted);
}

.version-tag {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.25);
    font-family: monospace;
}

/* MAIN CONTENT */
.main-content {
    flex-grow: 1;
    height: 100vh;
    overflow-y: auto;
    position: relative;
    padding: 0;
}

/* TAB PANELS */
.tab-panel {
    display: none;
    height: 100%;
    flex-direction: column;
    padding: 30px 40px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.tab-panel.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* PANEL HEADER */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-shrink: 0;
}

.panel-header h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 5px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* BUTTONS */
.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(140, 66, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(140, 66, 255, 0.5);
    filter: brightness(1.1);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-danger) 0%, hsl(340, 95%, 45%) 100%);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(255, 35, 35, 0.2);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 35, 35, 0.4);
    filter: brightness(1.1);
}

/* INTERNET TOGGLE SWITCH */
.internet-switch-container {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 20px;
    border-radius: 16px;
    border: 1px solid var(--border-light);
}

.switch-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.switch-label i {
    color: var(--color-secondary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border: 1px solid rgba(255,255,255,0.05);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: .4s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

input:checked + .slider {
    background-color: rgba(140, 66, 255, 0.4);
    border-color: var(--border-glow);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--color-primary);
}

input:checked + .slider:before {
    transform: translateX(24px);
    background-color: var(--color-secondary);
    box-shadow: 0 0 10px var(--color-secondary);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* CHAT LAYOUT & COMPONENT */
.chat-layout {
    display: flex;
    gap: 30px;
    flex-grow: 1;
    height: calc(100vh - 140px);
    min-height: 0;
}

.chat-main-panel {
    flex-grow: 1;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* NEURAL CANVAS IN BACKGROUND */
.neural-canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.3;
}

#neural-net-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    z-index: 1;
}

/* CHAT MESSAGES STYLING */
.message {
    display: flex;
    gap: 20px;
    max-width: 85%;
    animation: slideInMsg 0.35s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-message .msg-avatar {
    background: linear-gradient(135deg, hsl(190, 90%, 40%) 0%, var(--color-secondary) 100%);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.25);
    color: #fff;
}

.system-message .msg-avatar {
    background: linear-gradient(135deg, var(--color-primary) 0%, hsl(280, 85%, 50%) 100%);
    box-shadow: 0 0 10px var(--color-primary-glow);
    color: #fff;
}

.msg-content {
    background: rgba(255, 255, 255, 0.04);
    padding: 16px 20px;
    border-radius: 18px;
    border: 1px solid var(--border-light);
    line-height: 1.6;
    font-size: 0.95rem;
}

.user-message .msg-content {
    background: rgba(140, 66, 255, 0.08);
    border-color: rgba(140, 66, 255, 0.2);
    border-top-right-radius: 4px;
}

.system-message .msg-content {
    border-top-left-radius: 4px;
}

.msg-content p {
    margin-bottom: 12px;
}

.msg-content p:last-child {
    margin-bottom: 0;
}

.msg-content ul, .msg-content ol {
    margin-left: 20px;
    margin-bottom: 12px;
}

.msg-content code {
    background: rgba(0, 0, 0, 0.4);
    padding: 3px 6px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--color-secondary);
}

.msg-content pre {
    background: rgba(0, 0, 0, 0.5);
    padding: 15px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 15px 0;
    border: 1px solid rgba(255,255,255,0.05);
}

.msg-content pre code {
    background: transparent;
    padding: 0;
    color: var(--text-main);
    font-size: 0.85rem;
}

.msg-content a {
    color: var(--color-secondary);
    text-decoration: none;
    border-bottom: 1px dashed var(--color-secondary);
    transition: var(--transition-smooth);
}

.msg-content a:hover {
    color: #fff;
    border-bottom-style: solid;
}

/* THINKING INDICATOR */
.thinking-loader {
    display: none;
    align-items: center;
    gap: 15px;
    padding: 15px 30px;
    background: rgba(20, 22, 38, 0.8);
    border-top: 1px solid var(--border-light);
    z-index: 1;
}

.loader-pulse {
    width: 14px;
    height: 14px;
    background-color: var(--color-secondary);
    border-radius: 50%;
    animation: heartPulse 1.2s infinite ease-in-out;
    box-shadow: 0 0 10px var(--color-secondary);
}

.thinking-text {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-style: italic;
}

/* CHAT INPUT AREA */
.chat-input-area {
    padding: 20px 30px;
    background: rgba(14, 16, 30, 0.7);
    border-top: 1px solid var(--border-light);
    z-index: 1;
}

.input-wrapper {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 8px 12px;
    align-items: center;
    transition: var(--transition-smooth);
}

.input-wrapper:focus-within {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
    background: rgba(255, 255, 255, 0.05);
}

.input-wrapper textarea {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 8px;
    resize: none;
    outline: none;
    max-height: 150px;
}

.btn-send {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 10px rgba(140, 66, 255, 0.2);
    flex-shrink: 0;
}

.btn-send:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(140, 66, 255, 0.4);
}

.btn-send i {
    font-size: 1rem;
}

/* THOUGHTS SIDEBAR */
.chat-thoughts-sidebar {
    width: 320px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-shrink: 0;
}

.sidebar-header-glow {
    padding: 20px;
    background: linear-gradient(180deg, rgba(140, 66, 255, 0.1) 0%, rgba(0,0,0,0) 100%);
    border-bottom: 1px solid var(--border-light);
}

.sidebar-header-glow h3 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
}

.sidebar-header-glow h3 i {
    color: var(--color-primary);
}

.thoughts-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-family: monospace;
    font-size: 0.8rem;
}

.thought-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.15);
    text-align: center;
    padding: 20px;
    gap: 15px;
}

.thought-placeholder i {
    font-size: 3rem;
}

.thought-placeholder p {
    font-size: 0.82rem;
    font-family: var(--font-body);
    line-height: 1.5;
}

.thought-step {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid var(--color-primary);
    border-radius: 4px;
    color: var(--text-muted);
    line-height: 1.4;
    animation: slideInMsg 0.3s ease forwards;
}

.thought-step.completed {
    border-left-color: var(--color-secondary);
    color: var(--text-main);
}

.learning-alert-panel {
    display: none;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15) 0%, rgba(0, 0, 0, 0.2) 100%);
    border-top: 1px solid rgba(46, 204, 113, 0.3);
    color: #fff;
}

.learning-notifier-title {
    font-weight: 700;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-success);
    margin-bottom: 5px;
}

.pulsing-bulb {
    animation: bulbPulse 1.5s infinite alternate;
}

#learning-notifier-text {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-muted);
}

/* TAB: APRENDER (CONOCIMIENTOS) */
.knowledge-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    gap: 20px;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 10px 18px;
    width: 350px;
    transition: var(--transition-smooth);
}

.search-box:focus-within {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.search-box i {
    color: var(--text-muted);
    margin-right: 12px;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    width: 100%;
}

.category-filters {
    display: flex;
    gap: 10px;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.filter-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.filter-btn.active {
    background: rgba(140, 66, 255, 0.12);
    border-color: var(--border-glow);
    color: var(--color-secondary);
}

/* TABLES STYLING (GLASS CARD) */
.glass-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.table-container {
    overflow-x: auto;
    flex-grow: 1;
}

.memory-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.memory-table th, .memory-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
}

.memory-table th {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.memory-table td {
    font-size: 0.92rem;
    color: var(--text-main);
    vertical-align: middle;
}

.memory-table tbody tr {
    transition: var(--transition-smooth);
}

.memory-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.memory-table td .tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.05);
}

.tag-general { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }
.tag-usuario { background: rgba(52, 152, 219, 0.15); color: hsl(200, 95%, 60%); border-color: rgba(52, 152, 219, 0.2); }
.tag-preferencias { background: rgba(155, 89, 182, 0.15); color: hsl(280, 95%, 70%); border-color: rgba(155, 89, 182, 0.2); }
.tag-identidad { background: rgba(241, 196, 15, 0.15); color: var(--color-warning); border-color: rgba(241, 196, 15, 0.2); }
.tag-internet { background: rgba(46, 204, 113, 0.15); color: var(--color-success); border-color: rgba(46, 204, 113, 0.2); }
.tag-aprendido { background: rgba(224, 86, 253, 0.15); color: hsl(290, 95%, 70%); border-color: rgba(224, 86, 253, 0.2); }

.importance-dots {
    display: flex;
    gap: 4px;
}

.importance-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
}

.importance-dot.filled {
    background-color: var(--color-warning);
    box-shadow: 0 0 5px var(--color-warning);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    color: var(--color-danger);
    background-color: rgba(255, 35, 35, 0.1);
}

.text-center {
    text-align: center;
}

/* TAB: CREACIONES (CREAR) */
.disk-usage-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px 20px;
    border-radius: 14px;
    border: 1px solid var(--border-light);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.disk-usage-info i {
    color: var(--color-secondary);
}

.creations-container {
    flex-grow: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

.creations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.creation-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 18px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.creation-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow), var(--shadow-premium);
}

.creation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--color-primary);
}

.creation-card.type-html::before { background: #e34c26; }
.creation-card.type-css::before { background: #264de4; }
.creation-card.type-js::before { background: #f0db4f; }
.creation-card.type-php::before { background: #777bb4; }
.creation-card.type-txt::before { background: var(--text-muted); }

.creation-icon-wrapper {
    font-size: 2.2rem;
    color: rgba(255, 255, 255, 0.35);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.creation-icon-wrapper i.active-file {
    color: var(--color-secondary);
    text-shadow: 0 0 10px var(--color-secondary-glow);
}

.creation-info h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 6px;
    word-break: break-all;
}

.creation-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.creation-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-card {
    flex-grow: 1;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-heading);
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition-smooth);
}

.btn-card-view {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-light);
    color: var(--text-main);
}

.btn-card-view:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-card-download {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border: none;
    color: #fff;
}

.btn-card-download:hover {
    filter: brightness(1.1);
}

.no-creations-placeholder {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.2);
    text-align: center;
    gap: 15px;
}

.no-creations-placeholder i {
    font-size: 4rem;
}

.no-creations-placeholder h3 {
    font-family: var(--font-heading);
    color: var(--text-muted);
}

.no-creations-placeholder p {
    font-size: 0.9rem;
    max-width: 400px;
    line-height: 1.5;
}

/* TAB: ESTADO Y CONFIGURACIÓN */
.config-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.config-main-card {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.config-main-card h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-main-card h3 i {
    color: var(--color-primary);
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: -15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-group label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
}

.input-with-button {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.input-with-button:focus-within {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-glow);
}

.input-with-button input {
    flex-grow: 1;
    background: transparent;
    border: none;
    padding: 12px 16px;
    color: var(--text-main);
    font-family: var(--font-body);
    outline: none;
    font-size: 0.92rem;
}

.btn-toggle-pwd {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0 16px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-toggle-pwd:hover {
    color: var(--color-secondary);
}

.help-text {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.help-text a {
    color: var(--color-secondary);
    text-decoration: none;
}

.divider {
    height: 1px;
    background-color: var(--border-light);
    margin: 10px 0;
}

.config-sidebar-panel {
    width: 360px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    flex-shrink: 0;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.stat-card h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-card h3 i {
    color: var(--color-secondary);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 10px;
}

.stat-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.stat-label {
    color: var(--text-muted);
}

.stat-value {
    font-weight: 600;
}

.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }

.logs-card {
    display: flex;
    flex-direction: column;
    height: 300px;
    overflow: hidden;
}

.logs-card h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logs-console {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 15px;
    font-family: monospace;
    font-size: 0.72rem;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-muted);
}

.log-line.system { color: hsl(200, 30%, 60%); }
.log-line.chat { color: hsl(280, 80%, 75%); }
.log-line.memoria { color: var(--color-warning); }
.log-line.internet { color: var(--color-success); }

/* MODALS STYLING */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 500px;
    max-width: 100%;
    animation: zoomIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-lg {
    width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-close-modal:hover {
    color: #fff;
}

#memory-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#memory-form input, #memory-form textarea, #memory-form select {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text-main);
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition-smooth);
}

#memory-form input:focus, #memory-form textarea:focus, #memory-form select:focus {
    border-color: var(--border-glow);
}

.form-group-row {
    display: flex;
    gap: 15px;
}

.form-group-row .form-group {
    flex-grow: 1;
    margin-bottom: 0;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* CODE VIEWER MODAL */
.creation-modal-body {
    max-height: 450px;
    overflow-y: auto;
    border-radius: 12px;
}

.code-viewer-container {
    background: rgba(0,0,0,0.5);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
}

.code-viewer-container pre {
    margin: 0;
}

.code-viewer-container code {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-main);
    white-space: pre-wrap;
    word-break: break-all;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
}

/* ANIMATIONS */
@keyframes pulseGlow {
    0% { transform: scale(1); text-shadow: 0 0 10px var(--color-primary-glow); }
    50% { transform: scale(1.05); text-shadow: 0 0 20px var(--color-primary), 0 0 30px var(--color-secondary); }
    100% { transform: scale(1); text-shadow: 0 0 10px var(--color-primary-glow); }
}

@keyframes heartPulse {
    0% { transform: scale(0.95); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 15px var(--color-secondary); }
    100% { transform: scale(0.95); opacity: 0.5; }
}

@keyframes bulbPulse {
    from { filter: drop-shadow(0 0 2px var(--color-success)); }
    to { filter: drop-shadow(0 0 10px var(--color-success)); }
}

@keyframes slideInMsg {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* RESPONSIVITY */
@media (max-width: 1200px) {
    .chat-thoughts-sidebar {
        display: none; /* Oculta en pantallas más pequeñas */
    }
    .config-layout {
        flex-direction: column;
        align-items: stretch;
    }
    .config-sidebar-panel {
        width: 100%;
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        padding: 15px 20px;
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }
    .sidebar-logo {
        margin-bottom: 15px;
    }
    .sidebar-menu {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .menu-item {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    .tab-panel {
        padding: 20px;
    }
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .search-box {
        width: 100%;
    }
    .knowledge-controls {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ATTACHMENT AND FILE PREVIEW STYLES - premium glassmorphic/cyber */
.btn-attach {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-right: 4px;
    flex-shrink: 0;
}

.btn-attach:hover {
    background: rgba(140, 66, 255, 0.1);
    color: var(--color-secondary);
    border-color: var(--border-glow);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

.file-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
    background: rgba(10, 11, 22, 0.7);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: slideInMsg 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

.file-preview-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 8px 12px;
    gap: 12px;
    position: relative;
    max-width: 280px;
    border-left: 3px solid var(--color-secondary);
    box-shadow: var(--shadow-premium);
    animation: zoomIn 0.2s ease forwards;
}

.file-preview-thumbnail {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-secondary);
    font-size: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.file-preview-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-grow: 1;
}

.file-preview-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-preview-size {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.file-preview-remove {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.file-preview-remove:hover {
    color: var(--color-danger);
    background: rgba(255, 35, 35, 0.1);
}

