/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── Hero Section ───────────────────────────────────────────────────────── */
.hero {
    position: relative;
    width: 100%;
    min-height: 480px;
    background: #004080;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 5%;
    overflow: hidden;
}

.hero-card {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.hero-card-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 1.5rem;
}

.hero-card-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.hero-card-dots span:nth-child(1) { background: #ff5f56; }
.hero-card-dots span:nth-child(2) { background: #ffbd2e; }
.hero-card-dots span:nth-child(3) { background: #27c93f; }

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.15;
    margin-bottom: 0.75rem;
}

.hero-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: #555;
    margin-bottom: 2rem;
}

/* ── Hero Search Bar ────────────────────────────────────────────────────── */
.hero-search {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.hero-search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f0f2f5;
    border: 2px solid #dde1e6;
    border-radius: 50px;
    padding: 0 0.75rem;
    transition: border-color 0.2s;
}

.hero-search-input-wrap:focus-within {
    border-color: #004080;
}

.hero-search-icon {
    color: #999;
    font-size: 0.95rem;
    margin-right: 0.5rem;
}

.hero-search-input-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.85rem 0;
    font-size: 0.95rem;
    outline: none;
    color: #333;
}

.hero-search-input-wrap input::placeholder {
    color: #aaa;
}

.hero-location-btn {
    background: none;
    border: none;
    color: #004080;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
}

.hero-location-btn:hover {
    color: #003366;
}

