/* ==========================================================================
   ifolketinget.dk - Shared Styles
   ========================================================================== */

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

/* Color variables - Light mode (default) */
:root {
    --color-for: #2e7d32;
    --color-for-light: #e8f5e9;
    --color-imod: #c62828;
    --color-imod-light: #ffebee;
    --color-neutral: #757575;
    --color-neutral-light: #f5f5f5;
    --color-primary: #1565c0;
    --color-primary-light: #e3f2fd;
    --color-bg: #f5f5f5;
    --color-card: #ffffff;
    --color-text: #1a1a1a;
    --color-text-muted: #5a5a5a;
    --color-border: #d0d0d0;
    --border-radius: 8px;
    --max-width: 600px;
}

/* Dark mode */
[data-theme="dark"] {
    --color-for: #4caf50;
    --color-for-light: #1b3d1c;
    --color-imod: #ef5350;
    --color-imod-light: #3d1b1b;
    --color-neutral: #9e9e9e;
    --color-neutral-light: #2a2a2a;
    --color-primary: #42a5f5;
    --color-primary-light: #1a2d3d;
    --color-bg: #121212;
    --color-card: #1e1e1e;
    --color-text: #e0e0e0;
    --color-text-muted: #9e9e9e;
    --color-border: #333333;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
        sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Header
   ========================================================================== */

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

header h1 a {
    color: inherit;
    text-decoration: none;
}

.subtitle {
    color: var(--color-text-muted);
    font-size: 1rem;
}

/* ==========================================================================
   Progress bar
   ========================================================================== */

.progress {
    background: var(--color-border);
    border-radius: 4px;
    height: 8px;
    margin: 1rem 0 0.5rem;
    overflow: hidden;
}

.progress-bar,
.progress-fill {
    background: var(--color-primary);
    height: 100%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* ==========================================================================
   Theme toggle
   ========================================================================== */

.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition:
        transform 0.2s,
        box-shadow 0.2s;
    z-index: 100;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: none;
}

/* Show sun in dark mode, moon in light mode */
[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

:root:not([data-theme="dark"]) .theme-toggle .icon-moon,
[data-theme="light"] .theme-toggle .icon-moon {
    display: block;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.card {
    background: var(--color-card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card p {
    margin-bottom: 1rem;
}

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

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition:
        transform 0.1s,
        box-shadow 0.1s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

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

.btn-for {
    background-color: var(--color-for);
    color: white;
}

.btn-imod {
    background-color: var(--color-imod);
    color: white;
}

.btn-neutral {
    background-color: var(--color-neutral-light);
    color: var(--color-text);
    border: 2px solid var(--color-border);
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-large {
    padding: 1.25rem 3rem;
    font-size: 1.25rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin-top: auto;
}

footer a {
    color: var(--color-primary);
}

.reset-link {
    color: var(--color-text-muted);
    text-decoration: none;
}

.reset-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Expandable sections
   ========================================================================== */

details.expandable {
    background: var(--color-neutral-light);
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    border: 1px solid var(--color-border);
}

details.expandable summary {
    padding: 0.75rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--color-primary);
    font-weight: 500;
    user-select: none;
}

details.expandable summary:hover {
    background: var(--color-border);
}

details.expandable[open] summary {
    border-bottom: 1px solid var(--color-border);
}

details.expandable .content {
    padding: 1rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--color-text);
}

/* ==========================================================================
   Navigation (site-wide)
   ========================================================================== */

.site-nav {
    background: var(--color-card);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.site-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.site-nav a {
    color: var(--color-text);
    font-weight: 500;
}

.site-nav a:hover {
    color: var(--color-primary);
}

.site-nav a.active {
    color: var(--color-primary);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (min-width: 480px) {
    .btn-row {
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }

    .btn-row .btn {
        flex: 1;
        max-width: 150px;
    }
}
