/* 
 * KMB J.A.R.V.I.S Web Assistant Stylesheet
 * Cyberpunk Glassmorphism Futuristic UI
 */

:root {
    --bg-dark: #080b12;
    --bg-panel: rgba(14, 20, 32, 0.75);
    --bg-panel-border: rgba(0, 240, 255, 0.2);
    --cyan-glow: #00f0ff;
    --blue-accent: #0072ff;
    --green-glow: #00ff88;
    --purple-glow: #a855f7;
    --pink-glow: #ec4899;
    --red-alert: #ff3366;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --font-heading: 'Orbitron', sans-serif;
    --font-sub: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(8, 11, 18, 0.8);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.4);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--cyan-glow);
}

/* Background Glow Effects */
.bg-glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
}
.orb-1 {
    width: 450px;
    height: 450px;
    background: rgba(0, 240, 255, 0.15);
    top: -100px;
    left: -100px;
}
.orb-2 {
    width: 500px;
    height: 500px;
    background: rgba(0, 114, 255, 0.15);
    bottom: -150px;
    right: -150px;
}

.cyber-grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--bg-panel-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.6),
                inset 0 0 15px rgba(0, 240, 255, 0.05);
    border-radius: 16px;
    position: relative;
    z-index: 1;
}

/* Installer & Login Wrapper */
.installer-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.installer-wrapper {
    width: 100%;
    max-width: 650px;
    z-index: 10;
}

.installer-card {
    padding: 35px 40px;
}

.login-card {
    max-width: 480px;
    margin: 0 auto;
}

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

.installer-header.text-center {
    flex-direction: column;
    text-align: center;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.brand-logo h2, .installer-header h2 {
    font-family: var(--font-heading);
    font-weight: 800;
    color: #fff;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.subtitle {
    font-family: var(--font-sub);
    font-size: 1rem;
    color: var(--cyan-glow);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.version-tag {
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid var(--cyan-glow);
    color: var(--cyan-glow);
    padding: 4px 10px;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-size: 0.75rem;
}

/* Step Progress Bar */
.step-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 30px;
}

.progress-line {
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--blue-accent), var(--cyan-glow));
    box-shadow: 0 0 10px var(--cyan-glow);
    transition: width 0.4s ease;
}

.step-item {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.step-number {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #0f172a;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.step-item.active .step-number {
    border-color: var(--cyan-glow);
    color: var(--cyan-glow);
    box-shadow: 0 0 15px var(--cyan-glow);
    background: rgba(0, 240, 255, 0.1);
}

.step-item.completed .step-number {
    background: var(--green-glow);
    border-color: var(--green-glow);
    color: #000;
    box-shadow: 0 0 12px var(--green-glow);
}

.step-title {
    font-family: var(--font-sub);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.step-item.active .step-title {
    color: #fff;
}

/* Forms & Inputs */
.form-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.form-step.active {
    display: block;
}

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

.step-heading {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 5px;
}

.step-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}

.input-group label {
    font-family: var(--font-sub);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cyan-glow);
    letter-spacing: 0.5px;
}

.input-group input, .input-group select, .input-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.input-group input:focus, .input-group select:focus, .input-group textarea:focus {
    border-color: var(--cyan-glow);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
    background: rgba(15, 23, 42, 0.95);
}

.field-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    gap: 15px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-family: var(--font-sub);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--blue-accent), #00c6ff);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 114, 255, 0.4);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(0, 240, 255, 0.6);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--cyan-glow);
    color: var(--cyan-glow);
}
.btn-outline:hover {
    background: rgba(0, 240, 255, 0.15);
    box-shadow: 0 0 12px var(--cyan-glow);
}

.btn-success {
    background: linear-gradient(135deg, #10b981, var(--green-glow));
    color: #000;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
}
.btn-success:hover {
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.7);
    transform: translateY(-2px);
}

.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-full {
    width: 100%;
}

/* Alerts */
.cyber-alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid;
}

.cyber-alert.hidden { display: none; }

.cyber-alert.success-alert {
    background: rgba(16, 185, 129, 0.15);
    border-color: #10b981;
    color: var(--green-glow);
}

.cyber-alert.error-alert {
    background: rgba(255, 51, 102, 0.15);
    border-color: var(--red-alert);
    color: #ff6b8b;
}

.cyber-alert.info-alert {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--cyan-glow);
    color: var(--cyan-glow);
}

/* License Info Card */
.license-info-card {
    display: flex;
    gap: 15px;
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}
.license-icon {
    font-size: 1.8rem;
    color: var(--cyan-glow);
}
.license-info-card h4 {
    font-family: var(--font-sub);
    font-size: 1rem;
    color: #fff;
}
.license-info-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Arc Reactor Animation */
.arc-reactor-mini, .arc-reactor-main {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--cyan-glow);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 15px var(--cyan-glow);
}