.hero-search-btn {
    background: #004080;
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.hero-search-btn:hover {
    background: #003366;
}

/* Emergency Banner */
.emergency-banner {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin: 2rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.emergency-banner i {
    font-size: 2rem;
    color: #ffd700;
}

.emergency-text strong {
    font-size: 1.2rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* Sections */
.location-section, .jurisdiction-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    color: #004080;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, #004080 0%, #0056b3 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #003366 0%, #004080 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 64, 128, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-2px);
}

/* Search */
.search-container {
    margin: 1.5rem 0;
}

.search-box {
    display: flex;
    gap: 0.5rem;
    max-width: 500px;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #004080;
    box-shadow: 0 0 0 3px rgba(0, 64, 128, 0.1);
}

/* Location Display */
.location-display {
    background: linear-gradient(135deg, #e8f4fd 0%, #d6eaff 100%);
    border: 1px solid #004080;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.location-info h3 {
    color: #004080;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.location-info p {
    color: #666;
    margin-bottom: 0.5rem;
}

.coordinates {
    font-size: 0.9rem;
    color: #888;
    font-family: 'Courier New', monospace;
}

/* Jurisdiction Results */
.jurisdiction-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.jurisdiction-card:hover {
    border-color: #004080;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.jurisdiction-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.75rem;
}

.jurisdiction-icon {
    background: linear-gradient(135deg, #004080 0%, #0056b3 100%);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.jurisdiction-info h3 {
    color: #004080;
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
}

.jurisdiction-type {
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-info {
    display: grid;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.contact-item i {
    color: #004080;
    width: 20px;
    text-align: center;
}

.contact-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #004080;
}

/* Error Display */
.error-display {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.error-display i {
    font-size: 1.5rem;
    color: #dc3545;
}

/* Footer */
.app-footer {
    background: #343a40;
    color: #adb5bd;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-ad {
    max-width: 728px;
    margin: 0 auto 1.5rem;
}

.app-footer p {
    margin: 0.25rem 0;
}

/* Utility Classes */
.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

.text-success {
    color: #28a745;
}

.text-warning {
    color: #ffc107;
}

.text-danger {
    color: #dc3545;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        min-height: auto;
        padding: 2rem 4%;
    }

    .hero-card {
        max-width: 100%;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: none;
    }

    .contact-actions {
        flex-direction: column;
    }

    .btn {
        justify-content: center;
    }

    .jurisdiction-header {
        flex-direction: column;
        text-align: center;
    }

    .emergency-banner {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 1.5rem 4%;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .hero-card {
        padding: 1.5rem;
    }

    .container {
        padding: 0 15px;
    }

    .location-section, .jurisdiction-section {
        padding: 1.5rem;
    }

    .btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* ── Badges ─────────────────────────────────────────────────────────────── */

.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.badge-primary {
    background: #004080;
    color: white;
}

.badge-secondary {
    background: #6c757d;
    color: white;
}

.badge-default {
    background: #ffc107;
    color: #333;
}

/* ── Jurisdiction Context Bar ───────────────────────────────────────────── */

.jurisdiction-context {
    background: #e8f4fd;
    border: 1px solid #b3d7f2;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: #004080;
}

.jurisdiction-context i {
    color: #004080;
}

/* ── Action Buttons ─────────────────────────────────────────────────────── */

.btn-call {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-call:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-website {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

.btn-website:hover {
    background: linear-gradient(135deg, #0069d9 0%, #004080 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-report {
    background: linear-gradient(135deg, #fd7e14 0%, #e65100 100%);
    color: white;
}

.btn-report:hover {
    background: linear-gradient(135deg, #e65100 0%, #bf360c 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(253, 126, 20, 0.3);
}

/* ── No Contact State ───────────────────────────────────────────────────── */

.no-contact {
    text-align: center;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #dee2e6;
}

.no-contact i {
    font-size: 2rem;
    color: #adb5bd;
    margin-bottom: 0.75rem;
}

.no-contact p {
    color: #666;
    margin-bottom: 1rem;
}

/* ── No Results State ───────────────────────────────────────────────────── */

.no-results {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.no-results i {
    font-size: 3rem;
    color: #adb5bd;
    margin-bottom: 1rem;
}

/* ── Default Icon ───────────────────────────────────────────────────────── */

.jurisdiction-icon.default-icon {
    background: linear-gradient(135deg, #ffc107 0%, #e6a700 100%);
    color: #333;
}

/* ── Footer Link ────────────────────────────────────────────────────────── */

.footer-link {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: white;
}

.footer-link i {
    margin-right: 0.25rem;
}

/* ── Text Utilities ─────────────────────────────────────────────────────── */

.text-muted {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* ── Texas Map Beacon ───────────────────────────────────────────────────── */

.map-section {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.map-section h2 {
    color: #004080;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tx-map {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    line-height: 0;
}

.tx-svg-map {
    display: block;
    width: 100%;
    height: auto;
}

/* State outline */
.tx-outline {
    fill: rgba(200, 210, 230, 0.14);
    stroke: #ffffff;
    stroke-width: 2.4;
    stroke-linejoin: round;
}

/* Decorative "network" overlay, matching the original wallpaper's theme */
.tx-network-line {
    stroke: rgba(180, 220, 255, 0.35);
    stroke-width: 1;
}

.tx-network-dot {
    fill: #bfeaff;
}

.tx-network-glow {
    fill: url(#tx-node-glow);
}

/* All five map icons (City Police, Sheriff, State Patrol, ISD Police,
   patrol car) are photo badges now -- no hand-drawn icon styling needed */
.tx-photo-badge {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

/* Beacon marker (positioned via exact lat/lng projection in app.js, not CSS) */
.tx-beacon {
    fill: #dc3545;
    stroke: white;
    stroke-width: 2;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

.tx-beacon-glow {
    fill: rgba(220, 53, 69, 0.35);
    transform-box: fill-box;
    transform-origin: center;
    animation: tx-beacon-pulse 1.8s ease-out infinite;
}

@keyframes tx-beacon-pulse {
    0% {
        transform: scale(0.3);
        opacity: 1;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

@media (max-width: 480px) {
    .map-section {
        padding: 1.5rem;
    }
}

/* ── Search Hint (for fallback contact info) ────────────────────────────── */

.search-hint {
    color: #6c757d;
    font-style: italic;
    font-size: 0.9rem;
}

/* ── Modal (Suggest a Correction) ────────────────────────────────────────── */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    color: #004080;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #004080;
    box-shadow: 0 0 0 3px rgba(0, 64, 128, 0.1);
}

.form-group textarea {
    resize: vertical;
}

.btn-link {
    background: none;
    border: none;
    color: #004080;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    margin-top: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-link:hover {
    color: #003366;
}

.correction-context {
    margin-bottom: 1rem;
    color: #495057;
}

.correction-status {
    min-height: 1.4rem;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.correction-status.success {
    color: #198754;
}

.correction-status.error {
    color: #dc3545;
}