/* Zone Map Englewood Styles - DLS Dark Theme */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 100%);
    min-height: 100vh;
    padding-top: 44px;
}

/* Layout Shell - Sidebar + Main Content */
.layout-shell {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    display: none;
}

@media (min-width: 1024px) {
    .sidebar {
        display: flex;
        flex-direction: column;
        width: 16rem;
        flex-shrink: 0;
        position: sticky;
        top: 60px;
        overflow-y: auto;
        background: #1f1f1f;
        border-right: 1px solid #333333;
    }

    .sidebar-header {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 1.5rem;
        border-bottom: 1px solid #333333;
        flex-shrink: 0;
    }

    .sidebar-icon {
        width: 2.5rem;
        height: 2.5rem;
        background: #2d5016;
        border-radius: 0.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
    }

    .sidebar-title {
        font-size: 1.25rem;
        font-weight: 700;
        color: #f0f0f0;
        margin: 0;
    }

    .sidebar-subtitle {
        font-size: 0.75rem;
        color: #9ca3af;
        margin: 0;
    }
}

/* Main Content Area */
.layout-main {
    flex: 1;
    overflow-y: auto;
    padding-top: 5px;
    min-height: 0;
}

/* Container */
.container {
    max-width: 1200px;
    /* No top margin: that black band above the card was dead space above the map. */
    margin: 0 auto 2rem;
    padding: 0 1rem;
}

.card {
    background: #1f1f1f;
    border: 1px solid #333333;
    border-left: 4px solid #2d5016;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    /* Tightened from 2.5rem: keeps a visible frame around the map without
       the wide grey margin that pushed the popup and controls down. */
    padding: 1rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    width: 100%;
    max-width: 320px;
    height: auto;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d5016;
    margin-bottom: 1rem;
}

.subtitle {
    color: #b0b0b0;
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Map Container */
.map-container {
    width: 100%;
    /* Google caps the info window's content at roughly (map height - 204px).
       The sales popup runs to ~490px with a full tax breakdown, so 600px here
       left it scrolling; 780px fits that plus a few more district rows. */
    height: 780px;
    background: #2a2a2a;
    border: 2px solid #3a3a3a;
    border-radius: 1rem;
    margin-bottom: 2rem;
    position: relative;
}

/* Loading Indicator */
.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #1f1f1f;
    color: #3d7a2e;
    padding: 1.5rem 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    border: 2px solid #3d7a2e;
    font-weight: 600;
}

/* Search Container */
.search-container {
    position: relative;
    margin-bottom: 2rem;
}

.search-input-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.search-input-group .search-input {
    min-width: 200px;
}

.search-input {
    flex: 1;
    padding: 1rem;
    font-size: 1rem;
    background: #2a2a2a;
    color: #f0f0f0;
    border: 2px solid #3d7a2e;
    border-radius: 0.75rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #3d7a2e;
    box-shadow: 0 0 0 3px rgba(61, 122, 46, 0.1);
}

.search-input::placeholder {
    color: #6b7280;
}

.clear-button {
    padding: 0 1.5rem;
    background: #3a3a3a;
    color: #e0e0e0;
    border: 2px solid #4a4a4a;
    border-radius: 0.75rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-button:hover {
    background: #4a4a4a;
    color: #fff;
}

/* History Button & Panel */
.history-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1.25rem;
    background: #2a3a1a;
    color: #cfe7b8;
    border: 2px solid #3d7a2e;
    border-radius: 0.75rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.history-button:hover {
    background: #3d7a2e;
    color: #fff;
}

.history-button[aria-expanded="true"] {
    background: #3d7a2e;
    color: #fff;
}

/* Opens upward over the map rather than pushing the page down, so the whole
   list is reachable without scrolling the page. The list itself still scrolls.
   .search-container is already position: relative, which anchors this. */
.history-panel {
    position: absolute;
    bottom: calc(100% + 0.75rem);
    left: 0;
    right: 0;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    max-height: min(70vh, 620px);
    background: #2a2a2a;
    border: 2px solid #3a3a3a;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #1f1f1f;
    border-bottom: 1px solid #3a3a3a;
}

.history-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #cfe7b8;
}

