/* IamSafeer AI Hub CSS Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-dark: hsl(224, 71%, 4%);
    --bg-card: hsla(224, 71%, 8%, 0.45);
    --border-color: hsla(263, 90%, 51%, 0.15);
    --border-glow: hsla(190, 90%, 50%, 0.25);
    --primary: hsl(263, 90%, 51%);
    --primary-glow: hsla(263, 90%, 51%, 0.3);
    --accent: hsl(190, 90%, 50%);
    --accent-glow: hsla(190, 90%, 50%, 0.35);
    --text-white: hsl(210, 40%, 98%);
    --text-gray: hsl(215, 20%, 65%);
    --text-muted: hsl(215, 15%, 45%);
    --success: hsl(142, 70%, 45%);
    --danger: hsl(0, 84%, 60%);
    --warning: hsl(38, 92%, 50%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Cosmic Background Particles & Mesh Mesh */
body::before {
    content: '';
    position: absolute;
    top: -20%;
    left: -10%;
    width: 60%;
    height: 70%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 60%);
    filter: blur(140px);
    z-index: -2;
    pointer-events: none;
}

body::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -10%;
    width: 60%;
    height: 70%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
    filter: blur(140px);
    z-index: -2;
    pointer-events: none;
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.glass-panel:hover {
    border-color: var(--border-glow);
    box-shadow: 0 12px 40px 0 rgba(190, 90, 50, 0.08);
    transform: translateY(-4px);
}

/* Neon Glow Headers & Text */
.neon-text-cyan {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}

.neon-text-indigo {
    color: var(--text-white);
    text-shadow: 0 0 10px var(--primary-glow);
}

.gradient-title {
    background: linear-gradient(135deg, var(--text-white) 30%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    letter-spacing: -1px;
}

/* Buttons System */
.btn-neon-primary {
    background: linear-gradient(135deg, var(--primary) 0%, hsl(280, 90%, 55%) 100%);
    color: var(--text-white);
    border: none;
    border-radius: 10px;
    padding: 12px 28px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px var(--primary-glow);
    cursor: pointer;
}

.btn-neon-primary:hover {
    transform: scale(1.03);
    box-shadow: 0 0 25px var(--primary);
    color: #fff;
}

.btn-neon-cyan {
    background: linear-gradient(135deg, var(--accent) 0%, hsl(200, 90%, 50%) 100%);
    color: var(--bg-dark);
    border: none;
    border-radius: 10px;
    padding: 12px 28px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px var(--accent-glow);
    cursor: pointer;
}

.btn-neon-cyan:hover {
    transform: scale(1.03);
    box-shadow: 0 0 25px var(--accent);
}

.btn-outline-glass {
    background: transparent;
    color: var(--text-white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 11px 26px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-glass:hover {
    border-color: var(--accent);
    background: hsla(190, 90%, 50%, 0.05);
    color: #fff;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-glow);
}

/* Input Fields */
.glass-input {
    background: hsla(224, 71%, 6%, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-white) !important;
    border-radius: 10px;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.glass-input:focus {
    background: hsla(224, 71%, 4%, 0.8);
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
    outline: none;
}

/* Tables Styling */
.table-glass {
    width: 100%;
    border-collapse: collapse;
}

.table-glass th {
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table-glass td {
    padding: 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid hsla(224, 71%, 12%, 0.4);
    color: var(--text-gray);
}

.table-glass tr:hover td {
    color: var(--text-white);
    background: hsla(263, 90%, 51%, 0.02);
}

/* Badges */
.badge-neon {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.badge-neon-success {
    background: hsla(142, 70%, 45%, 0.15);
    color: var(--success);
    border: 1px solid hsla(142, 70%, 45%, 0.3);
}

.badge-neon-warning {
    background: hsla(38, 92%, 50%, 0.15);
    color: var(--warning);
    border: 1px solid hsla(38, 92%, 50%, 0.3);
}

.badge-neon-danger {
    background: hsla(0, 84%, 60%, 0.15);
    color: var(--danger);
    border: 1px solid hsla(0, 84%, 60%, 0.3);
}

/* Terminal Console View (for Audit Trails) */
.terminal-console {
    background: hsl(224, 71%, 2%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    color: hsl(120, 100%, 75%);
    font-size: 0.85rem;
    height: 250px;
    overflow-y: auto;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
}

.terminal-line {
    margin-bottom: 8px;
    line-height: 1.4;
    word-break: break-all;
}

.terminal-line::before {
    content: '$ ';
    color: var(--accent);
}

.terminal-timestamp {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-right: 6px;
}

/* Futuristic Cybernetic Avatar & Profile Card Styles */
.operator-profile-card {
    background: linear-gradient(135deg, hsla(224, 71%, 8%, 0.75) 0%, hsla(224, 71%, 4%, 0.9) 100%);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0, 200, 255, 0.05);
    border-radius: 20px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.operator-profile-card:hover {
    border-color: var(--accent);
    box-shadow: 0 12px 40px 0 rgba(0, 200, 255, 0.15), inset 0 0 25px rgba(0, 200, 255, 0.08);
    transform: translateY(-5px);
}

.operator-profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 200, 255, 0.15), transparent);
    transform: skewX(-25deg);
    transition: 0.75s;
    pointer-events: none;
}

.operator-profile-card:hover::before {
    left: 150%;
}

.operator-avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin-right: 20px;
    flex-shrink: 0;
}

.operator-avatar-wrapper::after {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border: 2px dashed var(--accent);
    opacity: 0.7;
    animation: rotateTargetCircle 12s linear infinite;
    pointer-events: none;
}

.operator-avatar-wrapper::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border-radius: 50%;
    border: 1px solid rgba(0, 200, 255, 0.25);
    box-shadow: 0 0 12px rgba(0, 200, 255, 0.15);
    pointer-events: none;
}

.operator-avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.15);
    transition: all 0.4s ease;
    filter: brightness(0.95) contrast(1.05);
}

