:root {
    --bg-color: #f0f2f5;
    --sidebar-bg: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #64748b;
    --accent-red: #e3120b;
    --accent-blue: #347397;
    --border-color: #e2e8f0;
    --header-height: 70px;
    --sidebar-width: 380px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
}

body,
html {
    margin: 0;
    padding: 0;
    height: 100vh;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow: hidden;
}

#header {
    height: var(--header-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

.header-content h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
}

.header-content p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: var(--text-primary);
    color: white;
}

.btn-primary:hover {
    background: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dashboard-container {
    display: flex;
    height: calc(100vh - var(--header-height));
    width: 100%;
}

#map {
    flex: 1;
    height: 100%;
    z-index: 10;
}

#sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background: var(--sidebar-bg);
    border-left: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    z-index: 20;
}

.sidebar-section h3 {
    margin: 0 0 16px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

/* Filter Section Styling */
.search-filter-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(52, 115, 151, 0.1);
}

.date-filter-group {
    display: flex;
    gap: 12px;
}

.date-input {
    flex: 1;
}

.date-input label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.stat-card {
    background: #f8fafc;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Chart Container */
.chart-container {
    padding: 10px;
}

/* Table Styling */
.table-wrapper {
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th {
    text-align: left;
    background: #f1f5f9;
    padding: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

td {
    padding: 12px;
    border-top: 1px solid var(--border-color);
}

tr:hover td {
    background: #fff;
}

/* Notes Section */
#notes-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.note-card {
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    border-left: 4px solid var(--accent-red);
    box-shadow: var(--shadow-sm);
    font-size: 0.85rem;
}

.note-card strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.note-card p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Legend (Adjusted for dashboard) */
.legend {
    position: absolute;
    bottom: 24px;
    left: 24px;
    /* Move to left side to avoid sidebar overlap */
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    z-index: 1000;
}

.legend h4 {
    margin: 0 0 12px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.legend-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-circle.terror {
    background: var(--accent-blue);
}

.legend-circle.drone {
    background: var(--accent-red);
}

/* Custom Scrollbar */
#sidebar::-webkit-scrollbar {
    width: 6px;
}

#sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* Tooltip Styling */
.leaflet-tooltip-own {
    background: white !important;
    border: none !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
    border-radius: 8px !important;
    padding: 0 !important;
}

.custom-tooltip {
    min-width: 180px;
    overflow: hidden;
}

.tooltip-header {
    background: #f8fafc;
    padding: 10px 15px;
    font-weight: 800;
    border-bottom: 1px solid var(--border-color);
}

.tooltip-body {
    padding: 12px 15px;
}

.type-label {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.type-label.terrorist-attacks {
    background: #e0f2fe;
    color: var(--accent-blue);
}

.type-label.us-drone-strikes {
    background: #fee2e2;
    color: var(--accent-red);
}

.count-number {
    font-size: 1.25rem;
    font-weight: 800;
}