/* A Bite of Nutmeg - CT Shoreline Dining Guide */
/* Color Palette from Logo */
:root {
    --navy: #1e3a6e;
    --navy-dark: #152a52;
    --navy-light: #2a4a8a;
    --gold: #f0b323;
    --gold-dark: #d9a01f;
    --gold-light: #f5c94d;
    --white: #ffffff;
    --off-white: #f8f9fa;
    --gray-light: #e9ecef;
    --gray: #6c757d;
    --gray-dark: #343a40;
}

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

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--gray-dark);
    background-color: var(--off-white);
}

/* Header */
.header {
    background-color: var(--navy);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 60px;
    width: auto;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav a:hover {
    background-color: var(--navy-light);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--navy-light) 0%, var(--navy) 100%);
    background-image:
        radial-gradient(circle at 20% 50%, rgba(240, 179, 35, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(240, 179, 35, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 30%),
        linear-gradient(135deg, var(--navy-light) 0%, var(--navy) 100%);
    color: var(--white);
    padding: 3rem 2rem 5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23f0b323' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.hero-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    position: relative;
    z-index: 1;
}

.hero-text {
    text-align: left;
}

.hero-logo {
    height: 216px;
    width: auto;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Search */
.hero-search {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    width: 100%;
    max-width: 500px;
    animation: fadeInUp 1s ease-out 0.2s backwards;
}

.hero-search input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    transition: all 0.3s;
}

.hero-search input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.hero-search input:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.15);
}

.hero-search button {
    padding: 0.875rem 1.5rem;
    background: var(--gold);
    color: var(--navy-dark);
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.hero-search button:hover {
    background: var(--gold-light);
    transform: translateY(-2px);
}

/* CTA Button */
.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--gold);
    color: var(--navy-dark);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    margin-top: 0.5rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(240, 179, 35, 0.3);
    animation: fadeInUp 1s ease-out 0.4s backwards;
}

.cta-button:hover {
    background: var(--gold-light);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(240, 179, 35, 0.4);
}

/* Wave Divider */
.wave-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    transform: rotate(180deg);
}

.wave-divider svg {
    position: relative;
    display: block;
    width: 100%;
    height: 60px;
}

.wave-divider path {
    fill: var(--off-white);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--gold);
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* Town Page Hero */
.town-hero {
    padding: 2rem;
}

.town-hero h1 {
    font-size: 3rem;
}

.back-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--white);
    text-decoration: none;
    font-size: 1rem;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.back-link:hover {
    opacity: 1;
    color: var(--gold);
}

/* Towns Section */
.towns-section {
    padding: 2.5rem 2rem;
    background-color: var(--off-white);
    text-align: center;
}

.towns-section h2 {
    color: var(--navy);
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.town-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

.town-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(30, 58, 110, 0.3);
    border: 3px solid transparent;
}

.town-badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(30, 58, 110, 0.4);
    border-color: var(--gold);
    background: linear-gradient(135deg, var(--navy-light) 0%, var(--navy) 100%);
}

.town-badge .badge-name {
    color: var(--white);
}

.town-badge:hover .badge-name {
    color: var(--gold);
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Filters Section */
.filters {
    background-color: var(--white);
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}

.filters-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--gold);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-weight: 500;
    color: var(--navy);
}

.filter-group select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--white);
    cursor: pointer;
    transition: border-color 0.3s;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--gold);
}

