/* ==========================================================================
   SIMPLES INFO TECH - STATUS PANEL DESIGN SYSTEM
   Theme: Dark Mode Premium, Glassmorphism, HSL tailoreado
   ========================================================================== */

:root {
    /* Color Tokens (HSL) */
    --bg-main: 224 25% 6%;         /* #090b11 */
    --bg-card: 224 24% 10%;        /* rgba(16, 20, 30, 0.6) */
    --border-card: 224 20% 20% / 0.4;
    
    --accent: 38 92% 54%;          /* Amber/Orange #f59e0b */
    --accent-glow: 38 92% 54% / 0.15;
    
    --success: 150 84% 41%;        /* Emerald #10b981 */
    --success-glow: 150 84% 41% / 0.2;
    
    --danger: 345 84% 54%;         /* Neon Red #f43f5e */
    --danger-glow: 345 84% 54% / 0.2;
    
    --warning: 45 93% 47%;         /* Gold #d97706 */
    
    --text-primary: 210 40% 98%;   /* #f8fafc */
    --text-secondary: 215 20% 65%; /* #94a3b8 */
    
    --font-header: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    
    --border-radius-lg: 20px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    
    --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: hsl(var(--bg-main));
    color: hsl(var(--text-primary));
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
}

/* Background Glow Blobs */
.bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(150px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.3;
}

.bg-glow-1 {
    background: radial-gradient(circle, hsl(var(--accent)) 0%, transparent 70%);
    top: -200px;
    right: -100px;
}

.bg-glow-2 {
    background: radial-gradient(circle, hsl(var(--success)) 0%, transparent 70%);
    bottom: -200px;
    left: -100px;
}

/* Layout Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Glassmorphism Cards */
.glass-card {
    background: linear-gradient(135deg, rgba(16, 22, 40, 0.65) 0%, rgba(10, 14, 26, 0.75) 100%);
    backdrop-filter: blur(24px) saturate(190%);
    -webkit-backdrop-filter: blur(24px) saturate(190%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-lg);
    box-shadow: 
        0 16px 48px -12px rgba(0, 0, 0, 0.6),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
    padding: 24px;
}

.glass-card:hover {
    transform: translateY(-2px);
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: 
        0 24px 64px -16px rgba(245, 158, 11, 0.08),
        0 0 20px rgba(245, 158, 11, 0.02),
        inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

/* General Typography */
h1, h2, h3, h4 {
    font-family: var(--font-header);
    color: hsl(var(--text-primary));
    font-weight: 700;
}

h2 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: hsl(var(--text-primary));
    letter-spacing: -0.02em;
}

/* Inputs & Forms */
.form-group {
    margin-bottom: 20px;
    text-align: left;
    width: 100%;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    color: hsl(var(--text-secondary));
    margin-bottom: 8px;
    font-weight: 500;
}

input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    background: rgba(9, 11, 17, 0.6);
    border: 1px solid hsl(var(--border-card));
    border-radius: var(--border-radius-md);
    color: hsl(var(--text-primary));
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition-smooth);
}

input[type="password"]:focus {
    outline: none;
    border-color: hsl(var(--accent));
    box-shadow: 0 0 0 3px hsl(var(--accent-glow));
    background: rgba(9, 11, 17, 0.9);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    font-family: var(--font-header);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-smooth);
    text-decoration: none;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, hsl(var(--accent)) 0%, #d97706 100%);
    color: #000;
    box-shadow: 0 4px 20px -2px hsl(var(--accent-glow));
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px 0 hsl(var(--accent-glow));
    filter: brightness(1.1);
}

.btn-outline {
    background: transparent;
    border-color: hsl(var(--border-card));
    color: hsl(var(--text-primary));
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: hsl(var(--text-secondary));
}

.btn-danger {
    background: hsl(var(--danger));
    color: #fff;
    box-shadow: 0 4px 20px -2px hsl(var(--danger-glow));
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px 0 hsl(var(--danger-glow));
    filter: brightness(1.1);
}

.btn-warning {
    background: hsl(var(--warning));
    color: #000;
    box-shadow: 0 4px 20px -2px rgba(217, 119, 6, 0.2);
}

.btn-warning:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-danger-glow {
    background: transparent;
    border: 1px solid hsl(var(--danger));
    color: hsl(var(--danger));
    box-shadow: inset 0 0 10px rgba(244, 63, 94, 0.05);
}

.btn-danger-glow:hover {
    background: hsl(var(--danger));
    color: #fff;
    box-shadow: 0 0 20px hsl(var(--danger-glow));
    transform: translateY(-2px);
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

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

/* View Sections Toggle */
.view-section {
    display: none;
    min-height: 100vh;
}

.view-section.active {
    display: flex;
    flex-direction: column;
}

/* Login View Styling */
#view-login {
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 440px;
}

.login-card {
    padding: 40px;
    text-align: center;
}

.logo-wrapper {
    margin-bottom: 24px;
    position: relative;
    display: inline-block;
}

.logo-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, hsl(var(--accent-glow)) 0%, transparent 70%);
    filter: blur(10px);
    z-index: -1;
}

.status-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.subtitle {
    font-size: 0.9rem;
    color: hsl(var(--text-secondary));
    margin-bottom: 28px;
    line-height: 1.5;
}

/* Dashboard View Styling */
.main-header {
    background: rgba(10, 14, 25, 0.4);
    border-bottom: 1px solid hsl(var(--border-card));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 16px 0;
}

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

.header-logo-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    height: 48px;
    width: auto;
}

.header-titles h1 {
    font-size: 1.25rem;
    line-height: 1.2;
}

