/* ====================================================
   1. RESET OG GRUNNSTIL
   ==================================================== */

body {
    font-family: Arial, sans-serif;
    background: #f6f6f6;
    margin: 0;
    padding: 0;
    color: #222;
}

a {
    color: #fbfbfb;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* ====================================================
   2. LAYOUT: HEADER, MAIN, FOOTER
   ==================================================== */

header, footer {
    background: #224488;
    color: #fff;
    padding: 1em;
    text-align: center;
}

main {
    background: #f6f6f6;
    color: #222;
    padding: 0.5em;
    max-width: 960px;
    margin: auto;
}

/* Footer ekstra styling */
footer {
    margin-top: 40px;
    padding: 10px 0;
    text-align: center;
}

/* ====================================================
   3. NAVIGASJON
   ==================================================== */

nav {
    background: #3c5fa5;
    color: #fff;
    padding: 1em;
    text-align: center;
}

/* Avstand under hovedmeny */
nav[aria-label="Hovedmeny"] {
    margin-bottom: 40px;
}

/* Menylisten for hovedmeny */
.main-menu {
    list-style: none;
    padding: 0;
    margin: 1rem auto;
    max-width: 600px;

    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Menyknapper */
.btn-menu {
    display: block;
    padding: 1rem;
    background-color: #E0F2FE;   /* Lys blå */
    color: #111827;              /* Mørk tekst */
    text-decoration: none;
    text-align: center;
    border-radius: 0.5rem;
    border: 2px solid transparent;
    font-weight: 600;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

/* Menyknapp hover/fokus */
.btn-menu:hover,
.btn-menu:focus-visible {
    background-color: #3B82F6;   /* Mellomblå */
    color: #FFFFFF;
    border-color: #1E3A8A;       /* Dyp blå */
    outline: none;
}
.btn-menu:active {
    transform: translateY(0);
}
/* Tastaturfokus fallback */
.btn-menu:focus {
    outline: 3px solid #1E3A8A;
    outline-offset: 2px;
}

/* Mobilvisning: én kolonne i menyen */
@media (max-width: 600px) {
    .main-menu {
        grid-template-columns: 1fr;
    }
}

/* ====================================================
   4. BRUKERSTATUS (LOGIN/LOGOUT)
   ==================================================== */

.user-status {
    text-align: right;
    font-size: 0.9em;
    color: #555;
    margin-bottom: 1rem;
}

.btn-user_status {
    color: darkslategrey;
    background: none;
    border: none;
    padding: 0.2em 0.6em;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

/* ====================================================
   5. KOMPONENTER: TABELLER OG SKJEMA
   ==================================================== */

/* Tabellstil */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.25em;
    background: #fff;
}
th, td {
    line-height: 2.5em;
    border: 1px solid #ccc;
    padding: 0.1em 0.35em 0.1em 1em;
}
th {
    background: #e8eaf6;
    position: sticky;  /* Fester tabelloverskriften ved scrolling */
    top: 0;
}

/* Hover-effekt på tabellrader */
table tr:hover {
    background-color: #f0f4ff;   /* Svak blågrå highlight */
    transition: background-color 0.15s ease-in-out;
}

/* Lenker i tabelloverskrifter skal være mørke */
th a {
    color: #222;              /* mørk tekst */
    text-decoration: none;
}

th a:hover {
    color: #000;              /* litt mørkere ved hover */
    text-decoration: underline;
}

/* Skjemastil */
form {
    background: #fff;
    padding: 1em;
    margin-bottom: 1em;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}
label {
    display: block;
    margin-top: 1em;
}
input, select, button {
    width: 100%;
    padding: 0.5em;
    margin-top: 0.2em;
    border: 1px solid #ccc;
    border-radius: 2px;
    font-size: 1em;
    box-sizing: border-box;
}
input[type="submit"], button {
    background: #224488;
    color: #fff;
    border: none;
    width: auto;
    margin-top: 1em;
}
input[type="submit"]:hover, button:hover {
    background: #163366;
}
button {
    margin-left: 0.2em;
    margin-right: 0.2em;
}

/* ====================================================
   6. KNAPPER OG VARIANTER
   ==================================================== */

.btn {
    padding: 6px 15px;
    background-color: #2d6cdf;
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 6px;
}
.btn-danger {
    background-color: #cc3300;
}
.btn-secondary {
    background-color: #666;
}

/* ====================================================
   7. RESPONSIV LAYOUT
   ==================================================== */

@media (max-width: 650px) {
    main, form {
        padding: 0.5em;
    }
    table, thead, tbody, tr, th, td {
        font-size: 1em;
    }
}