/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4f46e5;
    /* Indigo 600 */
    --primary-hover: #4338ca;
    /* Indigo 700 */
    --text-dark: #1e293b;
    /* Slate 800 */
    --text-light: #64748b;
    /* Slate 500 */
    --bg-light: #f8fafc;
    /* Slate 50 */
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: 1px solid rgba(255, 255, 255, 0.2);
    --transition: all 0.3s ease;
}

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

html {
    height: 100%;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    /* allow scrolling now */
    overflow-x: hidden;
    height: auto;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    /* Ensure body takes at least full viewport height */
}

/* Header */
header {
    height: 8vh;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    position: relative;
}

.brand-logo {
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.02em;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

/* Main Content Area */
main {
    flex: 1;
    position: relative;
    /* Remove fixed height to allow scrolling */
    width: 100%;
    margin-top: 0;
    /* No margin-top needed here, header is part of flow */
    z-index: 1;
}

/* Map Hero Section (Wrapper for Map + Sidebar) */
.map-hero-section {
    position: relative;
    width: 100%;
    height: 92vh;
    /* Force full height for the app part */
    overflow: hidden;
    /* Prevent sidebar from spilling out if needed */
}

/* Map Container */
#mapContainer {
    width: 100%;
    height: 100%;
    /* Fill the wrapper */
    background-color: #e2e8f0;
    /* Placeholder color before map loads */
    z-index: 0;
}

/* Sidebar */
/* Sidebar */
/* .sidebar definition moved to end of file */

/* Travel Modes */
.travel-modes {
    display: flex;
    background: #f1f5f9;
    padding: 0.25rem;
    border-radius: var(--radius-md);
    gap: 0.25rem;
    margin-bottom: 1.25rem;
}

.mode-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.6rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    border-radius: calc(var(--radius-md) - 2px);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.mode-btn.active {
    background: var(--white);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.mode-btn:hover:not(.active) {
    color: var(--text-dark);
}

/* Inputs */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.1rem;
}

.location-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    /* Space for icon */
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-dark);
    transition: var(--transition);
    background: var(--white);
}

.location-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Action Button */
.get-directions-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), #4338ca);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.get-directions-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
}

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

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 0 1rem;
    }

    .nav-menu {
        display: none;
        /* simple mobile hide for now, or use hamburger */
    }

    .sidebar {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        border-radius: 1.5rem 1.5rem 0 0;
        padding: 1.5rem;
    }

    main {
        height: calc(100vh - 70px);
    }
}

/* ... existing styles ... */

/* SEO Content Area */
.seo-content {
    margin-top: 0.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.seo-content h1 {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.seo-content p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.seo-content p:last-child {
    margin-bottom: 0;
}

.seo-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Update Sidebar to handle scrolling if content is long */
/* Old sidebar block removed */
/* ... previous styles ... */

/* Update Sidebar for Toggling */
.sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 380px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* Removed padding from container to let inner scroll freely */
    padding: 0;
    border-radius: 0;
    /* Squared edges as requested */
    box-shadow: var(--shadow-lg);
    border-right: var(--glass-border);
    border-top: none;
    border-bottom: none;
    border-left: none;
    z-index: 10;
    display: flex;
    flex-direction: column;
    max-height: none;
    overflow: visible;
    /* Important for the button to hang out */
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-inner {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    flex: 1;
    /* Take remaining space */
    min-height: 0;
    /* Prevent overflow issues */
    scrollbar-width: thin;
    scrollbar-color: var(--text-light) transparent;
}

/* ... scrollbar styles ... */

/* Sidebar Footer */
.sidebar-footer {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    flex-shrink: 0;
    border-top: none;
}

.sidebar-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.75rem;
    justify-content: center;
}

.sidebar-footer nav a {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    line-height: 1.8;
    transition: var(--transition);
}

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

.sidebar-inner::-webkit-scrollbar {
    width: 6px;
}

.sidebar-inner::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-inner::-webkit-scrollbar-thumb {
    background-color: rgba(100, 116, 139, 0.2);
    border-radius: 20px;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: absolute;
    top: 60px;
    /* Align with apparent visual top or specific need */
    right: -24px;
    /* Hanging outside */
    transform: none;
    width: 24px;
    height: 48px;
    /* Tall thin pill shape */
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-left: none;
    border-radius: 0 8px 8px 0;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 4px 0 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.sidebar-toggle i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

/* Rotate icon when collapsed */
.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-toggle {
    /* Optional: verify if shadow needs adjustment when collapsed */
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}


/* SEO Content Section */
.seo-article-section {
    background: #ffffff;
    padding: 4rem 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.seo-article-section .container {
    max-width: 900px;
    margin: 0 auto;
}

.seo-article-section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.seo-article-section h2:first-child {
    margin-top: 0;
}

.seo-article-section h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.seo-article-section p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.seo-article-section ul,
.seo-article-section ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.seo-article-section li {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.seo-article-section strong {
    color: var(--primary-color);
    font-weight: 600;
}

.faq-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Related States Section */
.related-states-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.related-state-btn {
    display: block;
    width: 100%;
    padding: 0.875rem 1rem;
    background-color: #f3f4f6;
    color: var(--text-dark);
    text-decoration: none;
    text-align: center;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    box-sizing: border-box;
}

.related-state-btn:hover {
    background-color: #e5e7eb;
    transform: translateY(-1px);
    border-color: #d1d5db;
    color: var(--primary-color);
}

/* Mobile Menu Toggle */
.nav-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        /* Hidden by default */
        position: fixed;
        top: 8vh;
        left: 0;
        width: 100%;
        height: 92vh;
        background: var(--white);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        box-shadow: none;
        z-index: 2000;
        border-top: 1px solid #eee;
    }

    .nav-menu.active {
        display: flex;
        /* Visible when active */
    }
}