:root {
    --primary-dark: #002933;
    --primary-medium: #033B4D;
    --accent-light: #DFCDB2;
    --neutral-gray: #888C6C; /* Corrected potential typo from #888C6 */
    --neutral-light: #F8F7F5;
    --text-light: #F8F7F5;
    --text-dark: #002933;
    --cta-button-bg: #DFCDB2;
    --cta-button-text: #002933;
    --input-bg: #033B4D;
    --input-text: #F8F7F5;
    --input-placeholder: #888C6C;
    --card-bg: #033B4D;
    --border-radius: 8px;
    --font-family: 'Roboto', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--primary-dark);
    color: var(--text-light);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

[x-cloak] {
    display: none !important;
}

.container {
    width: 100%;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.page {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    width: 100%;
    overflow-y: auto; /* Allow individual page content to scroll */
}

/* Landing Page Styles */
.landing-page {
    background-color: var(--primary-dark);
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-bottom: 80px; /* Space for bottom nav */
}

.landing-header h1 {
    font-size: 1.2rem;
    color: var(--accent-light);
    margin-bottom: 10px;
    font-weight: 500;
}

.landing-header h2 {
    font-size: 2rem;
    color: var(--text-light);
    margin-bottom: 15px;
    font-weight: 700;
}

.landing-header p {
    font-size: 0.9rem;
    color: var(--text-light);
    max-width: 400px;
    margin: 0 auto 30px auto;
    line-height: 1.5;
}

.input-group {
    margin-bottom: 25px;
    width: 100%;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 8px;
    text-align: left;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--input-bg);
    border-radius: var(--border-radius);
    padding: 0 15px;
}

.input-with-icon i {
    color: var(--input-placeholder);
    font-size: 1.1rem;
    margin-right: 10px;
}

.input-group input[type="text"] {
    width: 100%;
    padding: 15px 10px 15px 0; /* Adjusted padding for icon */
    background-color: transparent;
    border: none;
    color: var(--input-text);
    font-size: 1rem;
    outline: none;
}

.input-group input[type="text"]::placeholder {
    color: var(--input-placeholder);
    opacity: 0.8;
}

.cta-button {
    background-color: var(--cta-button-bg);
    color: var(--cta-button-text);
    border: none;
    padding: 15px 30px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    max-width: 380px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.cta-button:hover {
    background-color: #c8b8a0; /* Slightly darker accent */
}

/* Loading Screen Styles */
.loading-page {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: var(--primary-medium);
}

.loading-content h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--text-light);
}

.loading-content p {
    font-size: 0.9rem;
    color: var(--accent-light);
    margin-bottom: 20px;
}

.spinner {
    border: 6px solid var(--input-bg); /* Lighter border */
    border-top: 6px solid var(--accent-light); /* Accent color for spinner */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

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

.progress-bar-container {
    width: 80%;
    max-width: 300px;
    background-color: var(--input-bg);
    border-radius: var(--border-radius);
    margin: 20px auto;
    height: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--accent-light);
    width: 0%; /* Controlled by Alpine.js */
    transition: width 0.2s ease-out;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--accent-light);
    opacity: 0.8;
}

/* Results Page Styles */
.results-page {
    background-color: var(--primary-dark);
    padding-bottom: 80px; /* Space for bottom nav */
}

.results-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 5px; /* Align with general page padding better */
}

.results-header h1 {
    font-size: 1.3rem;
    color: var(--text-light);
    font-weight: 500;
    margin: 0 auto;
    text-align: center; /* Center title */
}

