/*
 * Dashboard Styles - Compact Version
 * ===================================
 */

/* =============================================================================
   GENERAL STYLES
   ============================================================================= */

body {
    background-color: #f5f7fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 12px;
}

h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem !important;
}

/* =============================================================================
   HEADER & BRANDING
   ============================================================================= */

.territory-header {
    background: linear-gradient(90deg, #2d5a87 0%, #1e3a5f 100%);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.territory-header h2 {
    font-size: 1rem;
    margin-bottom: 2px !important;
}

.territory-header p {
    font-size: 0.8rem;
    margin-bottom: 0;
}

.text-light-blue {
    color: #b8d4e8;
}

/* =============================================================================
   METRIC CARDS - COMPACT
   ============================================================================= */

.metric-card {
    background: white;
    border-radius: 6px;
    padding: 8px 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.metric-label {
    font-size: 0.7rem;
    color: #6c757d;
    margin-bottom: 2px;
}

.metric-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e3a5f;
}

/* Smaller metric cards for the demographics breakdown */
.metric-card-small {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: 5px;
}

.metric-card-small .label {
    color: #6c757d;
    font-size: 0.75rem;
}

.metric-card-small .value {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1e3a5f;
}

/* =============================================================================
   CARDS - COMPACT
   ============================================================================= */

.card {
    border: none;
    border-radius: 8px;
}

.card-header {
    background: linear-gradient(90deg, #1e3a5f 0%, #2d5a87 100%);
    color: white;
    border-radius: 8px 8px 0 0 !important;
    padding: 8px 12px;
}

.card-header h5 {
    margin: 0;
    font-weight: 500;
    font-size: 0.85rem;
}

.card-body {
    padding: 12px;
}

/* =============================================================================
   SIDEBAR - COMPACT
   ============================================================================= */

.sidebar .card {
    position: sticky;
    top: 10px;
}

/* =============================================================================
   TABLES - COMPACT
   ============================================================================= */

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 0.7rem;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
    padding: 6px 8px;
}

.table td {
    font-size: 0.75rem;
    vertical-align: middle;
    padding: 5px 8px;
}

.table-hover tbody tr:hover {
    background-color: #e8f4fd;
}

/* Sticky header for scrollable tables */
.sticky-top {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* =============================================================================
   FORM CONTROLS - COMPACT
   ============================================================================= */

.form-label {
    font-size: 0.75rem;
    color: #495057;
    margin-bottom: 3px;
}

.form-select {
    border-radius: 5px;
    border: 1px solid #ced4da;
    font-size: 0.8rem;
    padding: 5px 8px;
}

.form-select:focus {
    border-color: #2d5a87;
    box-shadow: 0 0 0 0.15rem rgba(45, 90, 135, 0.25);
}

/* Bootstrap Select customization */
.bootstrap-select .dropdown-toggle {
    border-radius: 5px !important;
    font-size: 0.8rem !important;
    padding: 5px 8px !important;
}

.bootstrap-select .dropdown-menu {
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-size: 0.8rem;
}

.bootstrap-select .dropdown-item {
    padding: 4px 12px;
    font-size: 0.8rem;
}

/* =============================================================================
   BUTTONS - COMPACT
   ============================================================================= */

.btn-primary {
    background: linear-gradient(90deg, #2d5a87 0%, #1e3a5f 100%);
    border: none;
    border-radius: 5px;
    padding: 6px 12px;
    font-weight: 500;
    font-size: 0.8rem;
}

.btn-primary:hover {
    background: linear-gradient(90deg, #1e3a5f 0%, #152a45 100%);
}

.btn-outline-primary {
    border-color: #2d5a87;
    color: #2d5a87;
    border-radius: 5px;
    font-size: 0.75rem;
    padding: 4px 10px;
}

.btn-outline-primary:hover {
    background-color: #2d5a87;
    border-color: #2d5a87;
}

.btn-sm {
    font-size: 0.7rem;
    padding: 3px 8px;
}

/* =============================================================================
   ALERTS - COMPACT
   ============================================================================= */

.alert-info {
    background-color: #e8f4fd;
    border-color: #b8d4e8;
    color: #1e3a5f;
    border-radius: 5px;
    padding: 8px 10px;
    font-size: 0.75rem;
}

/* =============================================================================
   ACCORDION - COMPACT
   ============================================================================= */

.accordion-button {
    font-weight: 500;
    font-size: 0.8rem;
    color: #1e3a5f;
    padding: 8px 12px;
}

.accordion-button:not(.collapsed) {
    background-color: #e8f4fd;
    color: #1e3a5f;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.15rem rgba(45, 90, 135, 0.25);
}

.accordion-body {
    padding: 10px 12px;
}

/* =============================================================================
   MAP CONTAINER
   ============================================================================= */

#countyMap {
    border-radius: 0 0 8px 8px;
}

/* Loading spinner */
.spinner-border {
    width: 2rem;
    height: 2rem;
}

/* =============================================================================
   FOOTER - COMPACT
   ============================================================================= */

footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 10px 0 !important;
}

footer p {
    font-size: 0.75rem;
    margin-bottom: 2px !important;
}

/* =============================================================================
   NAVBAR - COMPACT
   ============================================================================= */

.navbar {
    padding: 6px 12px !important;
}

.navbar-brand {
    font-size: 1rem !important;
}

.navbar-text {
    font-size: 0.75rem;
}

/* =============================================================================
   SPACING OVERRIDES - COMPACT
   ============================================================================= */

.mb-3 {
    margin-bottom: 0.6rem !important;
}

.mb-4 {
    margin-bottom: 0.8rem !important;
}

.mt-3 {
    margin-top: 0.6rem !important;
}

.g-3 {
    --bs-gutter-y: 0.6rem;
    --bs-gutter-x: 0.6rem;
}

.py-4 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}

/* =============================================================================
   ROW GAPS - COMPACT
   ============================================================================= */

.row {
    --bs-gutter-x: 0.8rem;
}

/* =============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================= */

/* For tablets and smaller */
@media (max-width: 992px) {
    .metric-value {
        font-size: 0.9rem;
    }
    
    .metric-card {
        padding: 6px 10px;
    }
}

/* For phones */
@media (max-width: 576px) {
    .territory-header {
        padding: 10px;
    }
    
    .territory-header h2 {
        font-size: 1rem;
    }
    
    .metric-card {
        margin-bottom: 6px;
    }
}

/* =============================================================================
   UTILITY CLASSES
   ============================================================================= */

.shadow-sm {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
}

.rounded-lg {
    border-radius: 8px !important;
}

/* Text colors */
.text-primary-dark {
    color: #1e3a5f;
}

/* Compact horizontal rule */
hr {
    margin: 8px 0;
}
