/* ============================================
   GHOST - Design System & Global Styles
   Guided Hybrid SD WAN Online Simulation Test
   ============================================ */

/* ===== Google Fonts Import ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;700&display=swap');

/* ===== CSS Custom Properties (Design Tokens) ===== */
:root {
    /* Background Colors */
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f172a;
    --bg-tertiary: #1e293b;
    --bg-glass: rgba(15, 23, 42, 0.7);
    --bg-glass-card: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    
    /* Accent Colors */
    --accent-indigo: #4f46e5;
    --accent-indigo-light: #6366f1;
    --accent-indigo-dark: #4338ca;
    --accent-cyan: #06b6d4;
    --accent-purple: #7c3aed;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
    
    /* Text Colors */
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dark: #1e293b;
    
    /* Border Colors */
    --border-primary: rgba(99, 102, 241, 0.2);
    --border-secondary: rgba(99, 102, 241, 0.15);
    --border-gray: rgba(100, 116, 139, 0.3);
    
    /* Region Code Colors */
    --reg-1-bg: rgba(239, 68, 68, 0.2);
    --reg-1-text: #f87171;
    --reg-1-border: rgba(239, 68, 68, 0.3);
    
    --reg-2-bg: rgba(59, 130, 246, 0.2);
    --reg-2-text: #60a5fa;
    --reg-2-border: rgba(59, 130, 246, 0.3);
    
    --reg-4-bg: rgba(245, 158, 11, 0.2);
    --reg-4-text: #fbbf24;
    --reg-4-border: rgba(245, 158, 11, 0.3);
    
    --reg-5-bg: rgba(168, 85, 247, 0.2);
    --reg-5-text: #c084fc;
    --reg-5-border: rgba(168, 85, 247, 0.3);
    
    /* Segment Colors */
    --segment-enterprise-bg: rgba(139, 92, 246, 0.2);
    --segment-enterprise-text: #a78bfa;
    --segment-enterprise-border: rgba(139, 92, 246, 0.3);
    
    --segment-sme-bg: rgba(59, 130, 246, 0.2);
    --segment-sme-text: #60a5fa;
    --segment-sme-border: rgba(59, 130, 246, 0.3);
    
    --segment-government-bg: rgba(16, 185, 129, 0.2);
    --segment-government-text: #34d399;
    --segment-government-border: rgba(16, 185, 129, 0.3);
    
    /* Status Colors */
    --status-active: #10b981;
    --status-pending: #f59e0b;
    --status-in-progress: #3b82f6;
    --status-error: #ef4444;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-glow-indigo: 0 0 15px rgba(79, 70, 229, 0.5);
    --shadow-glow-cyan: 0 0 15px rgba(6, 182, 212, 0.5);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Spacing */
    --sidebar-width-collapsed: 80px;
    --sidebar-width-expanded: 256px;
    --header-height: 80px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;
}

/* ===== Base Reset & Styles ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

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

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 2.25rem; font-weight: 700; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

.mono {
    font-family: var(--font-mono);
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-indigo-light), var(--accent-cyan), var(--accent-indigo-light));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glow-text {
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-indigo);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-indigo-light);
}

/* ===== Glass Morphism ===== */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-primary);
}

.glass-card {
    background: var(--bg-glass-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-secondary);
    box-shadow: var(--shadow-lg);
}

/* ===== Layout Components ===== */
.main-content {
    margin-left: var(--sidebar-width-collapsed);
    padding: 2rem;
    transition: margin-left var(--transition-normal);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--accent-indigo);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-indigo-dark);
    box-shadow: var(--shadow-glow-indigo);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-gray);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--accent-indigo);
    color: var(--accent-indigo-light);
    background: rgba(99, 102, 241, 0.1);
}

/* ===== Cards ===== */
.card {
    background: var(--bg-glass-card);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-2xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
}

.metric-card {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.2);
}

/* ===== Region Badges ===== */
.reg-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 24px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.reg-badge.reg-1 {
    background: var(--reg-1-bg);
    color: var(--reg-1-text);
    border: 1px solid var(--reg-1-border);
}

.reg-badge.reg-2 {
    background: var(--reg-2-bg);
    color: var(--reg-2-text);
    border: 1px solid var(--reg-2-border);
}

.reg-badge.reg-4 {
    background: var(--reg-4-bg);
    color: var(--reg-4-text);
    border: 1px solid var(--reg-4-border);
}

.reg-badge.reg-5 {
    background: var(--reg-5-bg);
    color: var(--reg-5-text);
    border: 1px solid var(--reg-5-border);
}

/* ===== Segment Badges ===== */
.segment-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.segment-badge.segment-enterprise {
    background: var(--segment-enterprise-bg);
    color: var(--segment-enterprise-text);
    border: 1px solid var(--segment-enterprise-border);
}

.segment-badge.segment-sme {
    background: var(--segment-sme-bg);
    color: var(--segment-sme-text);
    border: 1px solid var(--segment-sme-border);
}

.segment-badge.segment-government {
    background: var(--segment-government-bg);
    color: var(--segment-government-text);
    border: 1px solid var(--segment-government-border);
}

/* ===== Status Badges ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--status-active);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--status-pending);
}

.status-badge.in-progress {
    background: rgba(59, 130, 246, 0.2);
    color: var(--status-in-progress);
}

/* ===== Region Filter Buttons ===== */
.region-btn {
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-gray);
    background: rgba(31, 41, 55, 0.5);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.region-btn:hover {
    background: rgba(55, 65, 81, 0.5);
    border-color: var(--accent-indigo);
}

.region-btn.active {
    background: linear-gradient(135deg, var(--accent-indigo) 0%, var(--accent-purple) 100%);
    border-color: var(--accent-indigo-light);
    color: white;
    box-shadow: var(--shadow-glow-indigo);
}

/* ===== Form Elements ===== */
.form-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-indigo);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-gray);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--accent-indigo);
}

/* ===== Tables ===== */
.data-table {
    width: 100%;
    text-align: left;
    border-collapse: collapse;
}

.data-table thead tr {
    border-bottom: 1px solid var(--border-gray);
}

.data-table th {
    padding: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.data-table tbody tr {
    border-bottom: 1px solid rgba(31, 41, 55, 0.5);
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.data-table td {
    padding: 1rem;
    font-size: 0.875rem;
}

/* ===== Traffic Bars ===== */
.traffic-bar {
    height: 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    overflow: hidden;
}

.traffic-fill {
    height: 100%;
    border-radius: var(--radius-sm);
    transition: width var(--transition-slow);
}

/* ===== Progress Bars ===== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-gray);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--accent-indigo);
    transition: width var(--transition-slow);
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ===== Utility Classes ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }

.hidden { display: none; }

/* ===== Responsive Breakpoints ===== */
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
