/**
 * Finstack Theme - Purple/Violet & Black
 * Version: 5.8.16
 * Date: 2025-12-21
 * Author: csai
 * 
 * DESCRIPTION:
 * Professional Finstack theme with purple/violet primary color and black secondary
 * Modern, elegant design for financial intelligence platform
 * 
 * COLORS:
 * Primary: Purple/Violet (#6B5ACD - Slate Blue)
 * Secondary: Black (#000000)
 * Neutrals: Cool Grays
 * Accents: Purple variations
 * 
 * TYPOGRAPHY:
 * Body: Inter (sans-serif)
 * Headings: Inter (sans-serif)
 * Monospace: 'Fira Code', Courier, monospace
 * 
 * USAGE:
 * Set THEME=finstack in .env to activate this theme
 * 
 * CHANGELOG v5.8.16:
 * - Changed primary color from blue to purple/violet (#6B5ACD)
 * - Changed secondary color to black (#000000)
 * - Updated all gradients and hover states
 * - Maintained professional appearance with purple branding
 */

/* ========================================================================== */
/* CACHED FONTS IMPORT */
/* ========================================================================== */

@import url('fonts.css');

/* ========================================================================== */
/* FINSTACK PURPLE THEME - CSS CUSTOM PROPERTIES */
/* ========================================================================== */

