/* Modern Light Theme - Market Ready Design System */

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

/* CSS Variables for Design System - Glassmorphic */
:root {
    /* Primary Colors - Enhanced Vibrance */
    --primary-red: #ff4757;
    --primary-red-bright: #ff6b7a;
    --primary-green: #00d68f;
    --primary-green-bright: #00e5a0;
    --primary-blue: #4facfe;
    --primary-blue-bright: #6bc1ff;
    --primary-sage: #7fa88f;
    --primary-sage-bright: #96c3a6;

    /* Background Colors - Glassmorphic with Stronger Glass */
    --bg-primary: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
    --bg-secondary: rgba(240, 244, 248, 0.5);
    --bg-sidebar: rgba(76, 100, 84, 0.9);
    --bg-card: rgba(255, 255, 255, 0.75);
    --bg-card-hover: rgba(255, 255, 255, 0.9);

    /* Text Colors */
    --text-primary: #1a2332;
    --text-secondary: #5a6c7d;
    --text-muted: #9aa5b1;
    --text-white: #ffffff;

    /* Border & Shadow - Glassmorphic Enhanced */
    --border-light: rgba(255, 255, 255, 0.25);
    --border-glass: rgba(255, 255, 255, 0.4);
    --shadow-sm: 0 8px 32px 0 rgba(31, 38, 135, 0.12);
    --shadow-md: 0 8px 32px 0 rgba(31, 38, 135, 0.22);
    --shadow-lg: 0 8px 32px 0 rgba(31, 38, 135, 0.32);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.42);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
    position: relative;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 30%, rgba(254, 87, 87, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(76, 100, 84, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(89, 157, 255, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: backgroundShift 15s ease infinite alternate;
}

@keyframes backgroundShift {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0.85;
    }
}

/* Layout Components */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Sidebar - Glassmorphic Enhanced */
.sidebar {
    width: 250px;
    background: linear-gradient(180deg,
        rgba(76, 100, 84, 0.95) 0%,
        rgba(96, 123, 106, 0.92) 100%);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-right: 2px solid var(--border-glass);
    color: var(--text-white);
    padding: var(--spacing-lg);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow:
        var(--shadow-glass),
        inset -1px 0 0 rgba(255, 255, 255, 0.15);
}

.sidebar-header {
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.sidebar-logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.sidebar-logo i {
    font-size: 20px;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: var(--spacing-sm);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    color: var(--text-white);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: var(--text-white);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: 250px;
    padding: var(--spacing-xl);
    width: calc(100% - 250px);
    min-height: 100vh;
}

/* Header - Glassmorphic Enhanced */
.page-header {
    background: linear-gradient(135deg,
        rgba(255, 71, 87, 0.9) 0%,
        rgba(255, 107, 122, 0.85) 100%);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--text-white);
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
    position: relative;
    overflow: hidden;
    box-shadow:
        var(--shadow-md),
        0 0 40px rgba(255, 71, 87, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 200%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), transparent);
    border-radius: var(--radius-lg);
    transform: rotate(15deg);
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    position: relative;
    z-index: 1;
}

.page-header p {
    font-size: 16px;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* Cards - Glassmorphic Enhanced */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow:
        var(--shadow-sm),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    background: var(--bg-card-hover);
    box-shadow:
        var(--shadow-md),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.4);
}

.card-header {
    padding: var(--spacing-lg);
    border-bottom: 2px solid var(--border-light);
    background: rgba(240, 244, 248, 0.6);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-body {
    padding: var(--spacing-lg);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.card-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

/* KPI Cards - Glassmorphic Enhanced */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.kpi-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow:
        var(--shadow-sm),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.kpi-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-6px) scale(1.02);
    box-shadow:
        var(--shadow-md),
        0 0 30px rgba(255, 71, 87, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 71, 87, 0.3);
}

.kpi-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg,
        var(--primary-red) 0%,
        var(--primary-red-bright) 100%);
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.5);
}

