/* Modern Dashboard Design - Inspired by Clean Analytics UI */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8fafc;
    color: #1e293b;
    line-height: 1.6;
}

/* Main Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Left Sidebar */
.sidebar {
    width: 280px;
    background: #1e293b;
    color: white;
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 2rem 2rem;
    border-bottom: 1px solid #334155;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.welcome-text {
    font-size: 14px;
    color: #94a3b8;
    margin-top: 4px;
}

/* Navigation */
.nav-menu {
    padding: 2rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 2rem;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #334155;
    color: white;
    border-left-color: #3b82f6;
}

.nav-item.active {
    background: #334155;
    color: white;
    border-left-color: #3b82f6;
}

.nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    opacity: 0.7;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2rem;
    background: white;
    min-height: 100vh;
}

.content-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 16px;
    color: #64748b;
}

/* Search Bar */
.search-container {
    position: relative;
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px 12px 44px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

/* ROE Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 3rem;
}

.metric-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.metric-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* ROE Score Cards */
.roe-card-confidence {
    background: linear-gradient(135deg, #fef3c7, #f59e0b);
}

.roe-card-choice {
    background: linear-gradient(135deg, #ddd6fe, #8b5cf6);
}

.roe-card-connection {
    background: linear-gradient(135deg, #bfdbfe, #3b82f6);
}

.roe-card-overall {
    background: linear-gradient(135deg, #d1fae5, #10b981);
    grid-column: span 2;
}

.metric-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 16px;
}

.metric-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-icon {
    width: 24px;
    height: 24px;
    opacity: 0.8;
}

.metric-value {
    font-size: 48px;
    font-weight: 800;
    color: white;
    line-height: 1;
    margin-bottom: 8px;
}

.metric-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
}

.metric-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

/* ROE Score Color Coding */
.roe-score-1 { background: linear-gradient(135deg, #fecaca, #ef4444); }
.roe-score-2 { background: linear-gradient(135deg, #fed7aa, #f97316); }
.roe-score-3 { background: linear-gradient(135deg, #fef3c7, #f59e0b); }
.roe-score-4 { background: linear-gradient(135deg, #bbf7d0, #22c55e); }
.roe-score-5 { background: linear-gradient(135deg, #a7f3d0, #10b981); }

/* Current ROE Display */
.current-roe-section {
    background: white;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 3rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #f1f5f9;
}

.current-roe-header {
    text-align: center;
    margin-bottom: 24px;
}

.current-roe-title {
    font-size: 18px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
}

.current-roe-value {
    font-size: 96px;
    font-weight: 900;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.roe-breakdown {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 24px;
}

.roe-component {
    text-align: center;
    padding: 16px;
    border-radius: 12px;
    background: #f8fafc;
}

.component-name {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.component-score {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.component-trend {
    font-size: 12px;
    font-weight: 500;
}

.trend-up { color: #10b981; }
.trend-down { color: #ef4444; }
.trend-flat { color: #64748b; }

/* Emotional Journey Chart */
.chart-section {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #f1f5f9;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.chart-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.chart-period {
    font-size: 14px;
    color: #64748b;
    background: #f8fafc;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.chart-container {
    height: 300px;
    position: relative;
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
}

/* Chart Legend */
.chart-legend {
    display: flex;
    gap: 24px;
    margin-top: 16px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-confidence { background: #f59e0b; }
.legend-choice { background: #8b5cf6; }
.legend-connection { background: #3b82f6; }

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
    }
    
    .roe-card-overall {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .roe-breakdown {
        grid-template-columns: 1fr;
    }
    
    .current-roe-value {
        font-size: 72px;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.metric-card {
    animation: fadeInUp 0.6s ease forwards;
}

.metric-card:nth-child(1) { animation-delay: 0.1s; }
.metric-card:nth-child(2) { animation-delay: 0.2s; }
.metric-card:nth-child(3) { animation-delay: 0.3s; }
.metric-card:nth-child(4) { animation-delay: 0.4s; }

/* Loading States */
.loading-shimmer {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Trends Page - Pillar Grid Layout Fix */
.pillar-trends {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2rem !important;
    width: 100% !important;
    margin-bottom: 4rem !important;
}

.pillar-card {
    min-width: 0 !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    flex: none !important;
}

/* Ensure content sections have full width */
#trends-section .content-section {
    width: 100% !important;
    max-width: none !important;
}

/* Force grid behavior even if other CSS tries to override */
.main-content .pillar-trends {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

/* Responsive grid for trends */
@media (max-width: 1200px) {
    .pillar-trends {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .pillar-trends {
        grid-template-columns: 1fr !important;
    }
}