:root {
    /* ====================================================================== */
    /* PRIMARY BRAND COLORS - PURPLE/VIOLET */
    /* ====================================================================== */
    
    /* Primary Purple/Violet - Logo Color */
    --primary: #6B5ACD;              /* Finstack Purple (Slate Blue) */
    --primary-rgb: 107, 90, 205;     /* RGB for alpha channel effects */
    --primary-hover: #5A4AB8;        /* Darker purple on hover */
    --primary-hover-rgb: 90, 74, 184;
    --primary-dark: #4A3A9D;         /* Deep purple */
    --primary-light: #8A7DD8;        /* Light purple */
    --primary-lighter: #EDE9FE;      /* Very light purple */
    
    /* Secondary Black */
    --secondary: #000000;            /* Pure Black */
    --secondary-rgb: 0, 0, 0;
    --secondary-hover: #1a1a1a;      /* Soft Black on hover */
    --secondary-dark: #000000;       /* Black */
    --secondary-light: #333333;      /* Light Black/Dark Gray */
    --secondary-lighter: #4d4d4d;    /* Lighter Gray */
    
    /* Accent Colors (Purple variations) */
    --accent: #6B5ACD;               /* Purple accent (same as primary) */
    --accent-rgb: 107, 90, 205;
    --accent-hover: #5A4AB8;         /* Darker purple accent */
    --accent-light: #8A7DD8;         /* Light purple */
    
    /* Legacy Compatibility (using purple) */
    --emerald: #6B5ACD;
    --emerald-light: #8A7DD8;
    --emerald-dark: #5A4AB8;
    --navy: var(--primary-dark);     /* Legacy alias used by sidebar_menu.html etc */
    --teal: #6B5ACD;
    --teal-light: #8A7DD8;
    --teal-dark: #5A4AB8;
    
    /* Success, Warning, Error States */
    --success: #10B981;              /* Emerald green */
    --success-light: #D1FAE5;
    --warning: #F59E0B;              /* Amber */
    --warning-light: #FEF3C7;
    --error: #EF4444;                /* Red */
    --error-light: #FEE2E2;
    --info: #6B5ACD;                 /* Purple for info */
    --info-light: #EDE9FE;
    
    /* Neutral Colors (Cool Grays) */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    
    /* Background Colors */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --bg-card: #FFFFFF;
    --bg-hover: #F3F4F6;
    --bg-active: #E5E7EB;
    --bg-white: #FFFFFF;
    --bg-dark: #000000;
    
    /* Text Colors */
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --text-tertiary: #9CA3AF;
    --text-inverse: #FFFFFF;
    --text-purple: #6B5ACD;
    --text-black: #000000;
    --text-muted: #9CA3AF;
    
    /* Border Colors */
    --border-primary: #E5E7EB;
    --border-secondary: #D1D5DB;
    --border-focus: #6B5ACD;
    --border-purple: #6B5ACD;
    --border-black: #000000;
    
    /* Shadow Colors */
    --shadow-sm: 0 1px 2px 0 rgba(107, 90, 205, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(107, 90, 205, 0.1), 0 2px 4px -1px rgba(107, 90, 205, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(107, 90, 205, 0.1), 0 4px 6px -2px rgba(107, 90, 205, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(107, 90, 205, 0.1), 0 10px 10px -5px rgba(107, 90, 205, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(107, 90, 205, 0.25);
    
    /* Glass Morphism */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(107, 90, 205, 0.2);
    
    /* ====================================================================== */
    /* TYPOGRAPHY */
    /* ====================================================================== */
    
    /* Font Families */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Fira Code', 'Courier New', Courier, monospace;
    
    /* Font Sizes */
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;     /* 18px */
    --font-size-xl: 1.25rem;      /* 20px */
    --font-size-2xl: 1.5rem;      /* 24px */
    --font-size-3xl: 1.875rem;    /* 30px */
    --font-size-4xl: 2.25rem;     /* 36px */
    
    /* Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-black: 900;
    
    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* ====================================================================== */
    /* SPACING */
    /* ====================================================================== */
    
    --spacing-xs: 0.25rem;    /* 4px */
    --spacing-sm: 0.5rem;     /* 8px */
    --spacing-md: 1rem;       /* 16px */
    --spacing-lg: 1.5rem;     /* 24px */
    --spacing-xl: 2rem;       /* 32px */
    --spacing-2xl: 3rem;      /* 48px */
    
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    
    /* ====================================================================== */
    /* BORDER RADIUS */
    /* ====================================================================== */
    
    --radius-sm: 0.375rem;    /* 6px */
    --radius-md: 0.5rem;      /* 8px */
    --radius-lg: 0.75rem;     /* 12px */
    --radius-xl: 1rem;        /* 16px */
    --radius-2xl: 1.5rem;     /* 24px */
    --radius-full: 9999px;    /* Fully rounded */
    
    /* ====================================================================== */
    /* TRANSITIONS */
    /* ====================================================================== */
    
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* ====================================================================== */
    /* Z-INDEX LAYERS */
    /* ====================================================================== */
    
    --z-base: 1;
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-header: 1000;
    --z-sidebar: 1010;
    --z-modal-backdrop: 1040;
    --z-overlay: 1020;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ========================================================================== */
/* BASE ELEMENT STYLES */
/* ========================================================================== */

body {
    /* CSAI- FIN1.0 v5.8.16 - 2025-12-21 01:45:00 */
    /* CHANGE: Set body padding for Finstack purple theme */
    /* REASON: Maintain consistent spacing with sidebar */
    margin-left: 0 !important;
    padding-left: 300px;
    padding-top: 80px;
    transition: padding-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
}

/* ========================================================================== */
/* COMPONENT OVERRIDES - FINSTACK PURPLE BRAND IDENTITY */
/* ========================================================================== */

/* Buttons - Purple Primary, Black Secondary */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: var(--text-inverse);
    border: none;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-secondary {
    /* CSAI- FIN1.0 v5.8.17 - 2025-12-21 02:00:00 */
    /* CHANGE: Secondary button now has WHITE background with BLACK text */
    /* REASON: User requested black text color for secondary button */
    background: var(--bg-white);
    color: var(--text-black);
    border: 2px solid var(--secondary);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--secondary);
    color: var(--secondary);
    transform: translateY(-2px);
}

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Sidebar Active States */
.nav-item {
    color: var(--text-secondary);
    transition: all var(--transition-base);
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary);
    background: var(--primary-lighter);
    border-left: 4px solid var(--primary);
}

.nav-item.active,
.nav-item.active:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: var(--text-inverse);
}

/* Cards */
.card,
.glass-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.card:hover,
.glass-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: var(--text-inverse);
}

/* Sidebar Menu */
.sidebar-menu {
    background: var(--bg-primary);
    border-right: 1px solid var(--border-primary);
}

.sidebar-brand h3 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-bold);
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Tables */
.data-table thead {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: var(--text-inverse);
}

/* Status Indicators */
.status-pulse::before {
    background: var(--primary);
}

.pulse-dot {
    background: var(--primary);
}

