/* ========================================
   Investment Dashboard - New Green Theme
   ======================================== */

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

:root {
    /* Background Colors */
    --bg-primary: #d4f5a0;
    --bg-secondary: #CDFF4D;
    --bg-card: #f5f5f5;

    /* Accent Colors */
    --accent-primary: #CDFF4D;
    --accent-orange: #FFAC26;
    --accent-danger: #ef4444;

    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-light: #f5f5f5;
    --text-dark: #050505;

    /* Borders & Shadows */
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-header: 0 2px 8px rgba(0, 0, 0, 0.08);

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

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-primary));
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-md);
}

/* Header */
.header {
    background: linear-gradient(135deg, #CDFF4D 0%, #b8e63d 50%, #a8d62d 100%);
    padding: var(--spacing-sm) var(--spacing-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 100;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    animation: headerShimmer 4s ease-in-out infinite;
}

@keyframes headerShimmer {
    0% {
        left: -100%;
    }

    50% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.header-logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.header-logo::before {
    content: '📊';
    font-size: 1.5rem;
}

.header-logo::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 40%,
            rgba(255, 255, 255, 0.3) 50%,
            transparent 60%);
    animation: logoShine 3s ease-in-out infinite;
}

@keyframes logoShine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

.header-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
    letter-spacing: 0.5px;
}

.header-brand h1 span {
    color: #0f3460;
    font-weight: 800;
    text-shadow: none;
}

.header-nav {
    display: flex;
    gap: var(--spacing-md);
}

.nav-link {
    color: #1a1a2e;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #1a1a2e, #0f3460);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover {
    color: #0f3460;
    background: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.nav-link:hover::before {
    width: 80%;
}

.nav-link.active {
    color: #0f3460;
    background: rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-link.active::before {
    width: 80%;
}

/* Filter Card */
.filter-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-sm);
}

/* Glass Effect */
.glass {
    background: rgba(255, 255, 255, 0.25) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Glass Frame for Data Section */
.glass-frame {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.filter-header {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-dark);
    background: #CDFF4D;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-sm);
    box-shadow: 0 2px 8px rgba(205, 255, 77, 0.4);
}

.filter-header i {
    width: 18px;
    height: 18px;
    color: var(--accent-primary);
}

.filter-controls {
    display: flex;
    align-items: flex-end;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-input {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    min-width: 180px;
}

.filter-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.2);
}

.filter-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-orange);
    color: var(--text-primary);
}

.btn-primary:hover {
    background: var(--accent-secondary);
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

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

/* Section Title */
.section-title {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.section-title span {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--text-primary);
    font-weight: 600;
    padding: 0.75rem 3rem;
    border-radius: var(--radius-lg);
    font-size: 1rem;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

/* Top Row Layout */
.top-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Investasi Card */
.investasi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    box-shadow: var(--shadow-sm);
    flex: 1;
}

.investasi-icon {
    width: 56px;
    height: 56px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.investasi-icon i {
    width: 28px;
    height: 28px;
    color: white;
}

.investasi-content {
    flex: 1;
}

.investasi-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    font-weight: 600;
}

.investasi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-orange);
    line-height: 1.2;
}

.investasi-exact {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Small Cards Row */
.small-cards-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-xs);
}

.small-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm);
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.small-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
}

.small-card-icon i {
    width: 16px;
    height: 16px;
    color: white;
}

.small-card-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
}

.small-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-orange);
    line-height: 1.2;
}

/* Chart Cards */
.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-sm);
}

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

.chart-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chart-container {
    position: relative;
    height: 200px;
}

.chart-container.chart-tall {
    height: 280px;
}

/* Pie Charts Row */
.pie-charts-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

/* Bar Charts Row */
.bar-charts-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

/* Sektor Section */
.sektor-section {
    margin-bottom: var(--spacing-md);
}

.sektor-section .chart-card {
    max-width: 800px;
    margin: 0 auto;
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--spacing-md);
    margin-top: var(--spacing-lg);
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .top-row {
        grid-template-columns: 1fr 1fr;
    }

    .left-column {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .top-row {
        grid-template-columns: 1fr;
    }

    .left-column {
        grid-column: span 1;
    }

    .pie-charts-row {
        grid-template-columns: 1fr;
    }

    .bar-charts-row {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .header-nav {
        gap: var(--spacing-sm);
    }

    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }

    .filter-input {
        width: 100%;
    }

    .filter-actions {
        width: 100%;
    }

    .btn {
        flex: 1;
    }

    .small-cards-row {
        grid-template-columns: 1fr;
    }
}