/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Default the layout to dark */
:root {
    --background: #F2E6D8;
    --foreground: #09090b;
    --primary: #044536;
    --primary-foreground: #F2E6D8;
    --danger: #DE5D52;
    --warning: #DBC451;
    --success: #09AD76;
}

/* OS Preference */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #F8F4ED;
        --foreground: #ffffff
    }
}

/* Data theme overrides that are set with app setting */
[data-theme="dark"] {
    --background: #111111;
    --foreground: #ffffff
}

[data-theme="light"] {
    --background: #F2E6D8;
    --foreground: #09090b;
    --primary: #044536;
    --primary-foreground: #F2E6D8;
    --danger: #DE5D52;
    --warning: #DBC451;
    --success: #09AD76;
}

main {
    padding: 3rem;
    max-width: 70rem;
    margin: 0 auto;
}

.alert,
.error {
    color: var(--danger);
}
.notice {
    color: var(--warning);
}

/* Links */
a {
    color: var(--foreground);
    text-decoration: none;
}

a[aria-current],
.navbar a[aria-current] {
    text-decoration: underline;
}

/* Header */
.header-background {
    background-color: var(--primary);
    padding: 1.5rem;
    position: relative;
}
.header {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 70rem;
    margin: 0 auto;
    color: var(--primary-foreground);
}
.logo {
    display: flex;
}
.logo-text {
    padding: 1rem;
    font-weight: 600;
    font-size: 1.5rem;
    text-decoration: none;
    color: currentColor;
}
#logo-graphic {
    width: 2rem;
}

/* Header - Navbar */
nav.navbar {
    display: flex;
    gap: 1rem;
    padding: 1rem;
}
nav.navbar a {
    text-decoration: none;
    color: currentColor;
}
.navbar-menu {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 1.25rem;
}
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}
.navbar .logout-button {
    background-color: var(--primary-foreground);
    border: 2px solid var(--foreground);
    box-shadow: var(--foreground) 4px 4px 0 0;
    color: var(--foreground);
    cursor: pointer;
    font-weight: 600;
    font-size: 1.25rem;
    padding: 0 18px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;

    &:hover {
        background-color: #fff;
    }
    &:active {
        box-shadow: var(--foreground) 2px 2px 0 0;
        transform: translate(2px, 2px);
    }
}

@media (min-width: 768px) {
    .button-74 {
        min-width: 120px;
        padding: 0 25px;
    }
}

/* Mobile Nav */
@media (max-width: 768px) {
    .navbar-toggle {
        display: block;
        color: var(--background)
    }
    .navbar-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary);
        padding: 1rem;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    .navbar-menu.is-open {
        display: flex;
        text-align: center;
    }
    .navbar .desktop-nav {
        display:none;
    }
}


/* Footer */
footer {
    max-width: 70rem;
    margin: 0 auto;
    padding: 2rem;

    &::before {
        content: "";
        display: block;
        width: 1.5rem;
        height: 2px;
        background: var(--foreground);
        margin-bottom: 1.5rem;
    }
    a {
        text-decoration: none;
    }
    li {
        list-style: none;
        margin-bottom: 0.5rem;
    }
    ul {
        padding: 0;
    }
}


/* Body */
body {
    margin: 0;
    background: var(--background);
    font-family: Arial, Helvetica, sans-serif;
}

section.settings {
    display: flex;
    gap: 1rem;

    nav {
        width: 200px;

        a {
            display: block;
        }
    }
}

/* Theme Toggle */
:root:not([data-theme="dark"]) .icon-light {
    opacity: 0;
    transform: rotate(90deg);
    pointer-events: none;
}
[data-theme="dark"] .icon-dark {
    opacity: 0;
    transform: rotate(-90deg);
    pointer-events: none;
}
#theme-toggle {
    position: relative;
    width: 30px;
    height: 30px;

    svg {
        transition: opacity 0.2s ease, transform 0.2s ease;
        position: absolute;
        top: 0;
        left: 0;
    }
}
/* Fade + rotate out the hidden icon */
.icon-light,
.icon-dark {
    transition: opacity 0.2s ease, transform 0.2s ease;
}


/* Forms */
.block-form{
    display: flex;
    flex-direction: column;
    margin: auto;

    .input-group{
        margin-bottom: 10px;
    }

    .input-group > * {
        display: block;
    }

    input {
        width: 100%;
    }
}
