/* ===========================
   CSS VARIABLER
=========================== */
:root {
    --primary-start: #7a1ae8;
    --primary-end: #0d47a1;
    --mobile-nav: #041c3f;
    --heading-color: #1c4274;
    --text-color: #aa9a9a;
    --border-color: #0d47a1;
    --bg-light: #f9fafb;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
}

/* ===========================
   RESET & BASE
=========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* ===========================
   NAVBAR
=========================== */
.top-nav {
    background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

/* HAMBURGER */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    margin: 5px 0;
    transition: 0.3s;
}

.hamburger.active span:nth-child(1) { transform: rotate(-45deg) translate(-5px, 6px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(45deg) translate(-5px, -6px); }

/* NAV MENU */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 5px;
}

.nav-menu li a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 15px;
    transition: background 0.2s;
    display: block;
}

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

/* NAV RIGHT */
.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
    white-space: nowrap;
}

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

/* 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: 7px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: background 0.2s;
}

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

.lang-arrow {
    font-size: 10px;
    margin-left: 2px;
}

.lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    min-width: 160px;
    z-index: 1000;
}

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

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s;
}

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

.lang-option.active {
    background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
    color: white;
    font-weight: 600;
}

/* ===========================
   CONTENT
=========================== */
.content {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.content-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: var(--shadow-sm);
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.header-row h1 {
    font-size: 24px;
    color: var(--heading-color);
    font-weight: 700;
}

/* ===========================
   BUTTONS
=========================== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-action {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    transition: transform 0.2s;
}

.btn-action:hover {
    transform: scale(1.2);
}

/* ===========================
   MODALS
=========================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background: white;
    margin: 50px auto;
    border-radius: 10px;
    max-width: 600px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    font-size: 20px;
    color: var(--heading-color);
    font-weight: 700;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-toggle {
    background: rgba(13, 71, 161, 0.1);
    color: var(--primary-end);
    border: 1px solid var(--primary-end);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

.close-modal {
    font-size: 28px;
    color: #999;
    cursor: pointer;
    font-weight: 300;
    line-height: 1;
}

.close-modal:hover {
    color: #333;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 25px;
    border-top: 1px solid #e5e7eb;
}

.btn-modal-primary {
    background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.btn-modal-secondary {
    background: #e5e7eb;
    color: #333;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

/* ===========================
   FORMS
=========================== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-end);
    box-shadow: 0 0 0 3px rgba(13,71,161,0.1);
}

.form-group input[readonly] {
    background: #f5f5f5;
    cursor: not-allowed;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

/* ===========================
   MESSAGES
=========================== */
.error {
    background: #fee;
    color: #c33;
    padding: 12px 15px;
    border-radius: 6px;
    border-left: 4px solid #c33;
    margin-bottom: 15px;
}

.success {
    background: #efe;
    color: #3c3;
    padding: 12px 15px;
    border-radius: 6px;
    border-left: 4px solid #3c3;
    margin-bottom: 15px;
}

.loading {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 14px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* ===========================
   LOGIN PAGE
=========================== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 12px;
    padding: 40px 30px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    font-size: 28px;
    font-weight: 700;
    color: var(--heading-color);
    text-align: center;
    margin-bottom: 30px;
}

.btn-login {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-start) 0%, var(--primary-end) 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

/* ===========================
   MOBIL RESPONSIV
=========================== */
@media (max-width: 768px) {
    /* NAVBAR */
    .hamburger {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--mobile-nav);
        flex-direction: column;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        box-shadow: var(--shadow-md);
    }

    .nav-menu.active {
        max-height: 400px;
    }

    .nav-menu li {
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .nav-menu li a {
        padding: 15px 20px;
        border-radius: 0;
    }

    .nav-right {
        gap: 10px;
    }

    .btn-logout {
        padding: 6px 12px;
        font-size: 13px;
    }

    .lang-current {
        padding: 6px 10px;
        font-size: 12px;
    }

    .lang-menu {
        right: auto;
        left: 0;
    }

    /* CONTENT */
    .content {
        padding: 15px;
    }

    .content-card {
        padding: 20px 15px;
    }

    .header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-row h1 {
        font-size: 20px;
    }

    /* MODAL */
    .modal {
        padding: 10px;
    }

    .modal-content {
        margin: 20px auto;
    }

    .modal-header {
        padding: 15px;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    .modal-body {
        padding: 15px;
    }

    .modal-footer {
        padding: 15px;
        flex-direction: column;
    }

    .modal-footer button {
        width: 100%;
    }

    /* FORMS */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 16px;
    }

    .content-card {
        padding: 15px 10px;
    }

    .btn-primary {
        width: 100%;
        padding: 12px;
    }
}