/* ==========================================================================
   AETHER CLOUD PANEL - ESTILOS PREMIUM ESTILO EASYPANEL.IO
   ========================================================================== */

:root {
    --bg-base: #09090b;
    --bg-card: rgba(25, 25, 29, 0.4);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --primary-color: #6366f1; /* Indigo */
    --primary-glow: rgba(99, 102, 241, 0.15);
    --success-color: #10b981; /* Emerald */
    --success-glow: rgba(16, 185, 129, 0.2);
    --danger-color: #ef4444; /* Rose */
    --danger-glow: rgba(239, 68, 68, 0.2);
    --warning-color: #f59e0b; /* Amber */
}

/* Reset y Tipografía */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Orbes ambientales */
.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 1;
    pointer-events: none;
    opacity: 0.25;
}

.orb-indigo {
    top: -10%;
    right: 10%;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
}

.orb-fuchsia {
    bottom: 10%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #d946ef 0%, transparent 70%);
}

/* Glassmorphism Panel Template */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

/* Layout General */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 10;
}

/* Sidebar */
.app-sidebar {
    width: 280px;
    min-height: 100vh;
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(9, 9, 11, 0.6);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    align-self: flex-start;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a855f7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--primary-glow);
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(to right, #ffffff, #d4d4d8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-sub {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
    margin-top: 2px;
}

/* Navegación */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.nav-item:hover, .nav-item.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: var(--primary-glow);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.05);
}

/* Logout button override */
.nav-item[onclick="cerrarSesion()"]:hover {
    background: rgba(239, 68, 68, 0.08) !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.1);
    color: var(--danger-color) !important;
}

/* Área Principal */
.main-content {
    flex: 1;
    padding: 2.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    border-b: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.header-title {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(to right, #ffffff, #a1a1aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Botones */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4f46e5 100%);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: all 0.2s;
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Grilla de Métricas */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.metric-card {
    padding: 1.5rem;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
}

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

.metric-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metric-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    margin-top: 0.5rem;
}

.metric-pct {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.pct-violet { background: rgba(99, 102, 241, 0.1); color: var(--primary-color); border: 1px solid rgba(99, 102, 241, 0.2); }
.pct-emerald { background: rgba(16, 185, 129, 0.1); color: var(--success-color); border: 1px solid rgba(16, 185, 129, 0.2); }
.pct-pink { background: rgba(236, 72, 153, 0.1); color: #ec4899; border: 1px solid rgba(236, 72, 153, 0.2); }

.progress-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fill-violet { background: linear-gradient(90deg, var(--primary-color) 0%, #818cf8 100%); }
.fill-emerald { background: linear-gradient(90deg, var(--success-color) 0%, #34d399 100%); }
.fill-pink { background: linear-gradient(90deg, #ec4899 0%, #f472b6 100%); }

/* Lista de Servicios (Aplicaciones) */
.section-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.service-card {
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.service-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 250px;
}

.service-status-orb {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 10px transparent;
    transition: all 0.3s;
}

.status-active {
    background-color: var(--success-color);
    box-shadow: 0 0 8px var(--success-glow);
}

.status-stopped {
    background-color: var(--danger-color);
    box-shadow: 0 0 8px var(--danger-glow);
}

.service-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
}

.service-type {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.service-stats {
    display: flex;
    gap: 2rem;
    font-size: 0.8rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-val {
    font-weight: 700;
    color: #ffffff;
    margin-top: 2px;
}

.service-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-action {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-action:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.btn-action.action-danger:hover {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
}

/* Modal de Logs / Consola Terminal */
.console-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1.5rem;
}

.console-container {
    width: 100%;
    max-width: 800px;
    height: 520px;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.console-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 15, 18, 0.8);
}

.console-body {
    flex: 1;
    background: #040406;
    padding: 1.5rem;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.75rem;
    color: #34d399; /* Green color for console */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.console-line {
    line-height: 1.5;
    word-break: break-all;
    white-space: pre-wrap;
}

/* Login template */
.login-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--bg-base);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border-radius: 24px;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: block;
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.85rem 1rem;
    border-radius: 12px;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(255, 255, 255, 0.05);
}

/* Utilidades */
.hidden { display: none !important; }
.text-emerald { color: var(--success-color) !important; }
.text-rose { color: var(--danger-color) !important; }
.animate-spin {
    animation: spin 1s linear infinite;
}

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

/* ==========================================================================
   VISUAL WORKSPACE EXPLORER - ESTILOS PREMIUM (IDE)
   ========================================================================== */
.tree-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.tree-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
}

.tree-item.active {
    background: rgba(99, 102, 241, 0.08);
    color: #ffffff;
    border-left: 2px solid var(--primary-color);
}

.tree-folder {
    font-weight: 600;
    color: var(--text-primary);
}

.tree-folder-children {
    margin-left: 0.75rem;
    padding-left: 0.5rem;
    border-left: 1px dashed rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.tree-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom scrollbars inside the code editor */
#ide-editor::-webkit-scrollbar,
#file-tree-container::-webkit-scrollbar,
#logs-modal-body::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

#ide-editor::-webkit-scrollbar-track,
#file-tree-container::-webkit-scrollbar-track,
#logs-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

#ide-editor::-webkit-scrollbar-thumb,
#file-tree-container::-webkit-scrollbar-thumb,
#logs-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

#ide-editor::-webkit-scrollbar-thumb:hover,
#file-tree-container::-webkit-scrollbar-thumb:hover,
#logs-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.1);
}
