/* California Polling Place Finder - Styles */

:root {
    --ca-blue: #0c4a6e;
    --ca-blue-dark: #082f49;
    --ca-blue-light: #0284c7;
    --ca-gold: #f59e0b;
    --ca-gold-dark: #d97706;
    --ca-gold-light: #fef3c7;
    --ca-green: #059669;
    --ca-text-dark: #1e293b;
    --ca-text-muted: #64748b;
    --ca-bg-light: #f8fafc;
    --ca-card-border: #e2e8f0;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    -webkit-font-smoothing: antialiased;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ca-text-dark);
    background-color: var(--ca-bg-light);
    margin-bottom: 120px;
}

/* Header & Hero */
.header-top {
    background: #ffffff;
    border-bottom: 1px solid var(--ca-card-border);
    padding: 14px 0;
}

.header-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

#main-logo {
    max-height: 52px;
    width: auto;
    object-fit: contain;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ca-blue);
    background: #e0f2fe;
    padding: 6px 14px;
    border-radius: 9999px;
}

.lang-switch-btn {
    background: transparent;
    border: 1px solid var(--ca-card-border);
    color: var(--ca-text-dark);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none !important;
}

.lang-switch-btn:hover {
    background: #f1f5f9;
    color: var(--ca-blue);
}

.lang-switch-btn.active {
    background: var(--ca-blue);
    color: #ffffff;
    border-color: var(--ca-blue);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, rgba(8, 47, 73, 0.94) 0%, rgba(12, 74, 110, 0.9) 100%), url('../img/ca-background.jpg');
    background-size: cover;
    background-position: center 35%;
    color: #ffffff;
    padding: 50px 0 40px 0;
    text-align: center;
    position: relative;
    box-shadow: inset 0 -10px 20px -10px rgba(0, 0, 0, 0.3);
}

.hero-subtitle-tag {
    display: inline-block;
    color: var(--ca-gold);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.hero-title {
    font-weight: 800;
    font-size: 2.75rem;
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.hero-lead {
    font-weight: 300;
    font-size: 1.25rem;
    max-width: 760px;
    margin: 0 auto;
    color: #e2e8f0;
    line-height: 1.5;
}

/* Search Box Container */
.search-card-wrapper {
    margin-top: -30px;
    position: relative;
    z-index: 10;
    margin-bottom: 40px;
}

.search-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12), 0 1px 3px rgba(15, 23, 42, 0.06);
    padding: 28px 32px;
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.search-card-label {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ca-text-dark);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: stretch;
}

.input-address-wrap {
    flex: 1 1 340px;
    position: relative;
}

.input-address-wrap .form-control {
    height: 52px;
    font-size: 1.05rem;
    padding-left: 16px;
    padding-right: 16px;
    border-radius: 10px;
    border: 2px solid #cbd5e1;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-address-wrap .form-control:focus {
    border-color: var(--ca-blue-light);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
    outline: none;
}

.input-type-wrap {
    flex: 0 0 230px;
}

.input-type-wrap .form-control {
    height: 52px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 10px;
    border: 2px solid #cbd5e1;
    background-color: #f8fafc;
    color: var(--ca-text-dark);
}

.input-btn-wrap {
    flex: 0 0 auto;
}

