/*layout.css*/
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    color: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(180deg, var(--bg-red) 0%, var(--bg-red-2) 100%);
    overflow-x: hidden;
}

/* ==================== Alerts ==================== */
.alert {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    animation: slideIn 0.3s ease-out;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    background-color: rgba(40, 167, 69, 0.15);
    color: var(--alert-green);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.alert-success strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--alert-green-dark);
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--alert-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-error strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--alert-red-dark);
}

.alert-error ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.25rem;
}

.alert-error li {
    margin: 0.25rem 0;
}

.info-message {
    padding: 12px 16px;
    background: rgba(11, 92, 255, 0.08);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-sm);
    color: var(--muted-white);
    font-size: 0.95rem;
}

.info-message p {
    margin: 0;
}

.info-message strong {
    color: var(--white);
}

/* Resource page specific container adjustment */
.resource-page.container {
    padding-top: 1rem;
    padding-bottom: 2rem;
}

/* App root and main */
.app-root {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

main,
.main-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 0 40px;
}

/* Container */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

.site-footer {
    margin-top: auto;
    padding: 12px 0;
    background: var(--background-black);
    color: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--border-subtle);
    width: 100%;
    box-sizing: border-box;
}

.site-footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.site-footer p {
    margin: 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.95);
}

:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

@media (forced-colors: active) {
    :root {
        color-scheme: light dark;
    }

    html,
    body {
        background: Window;
        color: WindowText;
    }

    :focus-visible {
        outline: 2px solid Highlight;
        outline-offset: 2px;
    }
}