:root {
    --bg-color: #0b0d17;
    --text-color: #e0e6ed;
    --accent-color: #00ffcc;
    --secondary-color: #7d4f9c;
    --card-bg: #161b22;
    --nav-bg: rgba(11, 13, 23, 0.95);
    --font-main: 'Inter', sans-serif;
    --success-color: #2ea043;
    --error-color: #da3633;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navigation */
.navbar {
    background-color: var(--nav-bg);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    display: inline-flex;
    min-height: 44px;
    text-decoration: none;
    letter-spacing: 1px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-link {
    align-items: center;
    color: var(--text-color);
    display: inline-flex;
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* Mobile Navigation */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero {
        height: 35vh;
        min-height: 300px;
    }

    .card {
        padding: 1.5rem;
    }
}

/* Hero Section */
.hero {
    position: relative;
    height: 40vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background: linear-gradient(rgba(11, 13, 23, 0.4), rgba(11, 13, 23, 0.8)), url('../images/IMG_20260113_165008.webp') no-repeat center center/cover;
}

.photo-credit {
    position: absolute;
    bottom: 10px;
    right: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    font-style: italic;
    z-index: 2;
}

.hero-content {
    max-width: 800px;
    padding: 2rem;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    background: linear-gradient(90deg, #fff, #00ffcc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: #cbd5e1;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.section-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

/* Subscription Management Styles */
.subscription-card {
    background-color: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.subscription-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-header {
    padding: 1.25rem;
    background-color: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 1.1rem;
}

.card-body {
    padding: 1.5rem;
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.button-group .btn {
    flex: 1;
    text-align: center;
}

.btn-danger {
    background-color: transparent;
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.btn-danger:hover {
    background-color: rgba(218, 54, 51, 0.1);
    transform: translateY(-2px);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #a0aec0;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="time"],
select {
    width: 100%;
    padding: 0.75rem;
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    min-height: 44px;
    transition: all 0.3s;
}

.btn:hover {
    background-color: #6a4285;
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(90deg, #7d4f9c, #5b3675);
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
}

.btn-danger {
    background-color: var(--error-color);
}

.page-heading {
    align-items: flex-start;
    display: flex;
    gap: 1.5rem;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.compact-heading {
    margin-bottom: 1rem;
}

.privacy-line,
.eyebrow,
.empty-state {
    color: #a0aec0;
}

.eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0;
    margin: 0 0 0.25rem;
    text-transform: uppercase;
}

.subscription-list {
    display: grid;
    gap: 1.5rem;
}

.manage-subscription-card {
    border-color: rgba(255, 255, 255, 0.14);
}

.manage-card-header {
    gap: 1rem;
}

.subscription-meta {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0 0 1.25rem;
}

.subscription-meta div {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 0.85rem;
}

.subscription-meta dt {
    color: #8b949e;
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
}

.subscription-meta dd {
    color: var(--text-color);
    font-weight: 600;
    margin: 0;
    overflow-wrap: anywhere;
}

.status-badge,
.state-pill {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
    padding: 0.4rem 0.65rem;
}

.status-active,
.state-success {
    background: rgba(46, 160, 67, 0.18);
    color: #7ee787;
}

.status-paused,
.state-warning {
    background: rgba(210, 153, 34, 0.18);
    color: #f2cc60;
}

.state-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.edit-panel {
    border: 1px solid #30363d;
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 1rem;
}

.edit-panel summary {
    color: var(--accent-color);
    cursor: pointer;
    font-weight: 700;
}

.stacked-form {
    margin-top: 1rem;
}

.manage-actions form,
.data-actions form,
.unsubscribe-actions form {
    flex: 1;
}

.manage-actions .btn,
.data-actions .btn,
.unsubscribe-actions .btn,
.recovery-card .btn,
.add-place-card .btn {
    width: 100%;
}

.add-place-card,
.global-controls {
    margin-top: 2rem;
}

.data-actions,
.unsubscribe-actions {
    display: flex;
    gap: 1rem;
}

.global-controls {
    border-top: 1px solid #30363d;
    display: grid;
    gap: 1rem;
    padding-top: 1.5rem;
    text-align: center;
}

.text-danger-button {
    background: none;
    border: 1px solid transparent;
    color: var(--error-color);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    min-height: 44px;
    padding: 0.75rem 1rem;
    text-decoration: underline;
}

.back-link {
    margin-top: 2rem;
    text-align: center;
}

.back-link a {
    color: var(--accent-color);
    text-decoration: none;
}

.unsubscribe-list {
    display: grid;
    gap: 1rem;
}

.unsubscribe-item {
    align-items: center;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.65fr);
    padding: 1rem;
}

.unsubscribe-item h4,
.unsubscribe-item p {
    margin: 0 0 0.35rem;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.mode-option {
    flex: 1;
    padding: 1rem;
    background: #0d1117;
    border: 2px solid #30363d;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-option.selected {
    border-color: var(--accent-color);
    background: rgba(0, 255, 204, 0.05);
}

.mode-label {
    font-weight: bold;
    color: var(--text-color);
    cursor: pointer;
}

.mode-description {
    font-size: 0.85rem;
    color: #8b949e;
    margin-top: 0.25rem;
}

.mode-section {
    display: none;
}

.mode-section.active {
    display: block;
}

.inline-group {
    display: flex;
    gap: 1rem;
}

.inline-group>* {
    flex: 1;
}

.help-text {
    color: #8b949e;
    font-size: 0.9rem;
}

.expert-disclosure {
    border: 1px solid #30363d;
    border-radius: 8px;
    margin: 1rem 0 1.5rem;
    overflow: hidden;
}

.expert-disclosure summary {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-color);
    cursor: pointer;
    font-weight: 700;
    min-height: 44px;
    padding: 0.875rem 1rem;
}

.expert-disclosure summary:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.expert-disclosure-body {
    padding: 1rem;
}

.info-disclosure .disclosure-body {
    display: none;
}

.info-disclosure:hover .disclosure-body,
.info-disclosure:focus-within .disclosure-body,
.info-disclosure.is-open .disclosure-body {
    display: block;
}

.disclosure-trigger {
    width: 100%;
    background: transparent;
    border: 0;
    border-bottom: 2px solid var(--secondary-color);
    color: var(--text-color);
    cursor: pointer;
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0;
    min-height: 44px;
    padding: 0 0 0.5rem;
    text-align: left;
}

.info-disclosure:hover .disclosure-trigger,
.info-disclosure:focus-within .disclosure-trigger {
    color: var(--accent-color);
}

/* Footer */
footer {
    background-color: var(--card-bg);
    padding: 2rem;
    text-align: center;
    margin-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    align-items: center;
    color: #8b949e;
    display: inline-flex;
    margin: 0 10px;
    min-height: 44px;
    min-width: 44px;
    justify-content: center;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--accent-color);
}

/* Utilities */
.hidden {
    display: none;
}

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

.text-center>a:not(.btn) {
    align-items: center;
    display: inline-flex;
    min-height: 44px;
}

.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: rgba(218, 54, 51, 0.2);
    border: 1px solid var(--error-color);
}

.alert-success {
    background-color: rgba(46, 160, 67, 0.2);
    border: 1px solid var(--success-color);
}

/* Trust, latest conditions, and alert detail pages */
.trust-page,
.alert-detail-page {
    padding-top: 2rem;
}

.trust-page p,
.alert-detail-page p {
    color: #cbd5e1;
}

.lede {
    font-size: 1.1rem;
    max-width: 760px;
}

.latest-layout {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.latest-status {
    border-color: rgba(255, 255, 255, 0.12);
}

.latest-status-fresh {
    border-color: rgba(46, 160, 67, 0.55);
}

.latest-status-stale {
    border-color: rgba(245, 158, 11, 0.65);
}

.latest-status-unknown {
    border-color: rgba(139, 148, 158, 0.65);
}

.status-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.status-pill {
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
    padding: 0.35rem 0.75rem;
}

.status-fresh {
    background: rgba(46, 160, 67, 0.18);
    color: #7ee787;
}

.status-stale {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
}

.status-unknown {
    background: rgba(139, 148, 158, 0.2);
    color: #d0d7de;
}

.source-mode {
    color: #8b949e;
    font-size: 0.9rem;
}

.condition-facts {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 1.5rem 0;
}

.condition-facts-vertical {
    grid-template-columns: 1fr;
}

.condition-facts div {
    background: rgba(13, 17, 23, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 1rem;
}

.condition-facts dt {
    color: #8b949e;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.condition-facts dd {
    color: var(--text-color);
    font-weight: 700;
    margin: 0;
    overflow-wrap: anywhere;
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.centered-cta {
    justify-content: center;
}

.cta-row .btn {
    min-width: 180px;
    text-align: center;
}

.forecast-map {
    margin: 0;
}

.forecast-map img {
    aspect-ratio: 16 / 10;
    background: #0d1117;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    display: block;
    object-fit: cover;
    width: 100%;
}

.forecast-map figcaption {
    color: #8b949e;
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

.compact-list,
.source-link-list {
    margin-bottom: 0;
    padding-left: 1.25rem;
}

.compact-list li,
.source-link-list li {
    margin-bottom: 0.85rem;
}

.source-link-list a {
    color: var(--accent-color);
    font-weight: 700;
    text-decoration: none;
}

.source-link-list a:hover {
    text-decoration: underline;
}

.source-link-list p {
    margin: 0.25rem 0 0;
}

.signup-success {
    background: rgba(46, 160, 67, 0.12);
    border: 1px solid var(--success-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
}

.signup-success h3 {
    color: var(--accent-color);
    margin-top: 0;
}

.signup-success dl {
    display: grid;
    gap: 0.9rem;
    margin: 0;
}

.signup-success dt {
    color: #8b949e;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}

.signup-success dd {
    margin: 0.15rem 0 0;
    overflow-wrap: anywhere;
}

/* Alert Level Radio Group */
.alert-level-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.alert-level-option {
    flex: 1;
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.alert-level-option:hover {
    border-color: var(--secondary-color);
}

.alert-level-option.selected {
    border-color: var(--accent-color);
    background: rgba(0, 255, 204, 0.05);
}

.alert-level-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.alert-level-label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.alert-level-value {
    font-size: 0.9rem;
    color: #8b949e;
    line-height: 1.4;
}

.alert-level-value strong {
    color: var(--accent-color);
    display: block;
    margin-bottom: 0.25rem;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .alert-level-group {
        flex-direction: column;
    }

    .condition-facts {
        grid-template-columns: 1fr;
    }

    .cta-row .btn {
        width: 100%;
    }
}

/* Input Spinner replacement for 'Checking weather...' */
.loading-spinner::after {
    content: " ⏳";
    animation: spin 1s linear infinite;
}

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

/* Grid for Resources */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .page-heading,
    .data-actions,
    .unsubscribe-actions {
        flex-direction: column;
    }

    .subscription-meta,
    .unsubscribe-item {
        grid-template-columns: 1fr;
    }

    .page-heading .btn {
        width: 100%;
        text-align: center;
    }

    .navbar {
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    .nav-links {
        gap: 0.75rem;
        font-size: 0.95rem;
    }

    .hero {
        height: 26vh;
        min-height: 220px;
    }

    .hero-content {
        padding: 1.25rem;
    }

    .photo-credit {
        display: none;
    }

    .container {
        padding: 1rem;
    }

    .card {
        margin-bottom: 1.25rem;
        padding: 1.25rem;
    }

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

    .latest-layout {
        grid-template-columns: 1fr;
    }

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

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

    .section-title {
        font-size: 1.75rem;
    }

    .mode-selector {
        flex-direction: column;
    }

    .inline-group {
        flex-direction: column;
    }

    .disclosure-trigger {
        font-size: 1.75rem;
    }
}