/* ========================================================================== */
/* TYPOGRAPHY STYLES - FINSTACK PURPLE BRAND */
/* ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    line-height: var(--line-height-tight);
}

h1 {
    font-size: 2.5rem;
    font-weight: var(--font-weight-black);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 2rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary);
}

h3 {
    font-size: 1.5rem;
    font-weight: var(--font-weight-semibold);
}

code, pre {
    font-family: var(--font-mono);
}

/* ========================================================================== */
/* FLOATING HEADER - PURPLE BRAND */
/* ========================================================================== */

.floating-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow-lg);
}

/* CSAI- FIN1.0 v5.8.18 - 2025-12-21 02:20:00 */
/* CHANGE: Added .brand-info styling with white text for dark background */
/* REASON: User requested brand-info container to have white text on purple header */
.brand-info {
    color: var(--text-inverse);
}

.brand-info h1,
.brand-info h2,
.brand-info h3,
.brand-info h4,
.brand-info h5,
.brand-info h6,
.brand-info p,
.brand-info span,
.brand-info a,
.brand-info label {
    color: var(--text-inverse) !important;
}

.brand-title {
    color: var(--text-inverse) !important;
    font-family: var(--font-heading);
    font-weight: var(--font-weight-black);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.brand-subtitle {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: var(--font-weight-medium);
}

/* ========================================================================== */
/* FEATURE TILES - PURPLE & BLACK THEME */
/* ========================================================================== */

.feature-tile {
    background: var(--bg-white);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-2xl);
    transition: all var(--transition-base);
    cursor: pointer;
}

.feature-tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

/* ========================================================================== */
/* BADGES & TAGS */
/* ========================================================================== */

.badge {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: var(--text-inverse);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-secondary {
    background: var(--secondary);
    color: var(--text-inverse);
}

/* ========================================================================== */
/* FORMS & INPUTS */
/* ========================================================================== */

input,
textarea,
select {
    background: var(--bg-white);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    color: var(--text-primary);
    font-family: var(--font-body);
    transition: all var(--transition-base);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(107, 90, 205, 0.1);
}

/* ========================================================================== */
/* UTILITY CLASSES */
/* ========================================================================== */

/* CSAI- FIN1.0 v5.8.18 - 2025-12-21 02:15:00 */
/* CHANGE: Added white text color to all dark background utilities */
/* REASON: User requested all dark backgrounds must have white text */

/* Text Color Utilities */
.text-purple {
    color: var(--primary) !important;
}

.text-black {
    color: var(--secondary) !important;
}

.text-white {
    color: var(--text-inverse) !important;
}

.text-inverse {
    color: var(--text-inverse) !important;
}

/* Background Color Utilities - Dark backgrounds = White text */
.bg-purple {
    background: var(--primary) !important;
    color: var(--text-inverse) !important;
}

.bg-purple h1,
.bg-purple h2,
.bg-purple h3,
.bg-purple h4,
.bg-purple h5,
.bg-purple h6,
.bg-purple span,
.bg-purple p,
.bg-purple a,
.bg-purple label,
.bg-purple button {
    color: var(--text-inverse) !important;
}

.bg-black {
    background: var(--secondary) !important;
    color: var(--text-inverse) !important;
}

.bg-black h1,
.bg-black h2,
.bg-black h3,
.bg-black h4,
.bg-black h5,
.bg-black h6,
.bg-black span,
.bg-black p,
.bg-black a,
.bg-black label,
.bg-black button {
    color: var(--text-inverse) !important;
}

/* Border Utilities */
.border-purple {
    border-color: var(--primary) !important;
}

.border-black {
    border-color: var(--secondary) !important;
}

/* Gradient Utilities - Dark gradient = White text */
.gradient-purple {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--text-inverse) !important;
}

.gradient-purple h1,
.gradient-purple h2,
.gradient-purple h3,
.gradient-purple h4,
.gradient-purple h5,
.gradient-purple h6,
.gradient-purple span,
.gradient-purple p,
.gradient-purple a,
.gradient-purple label,
.gradient-purple button {
    color: var(--text-inverse) !important;
}

.gradient-text-purple {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================================================== */
/* RESPONSIVE UTILITIES */
/* ========================================================================== */

@media (max-width: 768px) {
    body {
        padding-left: 0 !important;
    }
    
    .floating-header {
        padding: var(--space-4);
    }
}

/* ========================================================================== */
/* GOOGLE FONTS IMPORT */
/* ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&display=swap');