.uptime-text {
    font-size: 0.8rem;
    color: hsl(var(--text-secondary));
    margin-top: 2px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Dashboard Reorganized Layout */
.dashboard-layout {
    padding-top: 40px;
    padding-bottom: 60px;
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 24px;
    align-items: start;
}

.layout-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 100px;
}

.layout-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.main-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.metrics-vertical-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.metric-item {
    background: rgba(9, 11, 17, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-md);
    padding: 18px;
    transition: var(--transition-smooth);
}

.metric-item:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.1);
}

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

.metric-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: hsl(var(--text-secondary));
}

.metric-value {
    font-family: var(--font-header);
    font-size: 1.15rem;
    font-weight: 700;
    color: hsl(var(--text-primary));
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(9, 11, 17, 0.6);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    width: 0%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: linear-gradient(
        45deg, 
        rgba(255, 255, 255, 0.15) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(255, 255, 255, 0.15) 50%, 
        rgba(255, 255, 255, 0.15) 75%, 
        transparent 75%, 
        transparent
    );
    background-size: 16px 16px;
    opacity: 0.4;
    animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
    from { background-position: 0 0; }
    to { background-position: 16px 0; }
}

.progress-fill.warning {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

.progress-fill.danger {
    background: linear-gradient(90deg, #f43f5e 0%, #e11d48 100%);
}

.metric-subtext {
    font-size: 0.75rem;
    color: hsl(var(--text-secondary));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status list items */
.status-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-item {
    background: rgba(9, 11, 17, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--border-radius-md);
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
}

.status-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px currentcolor;
}

.status-dot.active, .status-dot.ok {
    background-color: hsl(var(--success));
    color: hsl(var(--success));
    animation: pulse-green 2s infinite;
}

.status-dot.inactive, .status-dot.error {
    background-color: hsl(var(--danger));
    color: hsl(var(--danger));
    animation: pulse-red 2s infinite;
}

.status-dot.warning {
    background-color: hsl(var(--warning));
    color: hsl(var(--warning));
    animation: pulse-yellow 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(244, 63, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

@keyframes pulse-yellow {
    0% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(217, 119, 6, 0); }
    100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0); }
}

.item-name {
    font-weight: 500;
    font-size: 0.95rem;
}

.item-meta {
    font-size: 0.8rem;
    color: hsl(var(--text-secondary));
}

.badge {
    padding: 4px 10px;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.badge-success {
    background: hsl(var(--success-glow));
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.badge-danger {
    background: hsl(var(--danger-glow));
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.badge-warning {
    background: rgba(217, 119, 6, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

/* Control actions card */
.card-warning-text {
    font-size: 0.85rem;
    color: hsl(var(--text-secondary));
    margin-bottom: 20px;
    line-height: 1.5;
}

.action-buttons-group {
    display: flex;
    gap: 16px;
}

.action-buttons-group .btn {
    flex: 1;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    padding: 32px;
    position: relative;
    border-color: rgba(255, 255, 255, 0.1);
}

.danger-modal {
    border-color: hsl(var(--danger-glow));
    box-shadow: 0 16px 48px -12px rgba(244, 63, 94, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: hsl(var(--text-secondary));
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-smooth);
}

.modal-close:hover {
    color: hsl(var(--text-primary));
}

.modal-body {
    text-align: left;
    margin-bottom: 24px;
}

.modal-body p {
    font-size: 0.9rem;
    color: hsl(var(--text-secondary));
    margin-bottom: 12px;
    line-height: 1.6;
}

.text-danger-glow {
    color: #f43f5e;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(244, 63, 94, 0.3);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Alerts / Notification messages */
.error-msg, .success-msg {
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    font-size: 0.85rem;
    margin-bottom: 16px;
    border: 1px solid;
    text-align: left;
}

.error-msg {
    background: rgba(244, 63, 94, 0.08);
    border-color: rgba(244, 63, 94, 0.2);
    color: #fda4af;
}

.success-msg {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}

.hidden {
    display: none !important;
}

/* Action Overlay (Ripple Loader) */
.overlay-action {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.overlay-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    text-align: center;
    border-color: rgba(255, 255, 255, 0.1);
}

.loader-ripple {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
}

.loader-ripple div {
    position: absolute;
    border: 4px solid hsl(var(--accent));
    opacity: 1;
    border-radius: 50%;
    animation: loader-ripple 1.2s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.loader-ripple div:nth-child(2) {
    animation-delay: -0.6s;
}

@keyframes loader-ripple {
    0% {
        top: 36px;
        left: 36px;
        width: 0;
        height: 0;
        opacity: 0;
    }
    4.9% {
        top: 36px;
        left: 36px;
        width: 0;
        height: 0;
        opacity: 0;
    }
    5% {
        top: 36px;
        left: 36px;
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        top: 0px;
        left: 0px;
        width: 72px;
        height: 72px;
        opacity: 0;
    }
}

.reboot-countdown {
    font-size: 3rem;
    font-weight: 800;
    color: hsl(var(--accent));
    margin-top: 20px;
    font-family: var(--font-header);
    text-shadow: 0 0 15px hsl(var(--accent-glow));
}

.loading-placeholder {
    font-size: 0.9rem;
    color: hsl(var(--text-secondary));
    padding: 20px;
    text-align: center;
    font-style: italic;
}

/* Animations */
.animated {
    animation-duration: 0.4s;
    animation-fill-mode: both;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale3d(0.95, 0.95, 0.95);
    }
    to {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

.zoomIn {
    animation-name: zoomIn;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .layout-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .main-row-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .header-container {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    .header-logo-group {
        flex-direction: column;
        gap: 8px;
    }
    .action-buttons-group {
        flex-direction: column;
        gap: 12px;
    }
    .login-card {
        padding: 30px 20px;
    }
}
