/* Modern, luftig design med nordisk minimalisme og bærekraftige verdier */
:root {
    --primary: #2d4a3e;       /* Mørkegrønn - bærekraft og ro */
    --secondary: #f8f9fa;     /* Lys, nesten hvit bakgrunn for luftighet */
    --accent: #6c9a8b;        /* Myk grønn - balanse og økonomi */
    --light-gray: #e9ecef;    /* Lys grå for bordere */
    --dark-gray: #343a40;     /* Mørk grå for tekst */
    --font-main: 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
    --transition: all 0.3s ease;
    --border-radius: 14px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --max-width: 1000px;
    --spacing-unit: 2rem;    /* Økt luft mellom elementer */
}

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

body {
    font-family: var(--font-main);
    background-color: var(--secondary);
    color: var(--dark-gray);
    line-height: 1.7;
    overflow-x: hidden;
    padding-top: 20px;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Star rating widget */
.star-rating {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
.star {
    font-size: 1.6rem;
    color: #ccc;
    cursor: pointer;
    user-select: none;
    transition: color 0.12s ease;
}
.star.selected {
    color: #f1c40f;
}
.star:hover {
    transform: scale(1.05);
}

/* Header - luftig og enkel */
header {
    padding: var(--spacing-unit) 0;
    text-align: center;
    background-color: transparent;
}

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

header p {
    font-size: 1.1rem;
    color: var(--dark-gray);
    opacity: 0.8;
}

/* Navigation - diskret */
nav {
    background-color: transparent;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

nav a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 400;
    margin: 0 15px;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

nav a:hover {
    border-bottom: 2px solid var(--accent);
}

/* Main content - luftig og åpen */
main {
    padding: var(--spacing-unit) 0;
    min-height: 70vh;
}

/* Card design - myk og innbydende */
.card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2.5rem;
    margin-bottom: var(--spacing-unit);
    border: 1px solid var(--light-gray);
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* Buttons - myke og balanserte */
.btn {
    display: inline-block;
    background-color: var(--accent);
    color: white;
    padding: 10px 18px;
    min-width: 130px;
    min-height: 44px;
    line-height: 1.2;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 400;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
    margin-top: 1rem;
}

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

/* Danger / destructive button */
.btn-danger {
    background-color: #e74c3c;
}

.btn-danger:hover {
    background-color: #c73b2b;
}

/* Small variant for secondary actions (e.g. logout) */
.btn-sm {
    min-width: 90px;
    min-height: 36px;
    padding: 6px 12px;
    font-size: 0.95rem;
}

/* Form elements - luftige og enkle */
form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-unit);
}

label {
    font-weight: 400;
    color: var(--primary);
    font-size: 1rem;
    display: block;
    margin-bottom: 0.5rem;
}

input, select {
    padding: 14px 18px;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-family: var(--font-main);
    transition: var(--transition);
    background-color: #fefefe;
    font-size: 1rem;
    width: 100%;
    max-width: 400px;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 154, 139, 0.15);
}

/* List styling - oversiktlig og luftig */
ul {
    list-style: none;
    padding: 0;
    margin-top: 1.5rem;
}

li {
    padding: 1.2rem;
    background-color: #fefefe;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent);
    transition: var(--transition);
}

li:hover {
    background-color: rgba(108, 154, 139, 0.05);
}

/* Footer - enkel og diskret */
footer {
    background-color: transparent;
    padding: var(--spacing-unit) 0;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.03);
    margin-top: 2rem;
}

footer p {
    color: var(--primary);
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .card {
        padding: 1.5rem;
    }

    nav a {
        display: block;
        margin: 10px 0;
    }
}

/* ===== Rating-seksjon ===== */
.ratings-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.rating-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
}

.rating-item h3 {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 500;
    margin: 0;
}

.rating-item p {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--dark-gray);
    margin: 0;
}

/* Prisinfo (spesifikk stil for budsjett) */
.prisinfo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: rgba(108, 154, 139, 0.05);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent);
    width: 100%;
    margin-bottom: 1rem;
}