.operator-profile-card:hover .operator-avatar-image {
    filter: brightness(1.1) contrast(1.1);
    border-color: var(--accent);
    transform: scale(1.05);
}

.operator-scanline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    overflow: hidden;
    pointer-events: none;
}

.operator-scanline::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 40%, rgba(0, 200, 255, 0.3) 50%, transparent 60%);
    animation: scanningLine 3s ease-in-out infinite;
}

@keyframes rotateTargetCircle {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes scanningLine {
    0% { top: -100%; }
    100% { top: 100%; }
}

.operator-info-section {
    flex-grow: 1;
}

.operator-operator-name {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-white);
}

.operator-operator-role {
    font-size: 0.8rem;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.operator-operator-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    margin-top: 5px;
}

.operator-badge-glow {
    box-shadow: 0 0 10px rgba(0, 200, 255, 0.4);
}

/* Technical Telemetry Dashboard & Code Styles */
.tech-command-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 6px;
}

.tech-bracket-indicator {
    color: var(--accent);
    margin-right: 6px;
    font-weight: bold;
}

.tech-node-bar {
    background: hsla(224, 71%, 6%, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
}

.tech-node-bar:hover {
    border-color: var(--accent);
    background: hsla(224, 71%, 8%, 0.85);
    box-shadow: 0 4px 20px rgba(0, 200, 255, 0.08);
}

.code-neon-container {
    background: #02040a;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    overflow-x: auto;
    color: #c9d1d9;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
    line-height: 1.5;
}

.code-neon-keyword {
    color: #ff7b72;
}

.code-neon-type {
    color: #79c0ff;
}

.code-neon-string {
    color: #a5d6ff;
}

.code-neon-comment {
    color: #8b949e;
}

.code-neon-method {
    color: #d2a8ff;
}

.pulsing-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px currentColor;
}

@keyframes progressShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.progress-bar-animated-gradient {
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 50%, var(--primary) 100%);
    background-size: 200% auto;
    animation: progressShift 3s linear infinite;
}

/* --- Sovereign Multi-Agent & Fleet Nexus Styling --- */

