/* ============================================
   STYLE GUIDE - Elba Finance Design System
   ============================================ */

:root {
    /* Primary Colors */
    --primary-50: #f0fdf4;
    --primary-100: #dcfce7;
    --primary-200: #bbf7d0;
    --primary-300: #86efac;
    --primary-400: #4ade80;
    --primary-500: #22c55e;
    --primary-600: #16a34a;
    --primary-700: #15803d;
    --primary-800: #166534;
    --primary-900: #14532d;
    
    /* Neutral Colors */
    --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;
    
    /* Semantic Colors */
    --success: #10b981;
    --success-100: #dcfce7;
    --success-200: #bbf7d0;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    --info-50: #eff6ff;
    --info-100: #dbeafe;
    --info-200: #bfdbfe;
    --info-600: #2563eb;
    --info-700: #1d4ed8;
    
    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Courier New', monospace;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--gray-50);
}

h1 { font-size: 2.5rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 2rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.5rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 1.25rem; font-weight: 500; line-height: 1.4; }

/* Component Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-lg);
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    text-decoration: none;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: var(--primary-700);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Button variants */
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-info { background: var(--info); color: #fff; }
.btn-info:hover { background: #2563eb; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* Full-width button */
.btn-block { width: 100%; }

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
}

.btn-ghost:hover {
    background: var(--gray-100);
}

.form-group { margin-bottom: var(--space-lg); }

.form-label {
    display: block;
    margin-bottom: var(--space-xs);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Form select */
.form-select { 
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    background: #fff;
    transition: all 0.2s;
}
.form-select:focus { outline: none; border-color: var(--primary-500); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1); }

/* Input group */
.input-group { display: flex; align-items: stretch; }
.input-group > .form-input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }

.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    background: var(--primary-100);
    color: var(--primary-700);
}

/* Navigation */
.navbar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: var(--space-md) 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-600);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: var(--space-xl);
    align-items: center;
}

.nav-link {
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover { color: var(--primary-600); }

/* Navigation Dropdown */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    margin-top: var(--space-xs);
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: var(--space-sm) var(--space-md);
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
    border-bottom: 1px solid var(--gray-100);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--gray-50);
    color: var(--primary-600);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.hamburger-line {
    width: 2rem;
    height: 0.25rem;
    background: var(--gray-700);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

.hamburger.active .hamburger-line:first-child {
    transform: rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg);
}

/* Page Sections */
.page { display: none; animation: fadeIn 0.3s ease-in; }
.page.active { display: block; }

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

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-50) 0%, white 100%);
    padding: var(--space-2xl) 0;
    border-bottom: 1px solid var(--gray-200);
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2xl);
    align-items: center;
}

.hero-content h1 { color: var(--gray-900); margin-bottom: var(--space-lg); }
.hero-content p { font-size: 1.125rem; color: var(--gray-600); margin-bottom: var(--space-xl); }
.hero-buttons { display: flex; gap: var(--space-md); }
.hero-visual { display: flex; justify-content: center; align-items: center; }

.illustration {
    width: 100%;
    max-width: 500px;
    height: 400px;
    background: linear-gradient(135deg, var(--primary-100), var(--primary-200));
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Features */
.features {
    padding: var(--space-2xl) 0;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-2xl);
}

.feature-card { text-align: center; padding: var(--space-xl); }

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-100);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    font-size: 1.5rem;
}

/* Dashboard Styles */
.dashboard-container { max-width: 1400px; margin: 0 auto; padding: var(--space-xl); }
.dashboard-header { margin-bottom: var(--space-xl); }
.dashboard-filters { display: flex; gap: var(--space-md); margin-bottom: var(--space-xl); flex-wrap: wrap; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--space-lg); margin-bottom: var(--space-xl); }
.stat-card { background: white; padding: var(--space-lg); border-radius: var(--radius-lg); border: 1px solid var(--gray-200); }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--gray-900); margin-bottom: var(--space-xs); }
.stat-label { color: var(--gray-600); font-size: 0.875rem; }
.stat-change { margin-top: var(--space-sm); font-size: 0.875rem; color: var(--success); }

/* Table Styles */
.table-container { background: white; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--gray-200); }
table { width: 100%; border-collapse: collapse; }
th { background: var(--gray-50); padding: var(--space-md); text-align: left; font-weight: 500; color: var(--gray-700); font-size: 0.875rem; border-bottom: 1px solid var(--gray-200); }
td { padding: var(--space-md); border-bottom: 1px solid var(--gray-100); }
tr:hover { background: var(--gray-50); }

/* Alerts */
.alert { padding: var(--space-md); border-radius: var(--radius-lg); background: #fff; border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: var(--space-md); }
.alert-success { border-left: 4px solid var(--success); }
.alert-warning { border-left: 4px solid var(--warning); }
.alert-error { border-left: 4px solid var(--error); }
.alert-info { border-left: 4px solid var(--info); }

/* Progress */
.progress { width: 100%; background: var(--gray-100); border-radius: var(--radius-full); height: 1rem; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--primary-600); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 600; transition: width 0.3s ease; }
.progress-success { background: var(--success); }
.progress-info { background: var(--info); }
.progress-error { background: var(--error); }

/* Narrow container */
.narrow { max-width: 520px; margin: 0 auto; }

/* Modal Styles */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); z-index: 1000; align-items: center; justify-content: center; }
.modal.active { display: flex; }
.modal-content { background: white; border-radius: var(--radius-xl); max-width: 500px; width: 90%; max-height: 90vh; overflow-y: auto; padding: var(--space-xl); }
.modal-header { margin-bottom: var(--space-lg); }
.modal-close { float: right; font-size: 1.5rem; cursor: pointer; color: var(--gray-400); border: none; background: none; }

/* Terms Scroll Box */
.terms-box { background: var(--gray-50); border: 1px solid var(--gray-300); border-radius: var(--radius-md); padding: var(--space-md); height: 300px; overflow-y: auto; margin-bottom: var(--space-md); font-size: 0.875rem; }

/* Responsive */
@media (max-width: 768px) {
    .hero-container { grid-template-columns: 1fr; }
    .hero-visual { display: none; }
    .features-grid { grid-template-columns: 1fr; }
    
    /* Mobile Navigation */
    .hamburger {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        border-top: 1px solid var(--gray-200);
        padding: var(--space-lg) 0;
        gap: var(--space-lg);
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .nav-links .nav-link,
    .nav-links .btn {
        margin: var(--space-sm) 0;
        padding: var(--space-md);
        display: block;
        width: 100%;
        text-align: center;
    }
    
    /* Mobile dropdown - show as regular links */
    .nav-dropdown .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        background: var(--gray-50);
        margin: 0;
        border-radius: 0;
    }
    
    .nav-dropdown .dropdown-item {
        padding: var(--space-sm) var(--space-lg);
        border-bottom: 1px solid var(--gray-200);
    }
}