.prisinfo h3 {
    font-size: 1.1rem;
    color: var(--primary);
    font-weight: 500;
}

.prisinfo p {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark-gray);
}

/* Helserating */
.health-rating {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.health-emoji {
    font-size: 2rem;
}

/* Bærekraftsrating (trafikklys) */
/* Bærekraftsrating (trafikklys) */
.traffic-light {
    display: flex;
    gap: 8px;
    align-items: center;
}

.traffic-light div {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid var(--light-gray);
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

.traffic-light .red:not(.active) {
    background-color: #f0f0f0; /* Lys grå */
}

.traffic-light .yellow:not(.active) {
    background-color: #f0f0f0; /* Lys grå */
}

.traffic-light .green:not(.active) {
    background-color: #f0f0f0; /* Lys grå */
}

.traffic-light .red.active {
    background-color: #e74c3c; /* Rød */
}

.traffic-light .yellow.active {
    background-color: #f1c40f; /* Gul */
}

.traffic-light .green.active {
    background-color: #2ecc71; /* Grønn */
}

/* Dropdown for navbar 'Valg' */
.dropdown { position: relative; display: inline-block; }
.dropdown .dropdown-toggle { background: none; border: none; cursor: pointer; color: var(--primary); padding: 6px 10px; font-size: 1rem; }
.dropdown .dropdown-menu { display: none; position: absolute; right: 0; top: 100%; background: white; border: 1px solid #e6e9eb; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,0.08); list-style: none; padding: 8px 0; margin: 6px 0; min-width: 200px; z-index: 50; }
.dropdown .dropdown-menu li a { display: block; padding: 8px 16px; color: var(--dark-gray); text-decoration: none; }
.dropdown .dropdown-menu li a:hover { background: #f3f6f5; color: var(--primary); }
.dropdown.open .dropdown-menu { display: block; }


/* ===== Recipe list toolbar (moved from template) ===== */
.filters.toolbar {
    display: grid;
    grid-template-columns: 1fr repeat(3, minmax(120px,160px)) auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    padding: 8px;
    border-radius: 6px;
    background: #f7f8f9;
    border: 1px solid #e6e9eb;
    box-shadow: inset 0 -1px 0 #e6e9eb;
}
.filters.toolbar .field {
    display:flex;
    flex-direction:column;
    gap:4px;
    font-size:12px;
    color:#333;
}
.filters.toolbar .field label {
    text-transform:uppercase;
    font-size:11px;
    color:#6b7280;
    letter-spacing:0.02em;
}
.filters.toolbar .field .control {
    height:36px;
    padding:6px 10px;
    border:1px solid #d1d5db;
    border-radius:4px;
    background:white;
    box-shadow:none;
}
.filters.toolbar .field .control:focus {
    outline:2px solid #c7e0d6;
    border-color:#9ccbb3;
}
.filters.toolbar .search { width:100%; }
.filters.toolbar .divider { width:1px; height:32px; background:#e1e5e8; margin:0 6px; justify-self:center; }
.filters.toolbar .spacer { grid-column: 5; justify-self:end; display:flex; gap:8px; align-items:center; }

/* Icons inside labels */
.filters.toolbar .label-icon { margin-right:6px; }

/* Mobile: stack controls vertically */
@media (max-width: 700px) {
    .filters.toolbar { grid-template-columns: 1fr; grid-auto-rows: auto; }
    .filters.toolbar .search { width:100%; }
    .filters.toolbar .divider { display:none; }
    .filters.toolbar .spacer { grid-column: auto; justify-self:start; width:100%; display:flex; justify-content:flex-end; }
    .filters.toolbar .field { width:100%; }
}

/* Toolbar-specific button overrides to make buttons smaller and center text */
.filters.toolbar .toolbar-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:86px;
    height:34px;
    padding:6px 10px;
    font-size:0.95rem;
    border-radius:8px;
}
.filters.toolbar .toolbar-btn.btn{ background-color: var(--accent); color:#fff; border:none; }
.filters.toolbar .toolbar-btn{ text-align:center; }