.back-button {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.results-zip-input {
    background-color: var(--input-bg);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    padding: 0 15px;
    margin-bottom: 20px;
}

.results-zip-input i {
    color: var(--input-placeholder);
    font-size: 1.1rem;
    margin-right: 10px;
}

.results-zip-input input[type="text"] {
    flex-grow: 1;
    padding: 15px 10px 15px 0;
    background-color: transparent;
    border: none;
    color: var(--input-text);
    font-size: 1rem;
    outline: none;
}

.results-zip-input input[type="text"]::placeholder {
    color: var(--input-placeholder);
}

.map-placeholder {
    width: 100%;
    height: 250px; /* Adjust as needed */
    background-color: var(--primary-medium);
    border-radius: var(--border-radius);
    position: relative; /* For positioning default text */
    margin-bottom: 25px;
    overflow: hidden;
}

.map-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-default-text {
    color: var(--input-placeholder);
    font-style: italic;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.patient-info h2 {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 5px;
    padding-left: 5px;
}

.patient-info p {
    font-size: 0.85rem;
    color: var(--text-light);
    opacity: 0.9;
    margin-bottom: 20px;
    line-height: 1.4;
    padding-left: 5px;
}

.info-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-card span {
    font-size: 0.9rem;
    color: var(--text-light);
}

.info-card strong {
    font-size: 1.3rem;
    color: var(--accent-light);
    font-weight: bold;
}

/* Bottom Navigation Styles */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--primary-medium);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid #0a4f63; /* Slightly lighter border */
    z-index: 1000;
}

.bottom-nav button {
    background: none;
    border: none;
    color: var(--neutral-gray);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.3s ease;
}

.bottom-nav button i {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.bottom-nav button.active {
    color: var(--accent-light);
}

.bottom-nav button:hover {
    color: var(--text-light);
}

/* Desktop Styles (and larger tablets) */
@media (min-width: 768px) {
    /* body {
        align-items: center; /* REMOVE - container will be full width */
    /* } */

    .container {
        /* max-width: 450px; REMOVE */
        /* box-shadow: 0 0 20px rgba(0,0,0,0.3); REMOVE */
        /* border-radius: 10px; REMOVE */
        /* overflow: hidden; REMOVE */
        /* position: relative; REMOVE if not needed for other reasons */
        margin: 0; /* Was 20px auto, now full width */
        /* height: calc(100vh - 40px); REMOVE */
        /* max-height: 800px; REMOVE */
    }

    .page {
        padding-top: 30px; /* Adjust desktop padding as needed */
        padding-left: 30px;
        padding-right: 30px;
        padding-bottom: 30px; /* Default bottom padding for pages */
        align-items: center; /* Center direct children (content blocks) */
    }

    .landing-page,
    .results-page {
        padding-bottom: 80px; /* Ensure sufficient padding for the fixed bottom nav */
    }
    
    .landing-header, .landing-main,
    .results-header, .results-main, 
    .patient-info { /* Apply to all main content blocks */
        max-width: 800px; /* Or your preferred max-width for content readability */
        width: 100%; /* Ensures it uses up to max-width */
        /* Centered by .page's align-items: center */
    }
    
    /* Ensure .results-header internal layout remains correct */
    .results-header {
        /* display: flex; and align-items: center; are from base styles */
        /* The h1 has margin: 0 auto; which should still work to center it 
           relative to the back-button within the 800px max-width block. */
    }

    .input-group {
        /* Already has max-width: 380px globally, which is fine.
           It will be centered as part of its parent (.landing-main, .results-main)
           which is now centered and has a max-width. */
    }

    .map-placeholder {
        height: 350px; /* Slightly larger map for desktop */
    }

    /* The padding-bottom on .landing-page and .results-page for the nav
       should still work correctly with .page having overflow-y: auto. */
} 

/* Error Message Styling */
.error-message {
    color: #ff6b6b; /* A reddish color for errors */
    background-color: rgba(255, 107, 107, 0.1); /* Slight reddish background */
    border: 1px solid rgba(255, 107, 107, 0.3);
    padding: 10px;
    border-radius: var(--border-radius);
    margin-top: 15px;
    font-size: 0.9rem;
    text-align: center;
    width: 100%; /* Ensure it takes up available width in its container */
    max-width: 380px; /* Match input field width for consistency on landing */
    margin-left: auto;
    margin-right: auto;
}

/* Specific override for results page error if needed for wider layout */
.results-main .error-message {
    max-width: 100%; /* Allow it to be wider on results page if content block is wider */
} 