/* ============================================
   KUSANAGI - Modern 2026 Design System
   Neo-Glassmorphism & Minimalist Dark
   ============================================ */

:root {
    --bg-main: #050508;
    --bg-surface: rgba(255, 255, 255, 0.03);
    --bg-surface-elevated: rgba(255, 255, 255, 0.06);
    --bg-blur: blur(12px);

    --accent-primary: #6366f1;
    /* Indigo */
    --accent-secondary: #a855f7;
    /* Purple */
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #475569;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);

    --status-healthy: #22c55e;
    --status-warning: #f59e0b;
    --status-danger: #ef4444;
    --status-info: #3b82f6;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    /* Compatibility Mappings for Shared Components (Gauges, etc.) */
    --neon-green: var(--status-healthy);
    --neon-cyan: var(--status-info);
    --neon-magenta: var(--accent-secondary);
    --neon-pink: #f43f5e;
}

/* Gauge & Pod Bar Overrides for Modern Aesthetic */
body.theme-modern .pod-bar-container {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    height: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.theme-modern .pod-bar {
    border-radius: var(--radius-sm);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

body.theme-modern .pod-bar.bar-ok {
    background: linear-gradient(90deg, #22c55e 0%, #10b981 100%);
}

body.theme-modern .pod-bar.bar-warning {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
}

body.theme-modern .pod-bar.bar-danger {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

body.theme-modern .pod-text {
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

body.theme-modern .resource-label {
    font-weight: 600;
    color: var(--text-secondary);
}

/* Base Styles */
body.theme-modern {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.theme-modern .grid-bg,
body.theme-modern .scanlines {
    display: none;
}

/* Container & Layout */
body.theme-modern .container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 2rem;
}

/* Card / Box Styles */
body.theme-modern .stat-box,
body.theme-modern .argocd-section,
body.theme-modern .node-card,
body.theme-modern .cyber-modal-content,
body.theme-modern .chat-container {
    background: var(--bg-surface);
    backdrop-filter: var(--bg-blur);
    -webkit-backdrop-filter: var(--bg-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    margin-top: 1.5rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
}

body.theme-modern .chat-container {
    height: calc(100vh - 280px);
    min-height: 500px;
}

body.theme-modern .chat-messages {
    flex: 1;
    overflow-y: auto;
}

body.theme-modern .argocd-section:first-of-type {
    margin-top: 0;
}

body.theme-modern .stat-box:hover,
body.theme-modern .node-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

/* Typography */
body.theme-modern h1,
body.theme-modern h2,
body.theme-modern h3 {
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-primary);
}

body.theme-modern .section-title {
    border-left: 4px solid var(--accent-primary);
    padding-left: 1rem;
    text-transform: none;
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

/* Navigation */
body.theme-modern .quick-nav {
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

body.theme-modern .tab-btn {
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    clip-path: none;
    text-transform: none;
}

body.theme-modern .tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

body.theme-modern .tab-btn.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Status Badges */
body.theme-modern .status-badge {
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
}

body.theme-modern .status-badge.healthy {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

body.theme-modern .status-badge.unhealthy {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

body.theme-modern .status-badge.progressing {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

body.theme-modern .status-badge.unknown {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
}

/* Tables */
body.theme-modern .issues-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

body.theme-modern .issues-table th {
    text-align: left;
    padding: 0.5rem 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}

body.theme-modern .issues-table td {
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

body.theme-modern .issues-table tr td:first-child {
    border-left: 1px solid var(--border-color);
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

body.theme-modern .issues-table tr td:last-child {
    border-right: 1px solid var(--border-color);
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

/* General Data Table (used by Services) */
body.theme-modern .data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

body.theme-modern .data-table th {
    text-align: left;
    padding: 0.5rem 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}

body.theme-modern .data-table td {
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

body.theme-modern .data-table tr td:first-child {
    border-left: 1px solid var(--border-color);
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

body.theme-modern .data-table tr td:last-child {
    border-right: 1px solid var(--border-color);
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

/* Buttons */
body.theme-modern .cyber-btn {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    font-weight: 500;
    clip-path: none;
    font-family: inherit;
    text-transform: none;
    transition: all 0.2s ease;
}

body.theme-modern .cyber-btn:hover {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    transform: translateY(-1px);
}

/* Chat Integration */
body.theme-modern .chat-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    color: var(--text-primary);
    font-family: inherit;
}

body.theme-modern .chat-send-btn {
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    clip-path: none;
}

/* Custom Overrides for Modern Look */
body.theme-modern header.header {
    border-bottom: 1px solid var(--border-color);
    background: rgba(5, 5, 8, 0.8);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

body.theme-modern .header-title {
    font-size: 1.5rem;
    background: var(--accent-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

body.theme-modern .footer {
    margin-top: 4rem;
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

body.theme-modern .footer-quote {
    font-style: italic;
    font-family: serif;
}

/* ============================================
   ANSI Log Display Styles
   ============================================ */

/* Log container */
.ansi-log {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: #0a0a0f;
    color: #e0e0e0;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

/* ANSI Color Classes */
.ansi-black {
    color: #2e3436;
}

.ansi-red {
    color: #ff6b6b;
}

.ansi-green {
    color: #69db7c;
}

.ansi-yellow {
    color: #ffd93d;
}

.ansi-blue {
    color: #4dabf7;
}

.ansi-magenta {
    color: #da77f2;
}

.ansi-cyan {
    color: #22d3ee;
}

.ansi-white {
    color: #f8f9fa;
}

/* Bright colors */
.ansi-bright-black {
    color: #555555;
}

.ansi-bright-red {
    color: #ff8787;
}

.ansi-bright-green {
    color: #8ce99a;
}

.ansi-bright-yellow {
    color: #ffe066;
}

.ansi-bright-blue {
    color: #74c0fc;
}

.ansi-bright-magenta {
    color: #e599f7;
}

.ansi-bright-cyan {
    color: #67e8f9;
}

.ansi-bright-white {
    color: #ffffff;
}

/* Styles */
.ansi-bold {
    font-weight: bold;
}

.ansi-dim {
    opacity: 0.7;
}

.ansi-italic {
    font-style: italic;
}

.ansi-underline {
    text-decoration: underline;
}

/* Log level highlighting */
.log-level-error {
    color: #ff6b6b;
    font-weight: bold;
    background: rgba(255, 107, 107, 0.1);
    padding: 0 4px;
    border-radius: 3px;
}

.log-level-warn {
    color: #ffd93d;
    font-weight: bold;
    background: rgba(255, 217, 61, 0.1);
    padding: 0 4px;
    border-radius: 3px;
}

.log-level-info {
    color: #4dabf7;
    font-weight: bold;
    background: rgba(77, 171, 247, 0.1);
    padding: 0 4px;
    border-radius: 3px;
}

.log-level-debug {
    color: #adb5bd;
    padding: 0 4px;
    border-radius: 3px;
}

/* Timestamp */
.log-timestamp {
    color: #868e96;
    font-size: 12px;
}

/* Module name */
.log-module {
    color: #da77f2;
    font-weight: 500;
}

/* Dark theme adjustments for cyberpunk */
body.theme-cyberpunk .ansi-log {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 0, 255, 0.2);
    font-family: 'Courier New', monospace;
}

/* System logs container specific */
#system-logs-content {
    max-height: 60vh;
    overflow-y: auto;
}

#system-logs-content .ansi-log {
    margin: 0;
}

/* Node Card Modern Extensions */
body.theme-modern .node-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.25rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

body.theme-modern .node-info-item {
    display: flex;
    flex-direction: column;
}

body.theme-modern .node-info-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

body.theme-modern .node-info-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-family: inherit;
    font-weight: 500;
}

body.theme-modern .node-resources {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

body.theme-modern .node-conditions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

body.theme-modern .condition-item {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-weight: 600;
}

body.theme-modern .condition-item.true {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

body.theme-modern .condition-item.false {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
}

body.theme-modern .condition-item.Ready.true {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

body.theme-modern .condition-item.Ready.false {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Node Condition Icons - Modern Theme */
body.theme-modern .condition-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

/* Icône grisée quand false */
body.theme-modern .condition-icon.false {
    background: rgba(100, 100, 100, 0.15);
    color: #64748b;
    opacity: 0.4;
}

/* Icône en couleur quand true */
body.theme-modern .condition-icon.true {
    opacity: 1;
    box-shadow: 0 0 8px currentColor;
}

body.theme-modern .condition-icon.Ready.true {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

body.theme-modern .condition-icon.DiskPressure.false,
body.theme-modern .condition-icon.MemoryPressure.false,
body.theme-modern .condition-icon.NetworkUnavailable.false,
body.theme-modern .condition-icon.PIDPressure.false {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    opacity: 0.6;
}

body.theme-modern .condition-icon.DiskPressure.true,
body.theme-modern .condition-icon.MemoryPressure.true,
body.theme-modern .condition-icon.NetworkUnavailable.true,
body.theme-modern .condition-icon.PIDPressure.true {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    opacity: 1;
}

/* Compact node card styles for Modern theme */
body.theme-modern .nodes-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

body.theme-modern .node-gauges {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
}

body.theme-modern .gauge-mini-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
}

body.theme-modern .gauge-mini-value {
    font-size: 0.85rem;
    font-weight: bold;
    font-family: 'JetBrains Mono', monospace;
}

body.theme-modern .gauge-mini-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

body.theme-modern .gauge-mini-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

body.theme-modern .gauge-mini-fill.low {
    background: var(--status-healthy);
}

body.theme-modern .gauge-mini-fill.medium {
    background: var(--status-warning);
}

body.theme-modern .gauge-mini-fill.high {
    background: var(--status-danger);
}

/* ============================================
   INGRESS LINKS STYLES - Modern 2026
   ============================================ */

/* Ingress Table Styles */
body.theme-modern .data-table.ingress-table td.ingress-rules {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Clickable Ingress Links - Modern Theme */
body.theme-modern a.ingress-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

body.theme-modern a.ingress-link::before {
    content: "🔒";
    font-size: 0.75rem;
}

body.theme-modern a.ingress-link:hover {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

body.theme-modern a.ingress-link:active {
    transform: translateY(0);
}

/* Namespace Badge - Modern Theme */
body.theme-modern .namespace-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid var(--accent-secondary);
    border-radius: var(--radius-sm);
    color: var(--accent-secondary);
    font-size: 0.8rem;
    font-weight: 500;
}

/* Table improvements for ingress */
body.theme-modern .data-table.ingress-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

body.theme-modern .data-table.ingress-table th {
    text-align: left;
    padding: 0.5rem 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}

body.theme-modern .data-table.ingress-table td {
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

body.theme-modern .data-table.ingress-table tr td:first-child {
    border-left: 1px solid var(--border-color);
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

body.theme-modern .data-table.ingress-table tr td:last-child {
    border-right: 1px solid var(--border-color);
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

/* ============================================
   QUOTAS STYLES - Modern 2026
   ============================================ */

body.theme-modern .quotas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

body.theme-modern .quota-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow-lg);
}

body.theme-modern .quota-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.3);
}

body.theme-modern .quota-card.full-width {
    grid-column: 1 / -1;
    align-items: stretch;
}

body.theme-modern .quota-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
    justify-content: center;
}

body.theme-modern .quota-card.full-width .quota-header {
    justify-content: flex-start;
}

body.theme-modern .quota-icon {
    font-size: 1.5rem;
}

body.theme-modern .quota-title {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Semi-Circle Gauge - Modern */
body.theme-modern .quota-gauge-container {
    position: relative;
    width: 180px;
    height: 100px;
    overflow: hidden;
}

body.theme-modern .gauge-svg {
    width: 100%;
    height: 100%;
}

body.theme-modern .gauge-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
    stroke-linecap: round;
}

body.theme-modern .gauge-fill {
    fill: none;
    stroke: var(--status-healthy);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease-out;
}

body.theme-modern .quota-gauge[data-value="high"] .gauge-fill {
    stroke: var(--status-danger);
}

body.theme-modern .quota-gauge[data-value="medium"] .gauge-fill {
    stroke: var(--status-warning);
}

body.theme-modern .gauge-value {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, sans-serif;
}

/* Storage Bar - Modern */
body.theme-modern .storage-bar-container {
    width: 100%;
}

body.theme-modern .storage-info {
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

body.theme-modern .storage-info span {
    color: var(--text-primary);
    font-weight: 600;
}

body.theme-modern .storage-progress-bar {
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

body.theme-modern .storage-fill {
    height: 100%;
    background: var(--accent-gradient);
    width: 0%;
    border-radius: var(--radius-sm);
    transition: width 1s ease-out;
}

body.theme-modern .quota-footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

body.theme-modern .quota-footer button {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

body.theme-modern .quota-footer button:hover {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
}