.arc-reactor-main {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px auto;
    border-width: 3px;
    box-shadow: 0 0 25px var(--cyan-glow), inset 0 0 15px var(--cyan-glow);
}

.arc-reactor-mini .core, .arc-reactor-main .core {
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 12px #fff, 0 0 25px var(--cyan-glow);
}
.arc-reactor-main .core {
    width: 26px;
    height: 26px;
}

.arc-reactor-main .ring-1 {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 2px dashed var(--cyan-glow);
    border-radius: 50%;
    animation: rotateCW 6s linear infinite;
}

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

/* Login Page Styling */
.login-form {
    margin-top: 20px;
}
.login-footer {
    margin-top: 25px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========================================================= */
/* DASHBOARD STYLES                                          */
/* ========================================================= */

.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    background: rgba(10, 15, 26, 0.9);
    border-right: 1px solid var(--bg-panel-border);
    padding: 25px 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 35px;
    padding-left: 10px;
}

.sidebar-brand h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: #fff;
    letter-spacing: 1px;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-muted);
    font-family: var(--font-sub);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-link:hover, .nav-link.active {
    background: rgba(0, 240, 255, 0.12);
    color: var(--cyan-glow);
    box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.1);
}

.nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 15px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-accent), var(--purple-glow));
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    color: #fff;
}

/* Main Content Area */
.main-content {
    padding: 25px 35px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    max-height: 100vh;
    overflow-y: auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-title h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: #fff;
}

.system-status-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(0, 240, 255, 0.2);
    padding: 8px 16px;
    border-radius: 30px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--green-glow);
    box-shadow: 0 0 10px var(--green-glow);
    animation: pulseDot 2s infinite;
}

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

.clock-display {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--cyan-glow);
}

/* Dashboard Tab Panels */
.tab-panel {
    display: none;
    animation: fadeIn 0.4s ease;
}
.tab-panel.active {
    display: block;
}

/* J.A.R.V.I.S Console HUD */
.console-card {
    padding: 25px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 25px;
    align-items: center;
    margin-bottom: 25px;
}

.jarvis-avatar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.arc-reactor-large {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 3px solid var(--cyan-glow);
    box-shadow: 0 0 35px var(--cyan-glow), inset 0 0 25px var(--cyan-glow);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.arc-reactor-large .core-glow {
    width: 45px;
    height: 45px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 20px #fff, 0 0 40px var(--cyan-glow);
    animation: pulseCore 3s ease-in-out infinite;
}

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

.voice-status-text {
    font-family: var(--font-sub);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cyan-glow);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.console-output-box {
    background: rgba(8, 11, 18, 0.85);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 12px;
    padding: 20px;
    height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-msg {
    padding: 10px 15px;
    border-radius: 10px;
    max-width: 85%;
    font-size: 0.95rem;
    line-height: 1.4;
}

.chat-msg.jarvis {
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: #fff;
    align-self: flex-start;
}

.chat-msg.user {
    background: rgba(0, 114, 255, 0.2);
    border: 1px solid rgba(0, 114, 255, 0.4);
    color: #fff;
    align-self: flex-end;
}

/* Mic & Command Bar */
.command-input-bar {
    display: flex;
    gap: 12px;
    margin-top: 15px;
}

.mic-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-accent), var(--cyan-glow));
    border: none;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 15px var(--cyan-glow);
    transition: all 0.3s ease;
}

.mic-btn.listening {
    background: linear-gradient(135deg, #ff3366, #ff6b8b);
    box-shadow: 0 0 25px var(--red-alert);
    animation: micPulse 1.2s infinite;
}

@keyframes micPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Feature Grid Cards */
.grid-cards-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.grid-cards-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

.feature-card {
    padding: 22px;
}

.feature-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.feature-header i {
    font-size: 1.4rem;
    color: var(--cyan-glow);
}

.feature-header h3 {
    font-family: var(--font-sub);
    font-size: 1.2rem;
    color: #fff;
}

/* Table styling */
.cyber-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.cyber-table th {
    background: rgba(0, 240, 255, 0.1);
    color: var(--cyan-glow);
    font-family: var(--font-sub);
    font-size: 0.9rem;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
}

.cyber-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    color: var(--text-main);
}

/* Leaflet Map Box */
#mapBox {
    width: 100%;
    height: 320px;
    border-radius: 12px;
    border: 1px solid var(--bg-panel-border);
    margin-top: 15px;
}

/* Video / Camera Preview */
.camera-preview {
    width: 100%;
    height: 300px;
    background: #000;
    border-radius: 12px;
    border: 1px solid var(--cyan-glow);
    object-fit: cover;
}

/* Quick App Launchers Grid */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.app-item {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 12px;
    padding: 18px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.app-item:hover {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--cyan-glow);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 240, 255, 0.3);
}

.app-item i {
    font-size: 2rem;
    color: var(--cyan-glow);
}

.app-item span {
    font-family: var(--font-sub);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none;
    }
    .console-card {
        grid-template-columns: 1fr;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
}
