/* MANTRA Advanced Dashboard - Competitor-Beating Design */

:root {
    /* Modern Color Palette */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --warning-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --info-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --danger-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    
    /* Advanced Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.25);
    
    /* Modern Typography */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
}

/* Advanced Dashboard Container */
.advanced-dashboard {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: var(--space-lg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Modern Header Bar */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg) var(--space-xl);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dashboard-title {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.dashboard-title h1 {
    font-size: 1.875rem;
    font-weight: var(--font-weight-bold);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.dashboard-subtitle {
    color: rgba(0, 0, 0, 0.6);
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
}

/* Advanced Widget Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.dashboard-grid.two-column {
    grid-template-columns: 2fr 1fr;
}

.dashboard-grid.three-column {
    grid-template-columns: repeat(3, 1fr);
}

.dashboard-grid.four-column {
    grid-template-columns: repeat(4, 1fr);
}

/* Premium Widget Cards */
.premium-widget {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.premium-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: 20px 20px 0 0;
}

.premium-widget:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

/* Widget Headers */
.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.widget-title {
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
    color: #1a202c;
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.widget-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    background: var(--primary-gradient);
}

/* Advanced KPI Cards */
.kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
}

.kpi-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
    border-radius: 16px;
    padding: var(--space-lg);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--success-gradient);
}

.kpi-card.warning::before { background: var(--warning-gradient); }
.kpi-card.danger::before { background: var(--danger-gradient); }
.kpi-card.info::before { background: var(--info-gradient); }

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: var(--font-weight-bold);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.kpi-label {
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    color: rgba(0, 0, 0, 0.6);
    margin: var(--space-sm) 0 0 0;
}

.kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.75rem;
    font-weight: var(--font-weight-semibold);
    padding: var(--space-xs) var(--space-sm);
    border-radius: 12px;
    margin-top: var(--space-sm);
}

.kpi-trend.up {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.kpi-trend.down {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.kpi-trend.stable {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* Modern Chart Container */
.chart-widget {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
}

.chart-controls {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.chart-control-btn {
    padding: var(--space-sm) var(--space-md);
    border: 2px solid transparent;
    border-radius: 8px;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.chart-control-btn:hover {
    background: rgba(102, 126, 234, 0.2);
}

.chart-control-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

/* Activity Feed Widget */
.activity-feed {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.activity-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: var(--font-weight-semibold);
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    color: #1a202c;
    margin: 0 0 var(--space-xs) 0;
}

.activity-meta {
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.5);
}

/* Quick Stats Bar */
.quick-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-md);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: var(--space-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-xl);
}

.quick-stat {
    text-align: center;
}

.quick-stat-value {
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quick-stat-label {
    font-size: 0.75rem;
    font-weight: var(--font-weight-medium);
    color: rgba(0, 0, 0, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border: none;
    border-radius: 12px;
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-size: 0.875rem;
}

.action-btn.primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
}

.action-btn.secondary {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.action-btn.secondary:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dashboard-grid.two-column,
    .dashboard-grid.three-column,
    .dashboard-grid.four-column {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
}

@media (max-width: 768px) {
    .advanced-dashboard {
        padding: var(--space-md);
    }
    
    .premium-widget {
        padding: var(--space-lg);
    }
    
    .kpi-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .kpi-cards,
    .quick-stats-bar {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-btn {
        justify-content: center;
    }
}

/* Wide Widget Support */
.wide-widget {
    grid-column: span 2;
}

@media (max-width: 1024px) {
    .wide-widget {
        grid-column: span 1;
    }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .advanced-dashboard {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    }
    
    .premium-widget,
    .dashboard-header,
    .quick-stats-bar {
        background: rgba(30, 41, 59, 0.95);
        border-color: rgba(148, 163, 184, 0.1);
    }
    
    .widget-title,
    .activity-title {
        color: #f8fafc;
    }
    
    .kpi-label,
    .activity-meta,
    .quick-stat-label {
        color: rgba(148, 163, 184, 0.8);
    }
}