/* Map Section */
.map-section {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

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

.map-section h2 {
    color: var(--navy);
    margin-bottom: 0;
    font-size: 1.75rem;
}

.map-toggle {
    display: none;
    padding: 0.5rem 1rem;
    background: var(--navy);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.map-toggle:hover {
    background: var(--navy-light);
}

#mapContainer {
    height: 550px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Restaurants Section */
.restaurants {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.restaurants h2 {
    color: var(--navy);
    margin-bottom: 0.5rem;
    font-size: 1.75rem;
}

.results-count {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.restaurant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Restaurant Card */
.restaurant-card {
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.restaurant-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-logo {
    background-color: var(--white);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 140px;
    border-bottom: 1px solid var(--gray-light);
}

.card-logo.dark-bg {
    background-color: var(--navy-dark);
}

.card-logo img {
    width: 80%;
    height: 100px;
    object-fit: contain;
}

.card-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: var(--white);
    padding: 1.25rem;
}

.card-header h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.card-header .cuisine {
    color: var(--gold);
    font-size: 0.9rem;
    font-weight: 500;
}

.card-body {
    padding: 1.25rem;
}

.card-body .town {
    display: inline-block;
    background-color: var(--gold);
    color: var(--navy-dark);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.card-body .address {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.card-body .phone {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.card-body .price {
    color: var(--gold-dark);
    font-weight: 700;
    font-size: 1.1rem;
}

.card-body .description {
    color: var(--gray-dark);
    font-size: 0.9rem;
    margin-top: 0.75rem;
    line-height: 1.5;
}

.card-footer {
    padding: 1rem 1.25rem;
    background-color: var(--off-white);
    border-top: 1px solid var(--gray-light);
}

.card-footer a {
    display: inline-block;
    background-color: var(--navy);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.card-footer a:hover {
    background-color: var(--navy-light);
}

/* About Section */
.about {
    background-color: var(--navy);
    color: var(--white);
    padding: 4rem 2rem;
    margin-top: 2rem;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about h2 {
    color: var(--gold);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.about p {
    font-size: 1.1rem;
    line-height: 1.8;
    opacity: 0.9;
}

/* Footer */
.footer {
    background-color: var(--navy-dark);
    color: var(--white);
    padding: 2rem;
    text-align: center;
}

.footer-logo {
    max-height: 80px;
    width: auto;
    margin-bottom: 1rem;
}

.footer p {
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Leaflet Map Customization */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    margin: 16px;
    min-width: 200px;
}

.map-popup h4 {
    color: var(--navy);
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.map-popup p {
    color: var(--gray);
    font-size: 1rem;
    margin: 0.35rem 0;
}

.map-popup .popup-cuisine {
    color: var(--gold-dark);
    font-weight: 500;
    font-size: 1rem;
}

.map-popup a {
    font-size: 1rem;
}

/* No Results Message */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}

.no-results h3 {
    color: var(--navy);
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        gap: 1rem;
    }

    .hero-content {
        flex-direction: column;
        gap: 1.5rem;
    }

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

    .hero-logo {
        height: 120px;
    }

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

    .hero p {
        font-size: 1rem;
    }

    .filters-content {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select {
        flex: 1;
    }

    .restaurant-grid {
        grid-template-columns: 1fr;
    }

    #mapContainer {
        height: 300px;
    }

    .map-toggle {
        display: block;
    }

    #mapContainer {
        display: none;
    }

    #mapContainer.show {
        display: block;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1rem;
    }

    .logo img {
        height: 45px;
    }

    .nav a {
        padding: 0.25rem 0.5rem;
        font-size: 0.9rem;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .towns-section {
        padding: 1.5rem 1rem;
    }

    .filters {
        padding: 1rem;
    }

    .map-section,
    .restaurants {
        padding: 1rem;
    }

    .footer {
        padding: 1.5rem 1rem;
    }
}

/* ==========================================
   Near Me Feature Styles
   ========================================== */

/* Near Me Button */
.near-me-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--navy-dark);
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(240, 179, 35, 0.4);
}

.near-me-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(240, 179, 35, 0.5);
}

.near-me-icon {
    font-size: 1.2rem;
}

/* Near Me Modal */
.near-me-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    overflow-y: auto;
    padding: 2rem 1rem;
}

.near-me-modal.show {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.near-me-modal-content {
    background: var(--white);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.near-me-modal-content h2 {
    color: var(--navy);
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.near-me-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--gray);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.near-me-close:hover {
    color: var(--navy);
}

/* Loading State */
.near-me-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem;
    color: var(--gray);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--gray-light);
    border-top-color: var(--navy);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.near-me-error {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
}

/* Results */
.near-me-results h3 {
    color: var(--navy);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gold);
}

.near-me-featured {
    margin-bottom: 2rem;
}

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

.near-me-section-header h3 {
    margin: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.near-me-section-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0 0.5rem;
    line-height: 1;
    transition: color 0.2s;
}

.near-me-section-close:hover {
    color: #1e3a6e;
}

/* Near Me Cards */
.near-me-card {
    background: var(--off-white);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.near-me-card.featured {
    display: flex;
    gap: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid var(--gold);
}

.near-me-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--white);
    padding: 0.5rem;
}

.near-me-img.dark-bg {
    background: var(--navy);
}

.near-me-info h4 {
    color: var(--navy);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.near-me-distance {
    display: inline-block;
    background: var(--gold);
    color: var(--navy-dark);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.near-me-cuisine {
    color: var(--gold-dark);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.near-me-town,
.near-me-address,
.near-me-phone {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.near-me-meta {
    color: var(--gray);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.near-me-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.near-me-link {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--navy);
    color: var(--white);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.near-me-link:hover {
    background: var(--navy-light);
}

.near-me-link.directions {
    background: var(--gold);
    color: var(--navy-dark);
}

.near-me-link.directions:hover {
    background: var(--gold-dark);
}

/* Near Me List */
.near-me-list {
    max-height: 400px;
    overflow-y: auto;
}

.near-me-card.small {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
}

.near-me-card.small .near-me-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.near-me-card.small h4 {
    font-size: 1rem;
    margin: 0;
    flex-basis: 100%;
}

.near-me-card.small .near-me-distance {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    margin: 0;
}

.near-me-card.small .near-me-phone {
    display: none;
}

.near-me-card.small .near-me-link {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

/* Mobile Adjustments for Near Me */
@media (max-width: 600px) {
    .near-me-modal {
        padding: 1rem 0.5rem;
    }

    .near-me-modal-content {
        padding: 1.5rem 1rem;
        border-radius: 12px;
    }

    .near-me-card.featured {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .near-me-img {
        width: 120px;
        height: 120px;
    }

    .near-me-actions {
        justify-content: center;
    }
}