.btn-search {
    height: 52px;
    min-width: 140px;
    padding: 0 24px;
    background-color: var(--ca-gold-dark);
    background-image: linear-gradient(to bottom right, var(--ca-gold), var(--ca-gold-dark));
    border: none;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn-search:hover {
    background-color: #b45309;
    box-shadow: 0 6px 18px rgba(217, 119, 6, 0.4);
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-search:active {
    transform: translateY(0);
}

.btn-search.active {
    cursor: wait;
    opacity: 0.9;
}

/* Spinner */
.spinner-icon {
    display: none;
    animation: rotate 1s linear infinite;
}

.btn-search.active .spinner-icon {
    display: inline-block;
}

.btn-search.active .btn-text-content .oi-magnifying-glass {
    display: none;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

.search-helper-text {
    font-size: 0.88rem;
    color: var(--ca-text-muted);
    margin-top: 10px;
    margin-bottom: 0;
}

/* Results Section */
#results-container {
    margin-bottom: 40px;
}

.result-banner {
    border-radius: 14px;
    padding: 22px 26px;
    margin-bottom: 24px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.result-banner.success-banner {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.result-banner.error-banner {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.result-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.badge-votecenter {
    background: #dbeafe;
    color: #1e40af;
}

.badge-dropoff {
    background: #fef3c7;
    color: #92400e;
}

.badge-polling {
    background: #d1fae5;
    color: #065f46;
}

.result-title {
    font-weight: 700;
    font-size: 1.45rem;
    margin-bottom: 6px;
    color: #0f172a;
}

.result-address {
    font-size: 1.15rem;
    margin-bottom: 12px;
    color: #334155;
    font-weight: 500;
}

.result-meta {
    font-size: 0.92rem;
    color: #475569;
    margin-bottom: 8px;
}

.directions-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-weight: 600;
    color: var(--ca-blue-light);
    text-decoration: none;
}

.directions-link:hover {
    color: var(--ca-blue);
    text-decoration: underline;
}

/* Map Card */
.map-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
    border: 1px solid var(--ca-card-border);
    margin-bottom: 24px;
}

#map {
    height: 480px;
    width: 100%;
    background-color: #f1f5f9;
}

@media (min-width: 992px) {
    .map-card {
        position: sticky;
        top: 20px;
    }
}

/* Scrollable Container for Other Locations */
.other-locations-scroll-wrap {
    max-height: 480px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.other-locations-scroll-wrap::-webkit-scrollbar {
    width: 6px;
}

.other-locations-scroll-wrap::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}

.location-item-card {
    background: #ffffff;
    border: 1px solid var(--ca-card-border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: all 0.15s ease;
    cursor: pointer;
}

.location-item-card:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    transform: translateX(2px);
}

.location-item-card.active-location {
    border-color: var(--ca-blue-light);
    background-color: #f0f9ff;
}

.location-card-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--ca-text-dark);
    margin-bottom: 2px;
}

.location-card-addr {
    font-size: 0.88rem;
    color: #475569;
    margin-bottom: 2px;
}

/* State Resources List */
.state-resources-list {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.resource-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--ca-blue);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.15s ease;
}

.resource-btn:hover {
    background: #f8fafc;
    border-color: var(--ca-blue-light);
    color: var(--ca-blue-dark);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Informational Cards */
.info-section {
    padding: 20px 0 40px 0;
}

.section-heading {
    text-align: center;
    margin-bottom: 30px;
}

.section-heading h2 {
    font-weight: 800;
    font-size: 2rem;
    color: var(--ca-blue-dark);
    margin-bottom: 8px;
}

.section-heading p {
    font-size: 1.05rem;
    color: var(--ca-text-muted);
}

.info-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 24px;
    height: 100%;
    border: 1px solid var(--ca-card-border);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.info-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 16px;
}

.icon-blue {
    background: #e0f2fe;
    color: var(--ca-blue);
}

.icon-gold {
    background: #fef3c7;
    color: var(--ca-gold-dark);
}

.icon-green {
    background: #d1fae5;
    color: var(--ca-green);
}

.icon-purple {
    background: #f3e8ff;
    color: #7e22ce;
}

.info-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ca-text-dark);
    margin-bottom: 10px;
}

.info-card p {
    font-size: 0.95rem;
    color: var(--ca-text-muted);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Callout Banner */
.callout-box {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 16px;
    padding: 32px;
    color: #ffffff;
    margin: 30px 0 20px 0;
    text-align: center;
}

.callout-box h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.callout-box p {
    font-size: 1.05rem;
    color: #cbd5e1;
    max-width: 720px;
    margin: 0 auto 20px auto;
}

.callout-box .btn-callout {
    background: var(--ca-gold);
    color: #0f172a;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    transition: background 0.15s ease;
}

.callout-box .btn-callout:hover {
    background: #fbbf24;
    color: #000;
}

/* Footer */
.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    background-color: #0f172a;
    color: #94a3b8;
    padding: 24px 0;
    border-top: 1px solid #1e293b;
}

.footer a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 18px;
    font-size: 0.88rem;
    flex-wrap: wrap;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-lead {
        font-size: 1.05rem;
    }

    .search-card {
        padding: 20px 18px;
    }

    .input-type-wrap {
        flex: 1 1 100%;
    }

    .btn-search {
        width: 100%;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
        justify-content: center;
    }

    .footer-links {
        justify-content: center;
    }
}