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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    height: 100vh;
    overflow: hidden;
    background: #1a1a2e;
}

#app {
    height: 100vh;
    width: 100vw;
    position: relative;
}

#map {
    height: 100%;
    width: 100%;
    background: #2d3748;
}

/* Toolbar */
#toolbar {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1000;
    display: flex;
    gap: 6px;
}

.toolbar-btn {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #475569;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.toolbar-btn:hover {
    background: #334155;
    border-color: #60a5fa;
}

/* State Counter */
#state-counter {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1000;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 6px;
    padding: 8px 14px;
    color: #e2e8f0;
    font-size: 0.85rem;
    font-weight: 500;
}

#visited-count, #dc-visited {
    color: #10b981;
    font-weight: 700;
}

#dc-counter {
    margin-top: 4px;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Hover Tooltip */
#hover-tooltip {
    position: absolute;
    z-index: 1500;
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 12px 16px;
    color: #f1f5f9;
    font-size: 0.8rem;
    max-width: 240px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

#hover-tooltip.hidden {
    display: none;
}

#hover-tooltip .tooltip-title {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: #94a3b8;
}

#hover-tooltip .tooltip-item {
    padding: 2px 0;
    color: #e2e8f0;
}

#hover-tooltip .tooltip-item.visited {
    color: #6ee7b7;
}

/* Leaflet overrides for dark map style */
.leaflet-container {
    background: #2d3748;
}

/* State styling */
.state-default {
    fill: #4a5568;
    stroke: #718096;
    stroke-width: 1;
}

/* State Labels */
.state-label {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.state-label span {
    color: #cbd5e1;
    font-size: 10px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.state-label-full span {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
}

/* Overlay Panel */
.overlay {
    position: absolute;
    top: 0;
    right: 0;
    width: 380px;
    height: 100%;
    background: #1e293b;
    border-left: 1px solid #334155;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.overlay.hidden {
    transform: translateX(100%);
}

.overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #334155;
    background: #0f172a;
}

.overlay-header h2 {
    color: #f1f5f9;
    font-size: 1.25rem;
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-close:hover {
    background: #334155;
    color: #f1f5f9;
}

#overlay-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.overlay-footer {
    padding: 16px 24px;
    border-top: 1px solid #334155;
    background: #0f172a;
}

.btn-add {
    width: 100%;
    padding: 12px;
    font-size: 0.9rem;
}

.empty-msg {
    color: #64748b;
    text-align: center;
    padding: 40px 20px;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Location Cards */
.location-card {
    background: #334155;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #475569;
    transition: all 0.2s;
}

.location-card:hover {
    border-color: #60a5fa;
}

.location-card.visited {
    border-left: 3px solid #10b981;
}

.location-card .loc-name {
    color: #f1f5f9;
    font-weight: 500;
    font-size: 1rem;
    margin-bottom: 6px;
}

.location-card .loc-date {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.location-card .loc-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.location-card .loc-actions button {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-visit {
    background: #065f46;
    color: #6ee7b7;
}

.btn-visit:hover {
    background: #047857;
}

.btn-unvisit {
    background: #1e3a5f;
    color: #93c5fd;
}

.btn-unvisit:hover {
    background: #1e40af;
}

.btn-delete {
    background: #7f1d1d;
    color: #fca5a5;
}

.btn-delete:hover {
    background: #991b1b;
}


/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-backdrop.hidden {
    display: none;
}

.modal {
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 12px;
    padding: 28px 32px;
    width: 400px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal h3 {
    color: #f1f5f9;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.modal label {
    display: block;
    color: #94a3b8;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    margin-top: 14px;
}

.modal label:first-of-type {
    margin-top: 0;
}

.modal input[type="text"],
.modal input[type="date"] {
    width: 100%;
    padding: 10px 14px;
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #f1f5f9;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.modal input[type="text"]:focus,
.modal input[type="date"]:focus {
    border-color: #60a5fa;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #e2e8f0 !important;
    font-size: 0.9rem !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    margin-top: 16px !important;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #10b981;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #334155;
    color: #e2e8f0;
}

.btn-secondary:hover {
    background: #475569;
}

/* State indicators */
.state-indicator {
    pointer-events: none;
}

/* Leaflet popup overrides */
.leaflet-popup-content-wrapper {
    background: #1e293b;
    color: #f1f5f9;
    border-radius: 8px;
    border: 1px solid #475569;
}

.leaflet-popup-tip {
    background: #1e293b;
}
