/* Enhanced Dashboard Styles */
/* Modern Color Palette */
:root {
    --primary-color: #128f8a;
    --primary-dark: #0d6b67;
    --secondary-color: #16B3AC;
    --accent-color: #45C2BD;
    --dark-bg: #232A32;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #e0e6ed;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Improvements */
body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f5f7fa;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Enhanced Container */
.home-page {
    padding: 20px;
    max-width: 100%;
    margin: 0 auto;
}

@media (min-width: 1400px) {
    .home-page {
        max-width: 1920px;
    }
}

/* Header/Information Bar */
.accent {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
    overflow: hidden;
}

.information {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.left-side-information,
.right-side-information {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #ffffff;
    font-size: 14px;
}

.left-side-information {
    width: auto;
    margin-top: 0;
}

.right-side-information {
    position: static;
    width: auto;
    margin: 0;
}

.btn-rotate {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-rotate:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(180deg);
}

.btn-rotate img {
    filter: brightness(0) invert(1);
}

/* Enhanced Chart Cards */
.row-chart {
    margin-top: 20px;
    margin-bottom: 20px;
}

.chart {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
    min-height: auto;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chart:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.chart-title {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 2px solid var(--primary-color);
    padding: 18px 24px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 0;
}

.chart-title select {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 400;
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

.chart-title select:hover {
    border-color: var(--primary-color);
}

.content-chart {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Enhanced Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
}

.table-chart {
    width: 100%;
    margin: 0;
    font-size: 14px;
    border-collapse: separate;
    border-spacing: 0;
}

.table-chart thead th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-weight: 600;
    padding: 14px 16px;
    text-align: center;
    border: none;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-chart thead th:first-child {
    text-align: left;
}

.table-chart tbody tr {
    transition: var(--transition);
    background: white;
}

.table-chart tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.table-chart tbody tr:hover {
    background: #e3f2fd;
    transform: scale(1.01);
}

.table-chart tbody td {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.table-chart tbody td.text-left {
    font-weight: 500;
}

/* Filter Sidebar */
.filter-sidebar {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 24px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.filter-section {
    margin-bottom: 20px;
}

.filter-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: block;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(18, 143, 138, 0.1);
}

.form-control:hover {
    border-color: var(--secondary-color);
}

/* Enhanced Buttons */
.btn {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Chart Total Count */
.year-total-count {
    font-size: 56px !important;
    font-weight: 800;
    color: var(--primary-color);
    text-align: center;
    padding: 40px 20px 20px !important;
    font-family: 'Nunito', sans-serif;
}

/* Legend Container */
#chart-legend-container {
    background: #f8f9fa;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 24px;
}

#chart-legend-container > div:first-child,
#chart-legend-container > div:nth-child(2) {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

#chart-legend-container > div:not(:first-child):not(:nth-child(2)) {
    display: flex;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
}

#chart-legend-container > div:not(:first-child):not(:nth-child(2)) > div:first-child {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 10px;
    flex-shrink: 0;
}

/* Loading States */
.chart-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--text-secondary);
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    color: var(--border-color);
}

.empty-state p {
    font-size: 16px;
    margin: 0;
}

/* Maps Container */
#maps {
    min-height: 400px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    overflow: hidden;
}

/* Responsive Grid Improvements */
@media (max-width: 1199px) {
    .home-page {
        padding: 15px;
        left: 0 !important;
        width: 100% !important;
    }

    .chart-title {
        font-size: 16px;
        padding: 14px 18px;
    }

    .year-total-count {
        font-size: 42px !important;
        padding: 30px 15px 15px !important;
    }
}

@media (max-width: 991px) {
    .filter-sidebar {
        position: static;
        margin-bottom: 20px;
    }

    .row-chart {
        margin-left: 0;
        margin-right: 0;
    }

    .information {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .left-side-information,
    .right-side-information {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 767px) {
    .home-page {
        padding: 10px;
    }

    .chart {
        margin-bottom: 15px;
    }

    .chart-title {
        font-size: 14px;
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .chart-title select {
        width: 100%;
    }

    .content-chart {
        padding: 16px;
    }

    .year-total-count {
        font-size: 36px !important;
        padding: 20px 10px 10px !important;
    }

    .table-chart {
        font-size: 12px;
    }

    .table-chart thead th,
    .table-chart tbody td {
        padding: 8px 10px;
    }

    .btn {
        width: 100%;
        padding: 14px 20px;
    }

    .accent {
        border-radius: var(--radius-md);
    }

    .information {
        padding: 15px;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }
}

@media (max-width: 575px) {
    .chart-title {
        font-size: 13px;
        padding: 10px 12px;
    }

    .table-chart {
        font-size: 11px;
    }

    .table-chart thead th,
    .table-chart tbody td {
        padding: 6px 8px;
    }
}

/* Scrollbar Styling */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Print Styles */
@media print {
    .btn-rotate,
    .filter-sidebar,
    .btn {
        display: none;
    }

    .chart {
        page-break-inside: avoid;
        box-shadow: none;
    }
}

/* Accessibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Styles */
button:focus,
select:focus,
input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .chart {
        border: 2px solid var(--text-primary);
    }

    .btn-primary {
        border: 2px solid var(--primary-dark);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
