/* CA Sales Tax Map — Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
    background: #f5f5f5;
}

/* Header */
header {
    background: #1a365d;
    color: white;
    padding: 12px 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header nav {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    color: white;
    text-decoration: none;
    font-size: 20px;
    font-weight: 700;
}

.tagline {
    color: #a0c4ff;
    font-size: 14px;
}

/* Index Page Layout */
.index-layout {
    display: flex;
    height: calc(100vh - 52px);
}

.map-container {
    flex: 1;
    min-width: 0;
}

#map {
    width: 100%;
    height: 100%;
}

.sidebar {
    width: 340px;
    background: white;
    border-left: 1px solid #ddd;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar h3 {
    font-size: 16px;
    color: #1a365d;
    margin-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 6px;
}

.load-error {
    border: 1px solid #feb2b2;
    background: #fff5f5;
    color: #9b2c2c;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.4;
}

/* Search */
.search-wrapper {
    position: relative;
}

#search-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#search-input:focus {
    border-color: #3182ce;
}

.search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.search-item {
    display: block;
    padding: 10px 12px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.search-item:hover {
    background: #ebf4ff;
}

.search-item.no-results {
    color: #888;
    cursor: default;
}

.search-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
}

.search-meta {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

/* Stats Table */
.stats-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table td {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.stats-table td:last-child {
    text-align: right;
    font-weight: 600;
}

.rate-low {
    color: #2f855a;
}

.rate-high {
    color: #c53030;
}

/* Info Section */
.info-section p {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 6px;
}

.meta-section {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.data-source {
    font-size: 12px;
    color: #888;
}

.data-source a {
    color: #3182ce;
}

/* County Detail Page */
.county-layout {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
}

.county-header {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.back-link {
    color: #3182ce;
    text-decoration: none;
    font-size: 14px;
    display: inline-block;
    margin-bottom: 12px;
}

.back-link:hover {
    text-decoration: underline;
}

.county-header h1 {
    font-size: 28px;
    color: #1a365d;
    margin-bottom: 12px;
}

.county-rate {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}

.rate-label {
    font-size: 16px;
    color: #555;
}

.rate-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a365d;
}

.rate-na {
    font-size: 16px;
    color: #888;
    font-weight: 400;
}

.county-notes {
    font-size: 13px;
    color: #888;
    font-style: italic;
    margin-bottom: 8px;
}

.comparison {
    font-size: 14px;
    color: #666;
}

/* Cities Table */
.cities-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.cities-section h2 {
    font-size: 20px;
    color: #1a365d;
    margin-bottom: 16px;
}

.cities-table {
    width: 100%;
    border-collapse: collapse;
}

.cities-table th {
    text-align: left;
    padding: 10px 12px;
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
    font-size: 13px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cities-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.cities-table tr:hover {
    background: #f7fafc;
}

.city-name {
    font-weight: 600;
}

.city-rate {
    font-weight: 600;
    font-family: "SF Mono", "Fira Code", monospace;
}

.city-comparison {
    font-size: 13px;
}

.above {
    color: #c53030;
}

.below {
    color: #2f855a;
}

.at-avg {
    color: #888;
}

.rate-bar {
    height: 4px;
    background: #eee;
    border-radius: 2px;
    margin-top: 4px;
    max-width: 120px;
}

.rate-bar-fill {
    height: 100%;
    border-radius: 2px;
}

.above-bar {
    background: #fc8181;
}

.below-bar {
    background: #68d391;
}

/* Coffee / Donate Section */
.coffee-section {
    text-align: center;
    padding: 12px 0;
    border-top: 1px solid #e2e8f0;
}

.coffee-text {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.4;
}

.venmo-qr {
    width: 130px;
    height: 130px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.venmo-qr-placeholder {
    display: none;
    width: 130px;
    height: 130px;
    border: 2px dashed #ccc;
    border-radius: 6px;
    color: #aaa;
    font-size: 12px;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0 auto;
    line-height: 1.4;
}

/* Disclaimer Footer */
.disclaimer {
    background: #fffbeb;
    border-top: 1px solid #f6e05e;
    color: #744210;
    font-size: 12px;
    line-height: 1.5;
    padding: 10px 24px;
    text-align: center;
}

.disclaimer a {
    color: #744210;
}
