/* =====================================================
   Leads Dashboard Styles
   Based on Bluebonnet brand guide (brand.md)
   ===================================================== */

/* CSS Variables - Brand Colors */
:root {
    --primary-blue: #130e36;
    --secondary-purple: #423e5e;
    --bg-light: #f9f9f9;
    --text-dark: #333;
    --border-grey: #ddd;
    --success-green: #28a745;
    --error-red: #e74c3c;
    --accent-yellow: #ffc107;
    --accent-blue: #03a9f4;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-purple) 100%);
    padding: 20px;
    color: var(--text-dark);
    min-height: 100vh;
}

/* =====================================================
   Header - Consistent with other dashboards
   ===================================================== */
.header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 15px 30px;
    background: var(--primary-blue);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 15px 15px 0 0;
    margin-bottom: 0;
}

.header> :first-child {
    justify-self: start;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    white-space: nowrap;
}

.header .header-buttons {
    justify-self: end;
}

.header-buttons {
    display: flex;
    gap: 10px;
}

/* =====================================================
   Buttons - Consistent with other dashboards
   ===================================================== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: #e8e8e8;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* =====================================================
   Dashboard Container
   ===================================================== */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.dashboard-content {
    padding: 20px 30px 30px;
}

/* =====================================================
   Filters Section
   ===================================================== */
.filters {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--border-grey);
}

.filter-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-item label {
    font-weight: 600;
    color: #555;
    font-size: 0.9em;
}

.filter-item select,
.filter-item input {
    padding: 10px 15px;
    border: 2px solid var(--border-grey);
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-item select:hover,
.filter-item input:hover {
    border-color: var(--primary-blue);
}

.filter-item select:focus,
.filter-item input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

/* =====================================================
   KPI Cards
   ===================================================== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.kpi-card {
    background: var(--bg-light);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
    border: 1px solid var(--border-grey);
}

.kpi-card:hover {
    transform: translateY(-5px);
}

.kpi-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.kpi-value {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--primary-blue);
}

.kpi-subvalue {
    font-size: 0.9em;
    color: #999;
    margin-top: 5px;
}

/* =====================================================
   Chart Containers
   ===================================================== */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.chart-container {
    background: var(--bg-light);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-grey);
}

.chart-container.full-width {
    grid-column: 1 / -1;
}

.chart-title {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.chart-wrapper {
    position: relative;
    height: 350px;
}

.chart-wrapper.tall {
    height: 450px;
}

/* =====================================================
   Loading State
   ===================================================== */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2em;
    color: white;
}

.loading-inner {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 600px;
    margin: 0 auto;
    color: var(--text-dark);
}

.loading-inner h2 {
    color: var(--error-red);
    margin-bottom: 15px;
}

.loading-inner p {
    margin-bottom: 15px;
    color: #666;
}

.load-sample-btn {
    padding: 12px 24px;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.2s;
}

.load-sample-btn:hover {
    background: var(--secondary-purple);
}

/* =====================================================
   Responsive Design
   ===================================================== */
@media (max-width: 768px) {
    .chart-grid {
        grid-template-columns: 1fr;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .header {
        padding: 15px;
    }

    .header h1 {
        font-size: 18px;
    }

    .dashboard-content {
        padding: 15px;
    }
}