.cyber-grid-mesh {
    background-image: 
        linear-gradient(rgba(0, 200, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 200, 255, 0.02) 1px, transparent 1px);
    background-size: 24px 24px;
    border-radius: 20px;
    border: 1px solid rgba(0, 200, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.agent-nexus-card {
    background: hsla(224, 71%, 6%, 0.6);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(0, 200, 255, 0.12);
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

.agent-nexus-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 200, 255, 0.08);
}

.cyber-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.cyber-badge-cyan {
    background: rgba(0, 200, 255, 0.1);
    color: var(--accent);
    border: 1px solid rgba(0, 200, 255, 0.25);
}

.cyber-badge-purple {
    background: rgba(130, 0, 255, 0.1);
    color: hsl(263, 90%, 70%);
    border: 1px solid rgba(130, 0, 255, 0.25);
}

/* Glowing Network SVG Elements */
.nexus-svg-path {
    stroke-dasharray: 6, 6;
    animation: nexusFlow 25s linear infinite;
    stroke-linecap: round;
    transition: stroke 0.3s, stroke-width 0.3s;
}

.nexus-svg-path-active {
    stroke-dasharray: 6, 6;
    animation: nexusFlowActive 8s linear infinite;
    stroke-linecap: round;
}

@keyframes nexusFlow {
    to {
        stroke-dashoffset: -500;
    }
}

@keyframes nexusFlowActive {
    to {
        stroke-dashoffset: -500;
    }
}

/* Pulsing Agent Core Spheres */
.nexus-node-core {
    position: relative;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: hsla(224, 71%, 8%, 0.9);
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px var(--accent-glow);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    z-index: 10;
}

.nexus-node-core:hover {
    transform: scale(1.08);
    box-shadow: 0 0 25px var(--accent);
}

.nexus-node-core.purple {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.nexus-node-core.purple:hover {
    box-shadow: 0 0 25px var(--primary);
}

.nexus-avatar-img {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.nexus-node-core:hover .nexus-avatar-img {
    border-color: var(--accent);
}

.nexus-node-core.purple:hover .nexus-avatar-img {
    border-color: var(--primary);
}

/* Peripheral Fleet Shards */
.nexus-fleet-node {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: hsl(224, 71%, 10%);
    border: 2px solid var(--accent-glow);
    transition: all 0.4s ease;
    cursor: pointer;
}

.nexus-fleet-node:hover, .nexus-fleet-node.active {
    background: var(--accent);
    border-color: #fff;
    box-shadow: 0 0 12px var(--accent);
    transform: scale(1.25);
}

.nexus-fleet-node.purple {
    border-color: var(--primary-glow);
}

.nexus-fleet-node.purple:hover, .nexus-fleet-node.purple.active {
    background: var(--primary);
    border-color: #fff;
    box-shadow: 0 0 12px var(--primary);
    transform: scale(1.25);
}

/* Cyber Accent Corners */
.cyber-corners {
    position: relative;
}

.cyber-corners::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    border-top: 2px solid var(--accent);
    border-left: 2px solid var(--accent);
    pointer-events: none;
}

.cyber-corners::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 8px;
    height: 8px;
    border-bottom: 2px solid var(--accent);
    border-right: 2px solid var(--accent);
    pointer-events: none;
}

.cyber-corners.purple::before {
    border-top-color: var(--primary);
    border-left-color: var(--primary);
}

.cyber-corners.purple::after {
    border-bottom-color: var(--primary);
    border-right-color: var(--primary);
}

/* Scroll-triggered reveal animations */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Hover Zoom Elements */
.hover-glow-scale {
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.hover-glow-scale:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 25px rgba(0, 200, 255, 0.12);
}

/* PWA & Mobile Device Responsiveness */
@media (max-width: 767.98px) {
    .glass-panel {
        padding: 16px !important;
        border-radius: 12px !important;
    }
    .fab-btn {
        bottom: 20px;
        right: 20px;
        width: 54px;
        height: 54px;
    }
    .fab-panel {
        bottom: 84px;
        right: 16px;
        width: calc(100vw - 32px);
        max-height: 80vh;
    }
    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .gradient-title {
        font-size: 1.5rem !important;
    }
    .btn-neon-primary, .btn-neon-cyan, .btn-outline-glass {
        padding: 10px 18px !important;
        font-size: 0.85rem !important;
    }
}

/* Standalone PWA Safe Areas */
@supports (padding: max(0px)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}