/**
 * SPRC Hub — Shared Styles
 *
 * Brand colors, typography, and shared components used across all apps.
 * Each app can have its own CSS for app-specific styling.
 */

/* ============================================
   CSS VARIABLES — Brand Palette
   ============================================ */
:root {
    /* Primary */
    --deep-navy: #112F52;
    --terracotta: #DF3F32;
    --muted-red: #CD4E42;

    /* Secondary */
    --slate-blue: #1F3A52;
    --slate-mid: #465367;
    --soft-blue-gray: #B4C5D7;
    --gold: #E7A03C;

    /* Neutrals */
    --bg-warm: #F8F5F1;
    --bg-light: #F7F4EF;
    --bg-card: #FFFFFF;
    --border-color: #E2DDD7;
    --border-light: #EDE9E3;

    /* Text */
    --text-primary: #1a1a2e;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-light: #A0AEC0;

    /* Status */
    --success: #38A169;
    --warning: #E7A03C;
    --danger: #E53E3E;
    --info: #3182CE;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Borders */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-warm);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--deep-navy);
    text-decoration: none;
}

/* ============================================
   HUB NAV BAR (shared across all apps)
   ============================================ */
.hub-nav {
    background: var(--deep-navy);
    color: #fff;
    padding: 0 var(--space-md);
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.hub-nav-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.hub-nav-logo {
    height: 30px;
    width: 30px;
    border-radius: 4px;
    object-fit: cover;
}

.hub-nav-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.hub-nav-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.hub-nav-user {
    font-size: 0.8rem;
    color: var(--soft-blue-gray);
    display: none;
}

.hub-nav-btn {
    background: transparent;
    color: var(--soft-blue-gray);
    border: 1px solid rgba(180, 197, 215, 0.3);
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}

.hub-nav-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    gap: 8px;
}

.btn-primary {
    background: var(--deep-navy);
    color: #fff;
}

.btn-primary:hover {
    background: var(--slate-blue);
}

.btn-secondary {
    background: transparent;
    color: var(--deep-navy);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-light);
}

.btn-full-width {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: var(--space-md);
}

.alert-error {
    background: #FFF5F5;
    color: #C53030;
    border: 1px solid #FEB2B2;
}

.alert-warning {
    background: #FFFFF0;
    color: #975A16;
    border: 1px solid #FEFCBF;
}

.alert-success {
    background: #F0FFF4;
    color: #276749;
    border: 1px solid #C6F6D5;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--deep-navy);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    margin-top: var(--space-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

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

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden {
    display: none !important;
}

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

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

/* ============================================
   RESPONSIVE — Desktop
   ============================================ */
@media (min-width: 768px) {
    .hub-nav-user {
        display: block;
    }
}

/* Mobile nav bar — tighten spacing for small screens */
@media (max-width: 480px) {
    .hub-nav {
        padding: 0 var(--space-sm);
        height: 46px;
    }

    .hub-nav-right {
        gap: 6px;
    }

    .hub-nav-title {
        font-size: 0.85rem;
    }

    .hub-nav-btn {
        padding: 4px 8px;
        font-size: 0.72rem;
    }
}