.kpi-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg,
        var(--primary-red) 0%,
        var(--primary-red-bright) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 20px;
    margin-bottom: var(--spacing-md);
    box-shadow:
        0 4px 16px rgba(255, 71, 87, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.kpi-card:hover .kpi-icon {
    transform: rotate(-5deg) scale(1.1);
    box-shadow:
        0 6px 24px rgba(255, 71, 87, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.kpi-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.kpi-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.kpi-trend {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 12px;
    font-weight: 500;
    color: var(--primary-green);
}

.kpi-trend i {
    font-size: 10px;
}

/* Buttons - Glassmorphic Enhanced */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    justify-content: center;
    position: relative;
}

.btn-primary {
    background: linear-gradient(135deg,
        var(--primary-red) 0%,
        var(--primary-red-bright) 100%);
    color: var(--text-white);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 4px 16px rgba(255, 71, 87, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg,
        var(--primary-red-bright) 0%,
        var(--primary-red) 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 8px 24px rgba(255, 71, 87, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-secondary {
    background: var(--bg-card);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    color: var(--text-primary);
    border: 2px solid var(--border-light);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 71, 87, 0.4);
    color: var(--primary-red);
    transform: translateY(-2px);
    box-shadow:
        var(--shadow-sm),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-success {
    background: var(--primary-green);
    color: var(--text-white);
}

.btn-success:hover {
    background: #008a47;
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 12px;
}

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

/* Forms - Glassmorphic */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all 0.3s ease;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.form-control:focus {
    outline: none;
    border-color: rgba(254, 87, 87, 0.6);
    background: var(--bg-card-hover);
    box-shadow: 0 0 0 4px rgba(254, 87, 87, 0.1);
}

/* Portfolio Cards - Glassmorphic Enhanced */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.portfolio-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow:
        var(--shadow-sm),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.portfolio-card:hover {
    background: var(--bg-card-hover);
    box-shadow:
        var(--shadow-md),
        0 0 40px rgba(255, 71, 87, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 71, 87, 0.3);
}

.portfolio-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg,
        var(--primary-red) 0%,
        var(--primary-red-bright) 50%,
        var(--primary-red) 100%);
    box-shadow: 0 0 20px rgba(255, 71, 87, 0.5);
}

.portfolio-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.portfolio-meta {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.portfolio-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

/* AI Assistant - Glassmorphic Enhanced */
.ai-assistant {
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.75) 0%,
        rgba(240, 244, 248, 0.75) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 2px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-xl);
    position: relative;
    box-shadow:
        var(--shadow-sm),
        0 0 40px rgba(79, 172, 254, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.ai-assistant:hover {
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(240, 244, 248, 0.85) 100%);
    box-shadow:
        var(--shadow-md),
        0 0 50px rgba(79, 172, 254, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transform: translateY(-4px);
    border-color: rgba(79, 172, 254, 0.3);
}

.ai-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.ai-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg,
        var(--primary-blue) 0%,
        var(--primary-blue-bright) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-size: 18px;
    box-shadow:
        0 4px 16px rgba(79, 172, 254, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.ai-assistant:hover .ai-icon {
    transform: rotate(-5deg) scale(1.1);
}

.ai-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.ai-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.ai-status {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: var(--primary-green);
    color: var(--text-white);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
}

.ai-button {
    background: linear-gradient(135deg, var(--primary-red), rgba(254, 87, 87, 0.9));
    color: var(--text-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    box-shadow: 0 4px 16px rgba(254, 87, 87, 0.3);
}

.ai-button:hover {
    background: linear-gradient(135deg, #e04a4a, rgba(224, 74, 74, 0.9));
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(254, 87, 87, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: var(--spacing-md);
    }
    
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

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

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }
.mt-5 { margin-top: var(--spacing-xl); }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }

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

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-top: 2px solid var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Bootstrap Override - Glassmorphic */
.table-responsive {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
}

.table {
    background: transparent;
}

.badge {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.35em 0.65em;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline-primary,
.btn-outline-success,
.btn-outline-danger {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-danger:hover {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transform: translateY(-2px);
}

.btn-group {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    padding: 2px;
}

/* Timeline - Glassmorphic */
.timeline-item {
    position: relative;
    padding-left: 2rem;
    margin-bottom: var(--spacing-lg);
}

.timeline-marker {
    position: absolute;
    left: 0;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

.timeline-content {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

/* Alert Messages - Glassmorphic */
.alert {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.alert-success {
    background: rgba(0, 162, 84, 0.1);
    border-color: rgba(0, 162, 84, 0.3);
}

.alert-danger {
    background: rgba(254, 87, 87, 0.1);
    border-color: rgba(254, 87, 87, 0.3);
}

.alert-info {
    background: rgba(89, 157, 255, 0.1);
    border-color: rgba(89, 157, 255, 0.3);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
}
