/* ============================================================
   TJ Systems - style.css
   ============================================================ */

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

/* ── Generelt ──────────────────────────────────────────────── */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
    color: #333;
}

/* ── Login-side (override body for login) ──────────────────── */
body.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo h1 {
    color: #667eea;
    font-size: 32px;
    margin-bottom: 5px;
}

.logo p {
    color: #666;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid #c33;
}

.language-switcher {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.language-switcher a {
    color: #667eea;
    text-decoration: none;
    margin: 0 10px;
    font-weight: 500;
}

.language-switcher a.active {
    color: #764ba2;
    font-weight: 700;
}

/* ── Navbar ────────────────────────────────────────────────── */
.top-nav {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    height: 60px;
    gap: 1rem;
}

/* Logo + brukernavn */
.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.logo-area .logo {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-align: left;
    margin: 0;
}

.nav-username {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    padding-left: 0.75rem;
}

/* Nav-meny */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    margin: 0 auto;
}

.nav-menu a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 0.5rem 0.85rem;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    display: block;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Høyre side */
.nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Språkvelger */
.lang-dropdown {
    position: relative;
}

.lang-current {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.4rem 0.75rem;
    border-radius: 5px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.lang-current:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lang-arrow {
    font-size: 0.7rem;
    opacity: 0.8;
}

.lang-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 140px;
    overflow: hidden;
    z-index: 100;
}

.lang-menu.open {
    display: block;
}

.lang-option {
    display: block;
    padding: 0.6rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.15s;
}

.lang-option:hover {
    background: #f0f2f5;
}

.lang-option.active {
    color: #667eea;
    font-weight: 600;
    background: #f5f3ff;
}

/* Logg ut */
.btn-logout {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.4rem 0.85rem;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    margin-left: auto;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Hovedinnhold ───────────────────────────────────────────── */
.main-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.main-content h1,
.main-content .page-title {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* ── Mobil ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        flex-direction: column;
        padding: 0.5rem 1rem 1rem;
        gap: 0.25rem;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu a {
        padding: 0.6rem 0.85rem;
    }

    .nav-container {
        flex-wrap: wrap;
        position: relative;
    }

    .nav-right {
        order: 3;
        margin-left: auto;
    }

    .nav-username {
        display: none;
    }
}

@media (max-width: 480px) {
    .lang-current {
        padding: 0.4rem 0.5rem;
    }
}