/**
 * AIODS Enterprise Design System
 * Version 1.0
 *
 * Unified styles for consistent branding across all pages
 */

/* ============================================
   CSS VARIABLES - Design Tokens
   ============================================ */
:root {
    /* Primary Brand Colors */
    --gold: #FFD700;
    --gold-light: #FFE44D;
    --gold-dark: #D4A500;
    --gold-glow: rgba(255, 215, 0, 0.3);
    --gold-hover: rgba(255, 215, 0, 0.08);
    --gold-active: rgba(255, 215, 0, 0.15);

    /* Neutral Colors */
    --black: #0a0a0a;
    --dark-gray: #1a1a1a;
    --medium-gray: #333333;
    --light-gray: #f5f5f5;
    --border: #e0e0e0;
    --border-dark: #d0d0d0;
    --white: #ffffff;
    --off-white: #fafafa;

    /* Text Colors */
    --text-primary: #0a0a0a;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-light: rgba(255, 255, 255, 0.7);
    --text-bright: #ffffff;

    /* Status Colors */
    --success: #10B981;
    --success-light: rgba(16, 185, 129, 0.15);
    --warning: #F59E0B;
    --warning-light: rgba(245, 158, 11, 0.15);
    --danger: #EF4444;
    --danger-light: rgba(239, 68, 68, 0.15);
    --info: #3B82F6;
    --info-light: rgba(59, 130, 246, 0.15);
    --purple: #8B5CF6;
    --purple-light: rgba(139, 92, 246, 0.15);

    /* Layout */
    --nav-width: 260px;
    --header-height: 64px;
    --content-max-width: 1400px;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 11px;
    --font-size-sm: 13px;
    --font-size-base: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 32px;
    --font-size-4xl: 48px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-gold: 0 4px 16px rgba(255, 215, 0, 0.3);

    /* Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Legacy aliases (backward compatibility) */
    --primary: var(--black);
    --accent: var(--gold);
    --accent-light: var(--gold-light);
    --accent-dark: var(--gold-dark);
    --accent-glow: var(--gold-glow);
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--white);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: var(--font-size-4xl); letter-spacing: -1.5px; }
h2 { font-size: var(--font-size-3xl); letter-spacing: -1px; }
h3 { font-size: var(--font-size-2xl); letter-spacing: -0.5px; }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

/* ============================================
   MISSION TAGLINE COMPONENT
   ============================================ */
.mission-tagline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--gold-active);
    border: 1px solid var(--gold);
    border-radius: 20px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--gold-dark);
}

.mission-tagline i {
    color: var(--gold);
}

/* Full mission statement banner */
.mission-banner {
    background: linear-gradient(135deg, var(--black) 0%, var(--dark-gray) 100%);
    color: var(--white);
    padding: 16px 24px;
    border-radius: var(--border-radius-md);
    margin-bottom: 24px;
}

.mission-banner h2 {
    font-size: var(--font-size-lg);
    color: var(--white);
    margin-bottom: 4px;
}

.mission-banner p {
    font-size: var(--font-size-sm);
    color: var(--text-light);
    margin: 0;
}

.mission-banner .highlight {
    color: var(--gold);
    font-weight: 700;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-base);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
}

.btn-primary {
    background: var(--gold);
    color: var(--black);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

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

.btn-secondary:hover {
    border-color: var(--gold);
    background: var(--gold-hover);
}

.btn-dark {
    background: var(--black);
    color: var(--white);
}

.btn-dark:hover {
    background: var(--dark-gray);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--gold);
    background: var(--gold-hover);
}

.btn-sm {
    padding: 8px 16px;
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: 16px 32px;
    font-size: var(--font-size-lg);
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--gold);
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: var(--font-size-lg);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--black);
}

.card-title i {
    color: var(--gold-dark);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--off-white);
}

/* ============================================
   STAT CARDS
   ============================================ */
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--stat-color, var(--gold));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.stat-card:hover {
    border-color: var(--stat-color, var(--gold));
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card.gold { --stat-color: var(--gold); }
.stat-card.green { --stat-color: var(--success); }
.stat-card.blue { --stat-color: var(--info); }
.stat-card.orange { --stat-color: var(--warning); }
.stat-card.purple { --stat-color: var(--purple); }

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--black);
    margin-bottom: 4px;
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* ============================================
   BADGES & TAGS
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.badge-gold {
    background: var(--gold-active);
    color: var(--gold-dark);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

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

/* ============================================
   TOP HEADER (for pages with sidebar)
   ============================================ */
.top-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 100;
}

.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.header-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.header-breadcrumb a:hover {
    color: var(--gold-dark);
}

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

/* ============================================
   CONNECTION STATUS
   ============================================ */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--success-light);
    border-radius: 20px;
    font-size: var(--font-size-xs);
    color: var(--success);
    font-weight: 600;
}

.connection-status.disconnected {
    background: var(--danger-light);
    color: var(--danger);
}

.connection-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

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

/* ============================================
   PAGE CONTENT WRAPPER
   ============================================ */
.page-content {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 32px 40px;
}

/* ============================================
   WELCOME BANNER
   ============================================ */
.welcome-banner {
    background: linear-gradient(135deg, var(--black) 0%, var(--dark-gray) 100%);
    border-radius: var(--border-radius-xl);
    padding: 40px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -50px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
    pointer-events: none;
}

.welcome-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-text h1 {
    font-size: var(--font-size-3xl);
    color: var(--white);
    margin-bottom: 8px;
}

.welcome-text h1 span {
    color: var(--gold);
}

.welcome-text p {
    color: var(--text-light);
    font-size: var(--font-size-lg);
    max-width: 500px;
}

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

/* ============================================
   UTILITY CLASSES
   ============================================ */
.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-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.hidden { display: none; }
.visible { display: block; }

/* Grid utilities */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl, 4rem);
    color: var(--text-muted);
}

.loading-container .loading-text {
    margin-top: var(--space-md, 1rem);
}

.empty-state {
    text-align: center;
    padding: var(--space-3xl, 4rem) var(--space-xl, 2rem);
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg, 1.5rem);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: var(--font-size-xl);
    color: var(--text-primary);
    margin-bottom: var(--space-sm, 0.5rem);
}

.empty-state p {
    max-width: 400px;
    margin: 0 auto;
}

/* ============================================
   INTEGRATION STATUS DOTS
   ============================================ */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.connected {
    background: var(--success);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
    animation: pulse 2s infinite;
}

.status-dot.disconnected {
    background: var(--danger);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.status-dot.pending {
    background: var(--warning);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
    animation: pulse 2s infinite;
}

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

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */
@media (max-width: 1200px) {
    .page-content {
        padding: 24px 32px;
    }
}

@media (max-width: 900px) {
    .main-content {
        margin-left: 0;
    }

    .welcome-content {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }

    .welcome-text p {
        max-width: 100%;
    }
}

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    :root {
        --font-size-4xl: 36px;
        --font-size-3xl: 28px;
        --font-size-2xl: 22px;
    }

    .page-content {
        padding: 20px;
    }

    .welcome-banner {
        padding: 24px;
    }

    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}