.history-clear-all {
    background: transparent;
    color: #ff8888;
    border: 1px solid #7a2f2f;
    border-radius: 0.5rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.history-clear-all:hover {
    background: #4a1f1f;
    color: #ffb0b0;
}

.history-list {
    /* Height comes from the panel's max-height now; this scrolls inside it. */
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #e0e0e0;
    cursor: pointer;
    border-bottom: 1px solid #3a3a3a;
    transition: background 0.2s;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:hover {
    background: #3a3a3a;
}

.history-address {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;
}

.history-remove {
    background: transparent;
    color: #9ca3af;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.history-remove:hover {
    background: #4a1f1f;
    color: #ff8888;
}

.history-empty {
    padding: 1.25rem 1rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* Suggestions List */
.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2a2a2a;
    border: 2px solid #3a3a3a;
    border-top: none;
    border-radius: 0 0 0.75rem 0.75rem;
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.suggestion-item {
    padding: 1rem;
    color: #e0e0e0;
    cursor: pointer;
    border-bottom: 1px solid #3a3a3a;
    transition: all 0.2s;
}

.suggestion-item:hover {
    background: #3a3a3a;
}

.suggestion-item.selected {
    background: #3d7a2e;
    color: #fff;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* Error Display */
.error-display {
    padding: 1rem 1.5rem;
    background: #4a1f1f;
    color: #ff8888;
    border: 2px solid #7a2f2f;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
}

/* Tax Lookup Result */
.tax-result {
    padding: 1.5rem;
    background: #1a3a0d;
    border: 2px solid #2d5016;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
}

.tax-result h3 {
    font-size: 1.25rem;
    color: #4ade80;
    margin-bottom: 1rem;
}

.tax-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tax-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tax-label {
    color: #9ca3af;
    font-size: 0.95rem;
}

.tax-value {
    color: #e0e0e0;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Zone Information */
.zone-info {
    margin-top: 3rem;
}

.zone-info h2 {
    font-size: 1.75rem;
    color: #2d5016;
    margin-bottom: 1.5rem;
}

.zone-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.zone-info-card {
    background: #2a2a2a;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 2px solid #3a3a3a;
}

.zone-info-card.full-width {
    grid-column: 1 / -1;
}

.zone-info-card h3 {
    color: #3d7a2e;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.zone-info-card p {
    color: #e0e0e0;
    line-height: 1.6;
}

.zone-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.zone-list li {
    padding: 0.5rem 0;
    font-size: 1rem;
    font-weight: 500;
}

/* Zone Colors */
.zone-1 { color: #FF3B3B; }
.zone-2 { color: #00FF00; }
.zone-3 { color: #4169FF; }
.zone-4 { color: #FFA500; }
.zone-5 { color: #00FFFF; }
.zone-6 { color: #FF00FF; }

.fee-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Capacity Info */
.capacity-info {
    margin-top: 2rem;
}

.capacity-info h3 {
    color: #2d5016;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.capacity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.capacity-card {
    background: #2a2a2a;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 2px solid #3a3a3a;
}

.capacity-card h4 {
    color: #3d7a2e;
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.capacity-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    color: #e0e0e0;
}

.capacity-card li {
    padding: 0.35rem 0;
}

/* Footer Note */
.footer-note {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
    background: #2a2a2a;
    border-radius: 0.75rem;
    border: 1px solid #3a3a3a;
}

.footer-note p {
    color: #b0b0b0;
    font-size: 0.875rem;
    margin: 0;
}

/* Footer Link */
.footer-link {
    text-align: center;
    margin-top: 2rem;
}

.footer-link a {
    color: #3d7a2e;
    font-size: 1.125rem;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link a:hover {
    color: #2d5016;
}

/* Responsive */
@media (max-width: 768px) {
    .top-nav-links {
        display: none;
    }

    .card {
        padding: 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    .map-container {
        height: 300px;
    }

    .zone-info-grid,
    .fee-grid,
    .capacity-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 44px;
    }

    h1 {
        font-size: 1.75rem;
    }

    .map-container {
        height: 250px;
    }
}
