/* Reset & base */
* { box-sizing: border-box; }
html,body{ height:100%; }
body{
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	margin:0;
	background:#fafafa;
	color:#222;
	-webkit-font-smoothing:antialiased;
}

/* Layout container */
#top-header{ background: linear-gradient(180deg,#3a3a3a,#2e2e2e); color:#fff; }
#header{ max-width:1100px; margin:0 auto; padding:22px 16px; font-family: Georgia, 'Times New Roman', serif; font-size:32px; text-align:center; }
#container{ max-width:1100px; margin:20px auto; padding:0 18px; }

.byline{ margin:14px 0; font-size:13px; color:#555; }
.byline a{ text-transform:uppercase; color:#b22222; text-decoration:none; }
#intro{ margin:18px 0 28px; color:#444; line-height:1.5 }

#table-stuff{ display:flex; gap:20px; align-items:flex-start; }
#mainbar{ flex:1 1 65%; }
#sidebar{ flex:0 1 300px; }
#more-stuff{ background:#fff; border-radius:8px; padding:12px; box-shadow:0 1px 4px rgba(16,24,40,0.06); border:1px solid #eee; min-height:120px }

.more-button{ background:#0066cc; color:#fff; border:0; padding:6px 10px; border-radius:6px; cursor:pointer; font-size:13px }
.more-button:hover{ background:#0056b3 }

/* Stats row */
.stat-row{ display:flex; gap:14px; margin-bottom:18px; align-items:stretch }
.stat-card{ background:linear-gradient(180deg,#fff,#fbfbfb); border:1px solid #eee; padding:14px 18px; border-radius:8px; flex:1; text-align:center; box-shadow:0 1px 3px rgba(16,24,40,0.04) }
.stat-value{ font-size:28px; font-weight:800; color:#111; line-height:1 }
.stat-label{ margin-top:6px; font-size:13px; color:#555 }


/* Table styling */
table{ width:100%; border-collapse:separate; border-spacing:0; font-size:14px; background:#fff; border-radius:8px; overflow:hidden; box-shadow:0 2px 8px rgba(16,24,40,0.04); }
thead th{ background:#f6f7f9; padding:12px 14px; text-align:left; font-weight:600; color:#222; border-bottom:1px solid #eee }
tbody td{ padding:12px 14px; border-bottom:1px solid #f2f4f7; color:#333 }
tbody tr:hover{ background:linear-gradient(90deg, rgba(0,102,204,0.03), rgba(0,102,204,0.01)); }

/* Make date cells monospace for alignment */
tbody td:nth-child(2), tbody td:nth-child(3){ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', monospace }

p{ line-height:1.6 }
a{ color:#b22222; text-decoration:none }
a:hover{ color:#7a0000 }

footer{ margin-top:26px; padding:12px; background:#6a1b1b; color:white }
#footer-text{ text-align:center }

/* Responsive tweaks */
@media (max-width: 900px){
	#table-stuff{ flex-direction:column }
	#sidebar{ order: 2 }
	#mainbar{ order: 1 }
	table{ font-size:13px }
	.stat-value{ font-size:22px }
}

@media (max-width: 520px){
	thead th:nth-child(n+5), tbody td:nth-child(n+5){ display:none }
	thead th:nth-child(4), tbody td:nth-child(4){ display:table-cell }
	#sidebar{ display:block; width:100% }
	.more-button{ padding:8px 12px; font-size:14px }
}

/* Phase 1: Crime Category Colors */
.crime-legend {
	display: flex;
	gap: 12px;
	margin: 16px 0;
	padding: 12px;
	background: white;
	border-radius: 8px;
	border: 1px solid #eee;
	flex-wrap: wrap;
	align-items: center;
}

.legend-item {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
}

.legend-color {
	width: 20px;
	height: 20px;
	border-radius: 4px;
	border: 2px solid;
}

/* Row coloring for crime categories */
tr.crime-violent { background-color: #ffebee !important; }
tr.crime-property { background-color: #fff3e0 !important; }
tr.crime-drugs { background-color: #f3e5f5 !important; }
tr.crime-traffic { background-color: #e3f2fd !important; }
tr.crime-other { background-color: #f5f5f5 !important; }

/* Phase 1: Days-Since Tracker */
#days-since-section {
	margin: 20px 0;
}

#days-since-container {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.days-since-card {
	flex: 1;
	min-width: 150px;
	padding: 14px;
	border-radius: 8px;
	text-align: center;
	border: 2px solid;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.days-since-card.alert-green {
	background: #e8f5e9;
	border-color: #4caf50;
}

.days-since-card.alert-yellow {
	background: #fff9e6;
	border-color: #ffc107;
}

.days-since-card.alert-red {
	background: #ffebee;
	border-color: #f44336;
}

.days-value {
	font-size: 20px;
	font-weight: 700;
	margin-bottom: 6px;
}

.days-label {
	font-size: 12px;
	color: #555;
	font-weight: 500;
	line-height: 1.3;
}

@media (max-width: 768px) {
	.days-since-card {
		min-width: calc(50% - 6px);
	}
}

/* Phase 1: Export Button */
.export-btn {
	background: linear-gradient(180deg, #b22222, #9a1e1e);
	color: white;
	border: none;
	padding: 10px 18px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
	transition: all 0.2s;
}

.export-btn:hover {
	background: linear-gradient(180deg, #9a1e1e, #7a0000);
	box-shadow: 0 3px 6px rgba(0,0,0,0.15);
	transform: translateY(-1px);
}

.export-btn span {
	font-size: 16px;
	margin-right: 4px;
}