/* Insights Dashboard Styles */

/* Chart containers */
.chart-container {
    position: relative;
    height: 300px;
    padding: 20px;
}

.chart-container canvas {
    max-height: 100%;
}

/* State breakdown styles */
.state-breakdown, .price-breakdown, .type-breakdown {
    padding: 1.5rem;
}

.state-item, .price-item, .type-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 1rem;
}

.state-item:last-child, .price-item:last-child, .type-item:last-child {
    border-bottom: none;
}

.state-info, .price-info, .type-info {
    display: flex;
    flex-direction: column;
    min-width: 140px;
    flex-shrink: 0;
}

.state-name, .price-state, .type-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #333;
    line-height: 1.2;
}

.state-count, .price-value, .type-count {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.25rem;
    line-height: 1.2;
}

.state-bar, .price-bar, .type-bar {
    flex: 1;
    height: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    margin: 0 1rem;
    position: relative;
    overflow: hidden;
    min-width: 80px;
}

.state-fill, .price-fill, .type-fill {
    height: 100%;
    background: linear-gradient(90deg, #000 0%, #333 100%);
    border-radius: 5px;
    transition: width 0.3s ease;
}

.state-change {
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 70px;
    text-align: right;
    flex-shrink: 0;
}

.state-change.positive {
    color: #22c55e;
}

.state-change.negative {
    color: #ef4444;
}

.type-avg {
    font-size: 0.75rem;
    color: #666;
    min-width: 80px;
    text-align: right;
    flex-shrink: 0;
}

/* Chart filter styles */
.chart-filter {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.chart-filter:focus {
    outline: none;
    border-color: #000;
}

/* Charts Grid Layout */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Chart Card Styles */
.chart-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    overflow: hidden;
}

.chart-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #000;
    margin: 0;
}

.chart-container {
    padding: 1.5rem;
    position: relative;
    height: 450px;
}

.chart-container canvas {
    max-width: 100%;
    height: auto;
}

/* Chart Filter Styles */
.chart-filter {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    font-size: 0.875rem;
    color: #333;
    cursor: pointer;
}

.chart-filter:focus {
    outline: none;
    border-color: #000;
}

/* Forecast Grid */
.forecast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.forecast-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-align: center;
    border: 1px solid #f0f0f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.forecast-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.forecast-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.forecast-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 0.5rem;
}

.forecast-value {
    font-size: 2rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 1rem;
}

.forecast-card p {
    color: #666;
    font-size: 0.875rem;
    margin: 0;
}

/* Performance badge styles */
.performance-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.performance-badge.excellent {
    background-color: #dcfce7;
    color: #166534;
}

.performance-badge.good {
    background-color: #dbeafe;
    color: #1e40af;
}

.performance-badge.average {
    background-color: #fef3c7;
    color: #92400e;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chart-container {
        height: 350px;
        padding: 1rem;
    }
    
    .chart-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .chart-filter {
        width: 100%;
    }
    
    .state-item, .price-item, .type-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.75rem 0;
    }
    
    .state-info, .price-info, .type-info {
        min-width: auto;
        width: 100%;
    }
    
    .state-bar, .price-bar, .type-bar {
        width: 100%;
        margin: 0;
        min-width: auto;
    }
    
    .state-change, .type-avg {
        align-self: flex-end;
        min-width: auto;
    }
    
    .forecast-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .forecast-card {
        padding: 1.5rem;
    }
}

/* Loading states */
.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #666;
    font-style: italic;
}

/* Transition effects */
.metric-card, .chart-card, .location-card {
    transition: all 0.3s ease;
}

.filter-btn {
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background-color: #f5f5f5;
}

.filter-btn.active {
    background-color: #000;
    color: white;
}

/* Additional spacing */
.mt-4 {
    margin-top: 2rem;
}

/* Page Header Styles */
.page-header {
    background: linear-gradient(135deg, #0A58BF 0%, #0A58AF 100%); /* linear-gradient(135deg, #000 0%, #333 100%); */
    color: white;
    padding: 4rem 0 2rem;
    position: relative;
}

.page-header-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}

.page-header-content p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: white;
}

/* Stats Grid Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-align: center;
    border: 1px solid #f0f0f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #000;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #666;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

/* Section Styles */
.section {
    padding: 4rem 0;
}

.section.bg-light {
    background-color: #f8f9fa;
}

.section-header {
    margin-bottom: 3rem;
}

.section-header.text-center {
    text-align: center;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.125rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.analytics-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    overflow: hidden;
}

.analytics-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}

.analytics-card-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #000;
    margin: 0;
}

.analytics-card-body {
    padding: 1.5rem;
}

/* Agents Table */
.agents-table {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    overflow: hidden;
}

.table-header {
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.table-row {
    display: grid;
    grid-template-columns: 60px 1fr 120px;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.table-row:last-child {
    border-bottom: none;
}

.table-header .table-row {
    font-weight: 600;
    color: #333;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-cell {
    display: flex;
    align-items: center;
}

.agent-info strong {
    font-weight: 600;
    color: #000;
}

/* Period Filter */
.period-filter {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #333;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.filter-btn:hover {
    background-color: #f5f5f5;
    border-color: #999;
}

.filter-btn.active {
    background-color: #000;
    color: white;
    border-color: #000;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-header-content h1 {
        font-size: 2rem;
    }
    
    .page-header-content p {
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .analytics-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .table-row {
        grid-template-columns: 50px 1fr 100px;
        padding: 0.75rem 1rem;
    }
    
    .period-filter {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 100%;
        max-width: 200px;
    }
}