/*
Copyright © 2026 Sandhill Software LLC. All rights reserved.
Author: Sean Joyce <sjoyce@watershedguard.com>
*/

:root {
    --primary: #0f172a;       /* slate-900 */
    --primary-light: #1e293b;  /* slate-800 */
    --accent: #2563eb;        /* blue-600 */
    --accent-hover: #1d4ed8;  /* blue-700 */
    --danger: #dc2626;        /* red-600 */
    --danger-bg: #fef2f2;     /* red-50 */
    --text-main: #334155;     /* slate-700 */
    --text-body: #475569;     /* slate-600 */
    --text-light: #64748b;    /* slate-500 */
    --bg-page: #f1f5f9;       /* slate-100 */
    --bg-card: #ffffff;
    --border: #e2e8f0;        /* slate-200 */
    --radius-lg: 16px;
    --radius-md: 10px;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin: 0;
    padding: 2rem 1rem;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 780px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 4rem 2.5rem 3.5rem;
    text-align: center;
    position: relative;
}

.header h1 {
    margin: 0 0 0.75rem 0;
    font-size: 2.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 400;
    color: #94a3b8; /* slate-400 */
}

.badge {
    display: inline-block;
    background-color: rgba(245, 158, 11, 0.15); /* amber tint */
    color: #fbbf24; /* amber-400 */
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(251, 191, 36, 0.3);
    backdrop-filter: blur(4px);
}

.content {
    padding: 3rem 3.5rem;
}

.content > p {
    font-size: 1.125rem;
    margin-top: 0;
    margin-bottom: 1.75rem;
    color: var(--text-main);
    max-width: 680px; /* Constrains line length for better reading */
}

.content > p:last-of-type {
    margin-bottom: 0;
}

.highlight {
    color: var(--danger);
    font-weight: 600;
    background-color: var(--danger-bg);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    white-space: nowrap;
}

.sectors {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}

.sector-tag {
    background: #f1f5f9; /* slate-100 */
    color: #475569; /* slate-600 */
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border);
}

.features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2.5rem 0 3.5rem;
}

.feature-block {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

.feature-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #eff6ff; /* blue-50 */
    color: var(--accent);
    border-radius: 10px;
}

.feature-icon svg {
    width: 22px;
    height: 22px;
}

.feature-block h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary);
}

.feature-block p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-body);
    line-height: 1.5;
}

.cta-box {
    background-color: #eff6ff; /* soft blue-50 */
    padding: 3.5rem 2rem;
    text-align: center;
    border-top: 1px solid #dbeafe; /* blue-100 */
}

.cta-box h3 {
    color: var(--primary);
    font-size: 1.5rem;
    margin: 0 0 0.75rem 0;
    letter-spacing: -0.025em;
}

.cta-box p {
    font-size: 1.05rem;
    color: var(--text-body);
    margin: 0 0 2rem 0;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent);
    color: white;
    text-decoration: none;
    padding: 1.15rem 2.75rem;
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.25), 0 4px 6px -2px rgba(37, 99, 235, 0.1);
}

.btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 18px -3px rgba(37, 99, 235, 0.3), 0 6px 8px -2px rgba(37, 99, 235, 0.15);
}

@media (min-width: 600px) {
    .features {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .content { padding: 2rem 1.5rem; }
    .cta-box { padding: 3rem 1.5rem; }
    .header h1 { font-size: 2.25rem; }
    .header { padding: 3rem 1.5rem 2.5rem; }
    .features { margin: 2rem 0; }
}


/* Weather Widget Styles */
.weather-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    width: 280px;
    padding: 1.25rem;
    z-index: 1000;
    color: var(--primary);
    /* Inherits font-family from body */
}

.weather-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bg-page);
}

.weather-header .material-symbols-outlined {
    color: var(--accent);
    font-size: 28px;
}

.weather-desc {
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: capitalize;
}

.weather-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.weather-temp {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    color: var(--primary);
}

.weather-temp span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
    vertical-align: top;
    margin-left: 2px;
}

.weather-metric {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-page);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

/* Highlights the rain metric when precipitation > 0 */
.weather-metric.alert {
    background: #eff6ff; /* blue-50 */
    color: var(--accent-hover);
    border: 1px solid #bfdbfe; /* blue-200 */
}

.weather-metric .material-symbols-outlined {
    font-size: 18px;
    color: var(--accent);
}

.weather-footer {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: right;
}

/* Optional loading skeleton animation for initial connect */
.skeleton {
    background: var(--border);
    border-radius: 4px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

@media (max-width: 600px) {
    .content { padding: 2rem 1.5rem; }
    .cta-box { padding: 3rem 1.5rem; }
    .header h1 { font-size: 2.25rem; }
    .header { padding: 3rem 1.5rem 2.5rem; }
    .features { margin: 2rem 0; }

    /* Add padding to the bottom of the page so the button is never covered */
    body {
        padding: 1rem 1rem 100px 1rem; /* Increased slightly to account for footer */
    }

    /* Transform the boxy widget into a full-width bottom app bar */
    .weather-widget {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 20px 20px 0 0;
        border-top: 1px solid var(--border);
        border-left: none;
        border-right: none;
        border-bottom: none;
        padding: 0.75rem 1.25rem 0.5rem; /* Adjusted bottom padding */
        display: flex;
        flex-wrap: wrap; /* Allows the footer to drop to the next line */
        align-items: center;
        justify-content: space-between;
        box-shadow: 0 -4px 15px -3px rgba(0, 0, 0, 0.08);
        background: var(--bg-card); /* Ensures it remains opaque */
    }

    .weather-header {
        margin: 0;
        padding: 0;
        border: none;
    }

    .weather-header .material-symbols-outlined {
        font-size: 24px;
    }

    .weather-desc {
        font-size: 1rem;
    }

    .weather-body {
        margin: 0;
        gap: 12px;
        justify-content: flex-end;
        align-items: center; /* Forces the temp and rain pill to center vertically */
    }

    .weather-temp {
        font-size: 1.15rem; /* Sized to perfectly match the header text */
        display: flex;
        align-items: center;
    }

    .weather-temp span {
        font-size: 1rem;
        vertical-align: baseline; /* Overrides the desktop 'top' alignment */
        margin-left: 2px;
    }

    /* Restyle the footer to span the full width and center subtly at the bottom */
    .weather-footer {
        width: 100%;
        text-align: center;
        margin-top: 6px;
        font-size: 0.65rem;
        color: var(--text-light);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        border-top: 1px solid var(--border);
    }
}
