/* =============================================
   1. GLOBALE VARIABLER OG RESET
   ============================================= */
:root {
    --primary-color: #ff9900; /* Oransje */
    --secondary-color: #6a0dad; /* Dyp lilla */
    --accent-color: #00ffff; /* Turkis/Neon */
    --background-dark: #121212;
    --text-light: #f0f0f0;
    --text-muted: #888;
    --bg-light: #1a1a1a; /* Lyseste bakgrunn */
    --bg-medium: #2a2a2a; /* Mellom-bakgrunn */
    --border-color: #333;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: sans-serif; background-color: var(--background-dark); color: var(--text-light); line-height: 1.6; }

/* Verktøyklasse for skjermlesere */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =============================================
   2. HEADER OG NAVIGASJON
   ============================================= */
/* (Bootstrap-stiler vil overstyre det meste her, men vi beholder variablene) */
header { 
    background: #000;
    /* (Resten av header-stilen håndteres nå av Bootstrap i header.php) */
}

/* (Beholder de gamle knappene for sider som kanskje ikke bruker Bootstrap ennå) */
.cta-login { border: 1px solid var(--border-color); }
.cta-login:hover { border-color: var(--primary-color); }
.cta-join { background-color: var(--secondary-color); }
.cta-join:hover { background-color: #8c2cdc; color: white; }

nav#main-nav a i {
    width: 1.5em;
    text-align: center;
    font-size: 1.1rem;
}

/* =============================================
   3. GENERELLE LAYOUT & KNAPPER
   ============================================= */
main { padding: 4rem 5%; }
footer { text-align: center; padding: 1rem; margin-top: 2rem; border-top: 1px solid var(--border-color); font-size: 0.9rem; color: var(--text-muted); }

/* (Bootstrap-knapper vil brukes der det er mulig, men vi beholder disse som fallback) */
.btn-primary, .btn-secondary { display: inline-block; padding: 1rem 2rem; border-radius: 5px; text-decoration: none; font-weight: bold; text-transform: uppercase; transition: background-color 0.3s, transform 0.2s; }
.btn-primary { background-color: var(--primary-color); color: var(--background-dark); }
.btn-primary:hover { background-color: #ffb84d; transform: translateY(-2px); }
.btn-secondary { background-color: var(--secondary-color); color: var(--text-light); }
.page-content { padding: 2rem 0; max-width: 1000px; margin: auto; }
.back-link { display: inline-block; margin-bottom: 1.5rem; color: var(--accent-color); text-decoration: none; font-size: 0.9rem; }
.back-link:hover { text-decoration: underline; }

/* =============================================
   4. FORSIDE (INDEX.PHP - KONTOSENTER & STATS)
   ============================================= */
.page-content { padding: 2rem 0; max-width: 1200px; margin: auto; }

/* --- Kontosenter (Account Center) --- */
#account-center {
    /* KORRIGERING: Fjernet bakgrunnsfarge og kantlinje for et renere utseende */
    margin-bottom: 1.5rem;
    padding: 2rem 5%;
}

.account-header h2 {
    font-size: 2rem;
    color: var(--primary-color); /* ENDRET: Fra turkis til oransje */
    margin-bottom: 0.5rem;
}

.account-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.info-box-personal,
.info-box-email,
.info-box-client,
.info-box-quicklinks {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    box-shadow: none;
    min-height: 120px;
}

.info-box-personal h4,
.info-box-email h4,
.info-box-client h4,
.info-box-quicklinks h4 {
    color: var(--text-light); /* ENDRET: Fra lilla til hvit */
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 0.4rem;
}

.info-box-client ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
    font-size: 0.8rem;
}

.info-box-client code {
    background: #333;
    padding: 1px 3px;
    border-radius: 3px;
    color: var(--text-light); /* ENDRET: Fra turkis til hvit */
    font-size: 0.75rem;
}

.info-box-quicklinks a.btn-secondary {
    /* Sikrer at knappene i kontosenteret er mindre */
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    text-transform: none;
    font-weight: normal;
}
.info-box-quicklinks a {
    display: block;
    width: 100%;
    margin-bottom: 0.4rem;
}


/* --- Kompakt Statistikk --- */
#compact-stats {
    padding: 1rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}
#compact-stats h3 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--text-light);
}

.stat-box-compact-grid {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
    max-width: 900px;
    margin: auto;
}

.stat-box-compact {
    flex-basis: 30%;
    background: var(--bg-light);
    padding: 0.8rem;
    border-radius: 4px;
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.stat-box-compact span {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-light);
    display: block;
    margin-bottom: 0.1rem;
}
.stat-box-compact h4 {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* --- Siste aktivitet (justert for mindre dominans) --- */
#latest-activity { 
    padding: 2rem 5%;
    margin: 0 auto;
    max-width: 900px;
}
#latest-activity h3 { 
    text-align: left;
    font-size: 1.5rem;
    color: var(--text-light); /* ENDRET: Fra turkis til hvit */
    margin-bottom: 1rem;
}

.activity-list { background: var(--bg-light); border-radius: 8px; padding: 0.5rem; }
.activity-item { display: flex; align-items: center; padding: 0.75rem 1rem; gap: 0.8rem; }
.activity-content { color: #bbb; font-size: 0.85rem; }
.activity-avatar { width: 35px; height: 35px; border: 1px solid var(--secondary-color); }
.activity-content a { color: var(--accent-color); text-decoration: none; } /* Beholder lenkefarge for synlighet */
.activity-content a:hover { text-decoration: underline; }


/* =============================================
   5. LOGIN/REGISTRERING (AUTH)
   ============================================= */
.form-page { padding: 4rem 0; text-align: center; }
.auth-form { max-width: 400px; margin: 2rem auto; background: var(--bg-light); padding: 2rem; border-radius: 8px; }
.auth-form div { margin-bottom: 1.5rem; text-align: left; }
.auth-form label { display: block; margin-bottom: 0.5rem; font-weight: bold; }
.auth-form input[type="text"], .auth-form input[type="email"], .auth-form input[type="password"] { width: 100%; padding: 0.8rem; background: #333; border: 1px solid #555; color: var(--text-light); border-radius: 5px; }
.auth-form .error { color: #ff6b6b; font-size: 0.9rem; margin-top: 5px; }
.message.success { background: #4caf50; color: white; padding: 1rem; margin-bottom: 1rem; border-radius: 5px; }
.message.error { background: #f44336; color: white; padding: 1rem; margin-bottom: 1rem; border-radius: 5px; }

/* =============================================
   6. FORUM KATEGORI-LISTE (FORUM.PHP)
   ============================================= */
.category-list { margin-top: 1rem; }
.category-item { background: var(--bg-light); border-radius: 8px; margin-bottom: 1rem; padding: 0; border-left: none; display: grid; grid-template-columns: 2.5fr 1fr 1.5fr; align-items: center; border: 1px solid var(--border-color); }
.category-item:hover { border-color: var(--secondary-color); }
.category-item h3 { margin: 0 0 0.5rem 0; }
.category-item h3 a { color: var(--primary-color); text-decoration: none; font-size: 1.5rem; }
.category-item h3 a:hover { text-decoration: underline; }
.category-item p { margin: 0; color: #bbb; }
.category-list-header { display: grid; grid-template-columns: 2.5fr 1fr 1.5fr; padding: 0 1.5rem; margin-bottom: 0.5rem; color: var(--text-muted); font-size: 0.9rem; font-weight: bold; text-transform: uppercase; }
.category-title { padding: 1.5rem 2rem; }
.category-stats, .category-last-post { padding: 1.5rem 1.5rem; font-size: 0.9rem; background: #1f1f1f; height: 100%; display: flex; flex-direction: column; justify-content: center; }
.category-stats { border-left: 1px solid var(--border-color); border-right: 1px solid var(--border-color); text-align: center; }
.category-stats span { color: #ccc; }
.category-stats span strong { color: white; font-size: 1.2rem; margin-right: 5px; }
.category-last-post span { color: var(--text-muted); font-size: 0.85rem; }
.category-last-post .last-post-title { color: var(--accent-color); text-decoration: none; font-weight: bold; font-size: 1rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.category-last-post .last-post-title:hover { text-decoration: underline; }
.category-last-post .last-post-by a { color: #ccc; text-decoration: none; }
.category-last-post .last-post-by a:hover { text-decoration: underline; }

/* =============================================
   7. FORUM EMNE-LISTE (VIEW_CATEGORY.PHP)
   ============================================= */
/* NYTT: RENT DESIGN FOR 'OPPRETT EMNE' */
.create-topic-container {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}
.create-topic-form {
    display: flex;
    gap: 1rem;
    align-items: center;
}
.create-topic-form input[type="text"] {
    flex-grow: 1; /* Tar opp all ledig plass */
    /* Bruker standard input-stil fra .auth-form */
    padding: 0.8rem; 
    background: #333; 
    border: 1px solid #555; 
    color: var(--text-light); 
    border-radius: 5px;
}
.create-topic-form .btn-primary {
    /* Gjør knappen mindre, lik resten av forumet */
    padding: 0.8rem 1.2rem;
    text-transform: none;
    font-weight: normal;
}
.forum-topic { background-color: var(--bg-light); padding: 1rem 1.5rem; margin-bottom: 10px; border-left: 5px solid var(--primary-color); border-radius: 5px; position: relative; }
.forum-topic h4 { margin: 0; padding: 0; font-size: 1.2rem; }
.forum-topic h4 a { color: var(--text-light); text-decoration: none; transition: color 0.2s; }
.forum-topic h4 a:hover { color: var(--primary-color); }
.forum-topic small { color: #999; }
.forum-topic small a { color: #ccc; text-decoration: none; }
.forum-topic small a:hover { text-decoration: underline; }

/* =============================================
   8. FORUM INNLEGG-VISNING (TOPIC.PHP)
   ============================================= */
.forum-post { background: var(--bg-light); border: 1px solid var(--border-color); border-radius: 8px; margin-bottom: 1.5rem; display: grid; grid-template-columns: 180px 1fr; }
.post-meta { grid-column: 2; font-size: 0.85rem; color: var(--text-muted); padding: 0.75rem 1.5rem; border-bottom: 1px solid var(--border-color); }
.post-content { grid-column: 2; padding: 1.5rem; line-height: 1.7; white-space: pre-wrap; display: flex; flex-direction: column; justify-content: space-between; min-height: 150px; }
.reply-box { max-width: 100% !important; margin-top: 3rem; border-top: 2px solid var(--secondary-color); padding-top: 2rem; }
textarea { width: 100%; padding: 0.8rem; background: #333; border: 1px solid #555; color: var(--text-light); border-radius: 5px; font-family: inherit; font-size: 1rem; margin-bottom: 1rem; display: block; }
.post-body { padding-bottom: 1rem; }
.post-signature { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px dashed var(--border-color); font-style: italic; color: #999; font-size: 0.9rem; }
.post-footer { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 1rem; padding-top: 0.5rem; border-top: 1px solid #222; }
.post-edited-stamp { font-size: 0.8rem; color: #777; font-style: italic; }
.post-like-area { display: flex; align-items: center; gap: 0.75rem; }
.like-count { font-size: 0.9rem; font-weight: bold; color: #ccc; }
.like-btn { display: inline-block; background: var(--secondary-color); color: white; padding: 0.3rem 0.8rem; border-radius: 5px; text-decoration: none; font-size: 0.9rem; font-weight: bold; border: 1px solid var(--secondary-color); transition: all 0.2s; }
.like-btn:hover { background: #8c2cdc; }
.like-btn.liked { background: var(--bg-medium); color: var(--primary-color); border-color: var(--primary-color); }
.like-btn.liked:hover { background: #333; }

/* =============================================
   9. PROFIL & AVATAR STYLES
   ============================================= */
/* NYTT: PROFIL-DESIGN (PROFILE.PHP) */
.profile-container { display: none; } /* Deaktivert gammel stil */

/* Header-rutenett (Avatar, Info, Handlinger) */
.profile-header-grid {
    display: grid;
    grid-template-columns: 200px 1fr 250px; /* Avatar | Info | Handlinger */
    gap: 2rem;
    align-items: center;
    background: var(--bg-medium);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}
.profile-header-info h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}
.profile-header-info p {
    margin: 0;
    color: var(--text-muted);
}
.profile-header-actions .btn-primary,
.profile-header-actions .btn-secondary {
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
}

/* Selve hovedavataren */
.profile-avatar-main {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--secondary-color);
    background: #000;
}

/* Innholdsrutenett (Bio, Stats) */
.profile-content-grid {
    display: grid;
    grid-template-columns: 2.5fr 1fr; /* 2/3 til bio, 1/3 til stats */
    gap: 2rem;
}

/* Sikrer at .admin-section fungerer bra i denne konteksten */
.profile-content-grid .admin-section {
    max-width: 100%;
    margin: 0;
}
.profile-content-grid .admin-section h4 {
    color: var(--secondary-color);
    font-size: 1rem;
    text-transform: uppercase;
    margin-top: 0;
}

/* (Beholder eldre stiler som fallback for andre profilsider) */
.profile-bio { white-space: pre-wrap; background: var(--bg-medium); padding: 1rem; border-radius: 5px; }
.profile-avatar { max-width: 200px; height: 200px; object-fit: cover; border-radius: 50%; border: 4px solid var(--secondary-color); }
input[type="file"] { width: 100%; padding: 0.8rem; background: #333; border: 1px solid #555; color: #999; border-radius: 5px; }
.edit-profile-container { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; }
.avatar-preview { text-align: center; margin-bottom: 1.5rem; }
.avatar-preview img { max-width: 200px; height: 200px; object-fit: cover; border-radius: 50%; border: 4px solid var(--secondary-color); }
.post-avatar { width: 100px; height: 100px; object-fit: cover; border-radius: 50%; margin-bottom: 1rem; border: 3px solid var(--border-color); }
.post-author { background: none; border-right: 1px solid var(--border-color); border-radius: 0; padding: 1.5rem 1rem; text-align: center; word-wrap: break-word; }
.post-author a { color: var(--primary-color); text-decoration: none; font-size: 1.1rem; }
.post-author a:hover { text-decoration: underline; }

/* =============================================
   10. ADMIN & MODERASJON
   ============================================= */
.admin-container { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 2rem; }
.admin-section { background: var(--bg-light); padding: 2rem; border-radius: 8px; }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.admin-table th, .admin-table td { padding: 0.75rem; border-bottom: 1px solid var(--border-color); text-align: left; font-size: 0.9rem; }
.admin-table th { background: var(--bg-medium); }
.admin-form { display: flex; gap: 5px; }
.admin-form select { background: #333; color: white; border: 1px solid #555; padding: 5px; }
.admin-form button, .delete-btn { background: var(--secondary-color); color: white; border: none; padding: 5px 10px; border-radius: 5px; cursor: pointer; }
.delete-btn { background: #c0392b; }
.stat-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; margin-bottom: 2rem; }
.stat-box { background: var(--bg-light); padding: 1.5rem; border-radius: 8px; border-top: 4px solid var(--primary-color); }
.stat-box h4 { margin: 0 0 0.5rem 0; font-size: 1rem; color: #ccc; }
.stat-box span { font-size: 2.5rem; font-weight: bold; color: var(--text-light); }
.admin-action-btn { color: var(--accent-color); text-decoration: none; font-weight: bold; font-size: 0.9rem; margin-right: 1.5rem; }
.admin-action-btn:hover { text-decoration: underline; }
.admin-topic-actions { background: #1e1e1e; padding: 0.5rem 1rem; border-radius: 5px; margin-bottom: 2rem; border-left: 3px solid var(--accent-color); }
.delete-topic-btn { color: #ff6b6b; text-decoration: none; font-weight: bold; font-size: 1.2rem; position: absolute; right: 1.5rem; top: 50%; transform: translateY(-50%); padding: 5px; }
.delete-topic-btn:hover { color: #f44336; background-color: #333; border-radius: 5px; }
.delete-post-btn { color: #ff6b6b; text-decoration: none; font-weight: bold; font-size: 0.8rem; margin-left: 1rem; }
.delete-post-btn:hover { color: #f44336; text-decoration: underline; }
.edit-post-btn { color: var(--accent-color); text-decoration: none; font-weight: bold; font-size: 0.8rem; margin-left: 1rem; }
.edit-post-btn:hover { color: #00ffff; text-decoration: underline; }
.sticky-tag { font-size: 1rem; color: var(--primary-color); background: #333; padding: 0.2rem 0.6rem; border-radius: 5px; vertical-align: middle; margin-left: 0.5rem; }
.forum-topic-sticky { background: var(--bg-medium); border-left-color: var(--accent-color); }
.sticky-tag-list { color: var(--primary-color); font-weight: bold; font-size: 0.9rem; margin-right: 5px; }

/* =============================================
   11. SIDEINNDELING (PAGINATION)
   ============================================= */
.pagination { margin: 2rem 0; text-align: center; }
.pagination a, .pagination span { display: inline-block; padding: 0.5rem 1rem; margin: 0 2px; border-radius: 5px; text-decoration: none; background: #1e1e1e; color: var(--text-light); border: 1px solid var(--border-color); }
.pagination a:hover { background: var(--secondary-color); color: white; }
.pagination .current-page { background: var(--primary-color); color: var(--background-dark); font-weight: bold; border-color: var(--primary-color); }
.pagination .disabled { color: #555; background: var(--bg-light); cursor: default; }
.pagination .ellipsis { background: none; border: none; color: #555; }
.reply-notice { text-align: center; background: #1e1e1e; padding: 2rem; border-radius: 8px; margin-top: 2rem; }
.reply-notice a { color: var(--accent-color); font-weight: bold; }

/* =============================================
   12. SØKEFUNKSJON
   ============================================= */
/* (Disse stilene er nå overflødige hvis du bruker Bootstrap-headeren, men beholdes for sikkerhets skyld) */
.header-search-form { margin-left: 1.5rem; display: flex; }
.header-search-form input[type="search"] { background: #222; border: 1px solid #444; color: var(--text-light); padding: 0.4rem 0.8rem; border-radius: 5px 0 0 5px; width: 180px; font-size: 0.9rem; }
.header-search-form button { background: var(--primary-color); color: var(--background-dark); border: none; padding: 0 0.8rem; cursor: pointer; border-radius: 0 5px 5px 0; font-size: 0.9rem; }
.search-form-page { display: flex; gap: 0.5rem; margin: 2rem 0; }
.search-form-page input[type="search"] { flex-grow: 1; padding: 0.8rem; background: #333; border: 1px solid #555; color: var(--text-light); border-radius: 5px; font-size: 1.1rem; }
.search-form-page .btn-primary { padding: 0 1.5rem; text-transform: none; font-size: 1rem; }
.search-result-count { font-size: 1.2rem; color: #ccc; margin-bottom: 1rem; }

/* =============================================
   13. BRUKER-RANGERING
   ============================================= */
.post-author-info { /* Tom på desktop, lar .post-author (text-align: center) styre */ }
.post-rank { display: block; font-size: 0.9rem; color: var(--accent-color); font-weight: bold; margin-top: 0.5rem; }
.profile-rank { display: block; font-size: 1.2rem; color: var(--accent-color); font-weight: bold; margin-top: -0.5rem; margin-bottom: 1.5rem; }

/* =============================================
   14. MOBILNAVIGASJON
   ============================================= */
/* (Disse stilene er nå overflødige, da Bootstrap håndterer mobilnavigasjon) */
/* #mobile-menu-toggle { display: none; ... } */
/* nav#main-nav { ... } */

/* =============================================
   15. HERO-BILDE 3D-EFFEKT
   ============================================= */
.hero-image.js-tilt { transform-style: preserve-3d; }
.hero-image.js-tilt img { transform: translateZ(20px); }

/* =============================================
   16. VARSLINGSSYSTEM (OPPDATERT)
   ============================================= */
/* (Disse stilene er nå overflødige, da Bootstrap håndterer varsler) */
/* nav#main-nav a.notification-bell { ... } */
/* .notification-badge { ... } */

.notification-list { background: var(--bg-light); border-radius: 8px; overflow: hidden; }
.notification-item { display: flex; align-items: center; gap: 1rem; padding: 1.2rem; text-decoration: none; color: #ccc; border-bottom: 1px solid var(--border-color); }
.notification-item.unread { background: var(--bg-medium); }
.notification-item:hover { background: #333; }
.notification-avatar { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; }
.notification-content { flex-grow: 1; }
.notification-text { font-size: 0.95rem; }
.notification-text strong { color: var(--primary-color); }
.notification-time { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: 3px; }
.no-notifications { padding: 2rem; text-align: center; color: var(--text-muted); }

/* =============================================
   17. PRIVAT MELDINGSSYSTEM (PM)
   ============================================= */
.pm-inbox-list .notification-item.unread { background: var(--bg-medium); border-left: 3px solid var(--primary-color); padding-left: calc(1.2rem - 3px); }
.pm-inbox-list .notification-item.read { border-left: 3px solid var(--border-color); padding-left: calc(1.2rem - 3px); }
.pm-inbox-list .pm-subject { font-style: italic; color: #ccc; display: block; font-size: 0.9rem; margin-top: 4px; }
.pm-conversation-view { display: flex; flex-direction: column; gap: 1.5rem; background: var(--bg-light); padding: 1.5rem; border-radius: 8px; }
.pm-message { display: flex; gap: 1rem; max-width: 80%; }
.pm-avatar { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.pm-content-wrap { display: flex; flex-direction: column; }
.pm-content { background: #333; padding: 0.8rem 1.2rem; border-radius: 15px; color: var(--text-light); white-space: pre-wrap; }
.pm-timestamp { font-size: 0.8rem; color: var(--text-muted); margin-top: 5px; padding-left: 5px; }
.pm-message.sent { align-self: flex-end; flex-direction: row-reverse; }
.pm-message.sent .pm-content { background: var(--secondary-color); color: white; }
.pm-message.sent .pm-timestamp { text-align: right; padding-right: 5px; }

/* =============================================
   18. SANNTIDS CHAT-SYSTEM
   ============================================= */
.chat-container {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    height: 70vh;
    max-height: 600px;
    overflow: hidden;
}
.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.chat-message { display: flex; gap: 0.75rem; max-width: 80%; }
.chat-avatar { width: 35px; height: 35px; border-radius: 50%; object-fit: cover; }
.chat-message-content { background: var(--bg-medium); padding: 0.5rem 1rem; border-radius: 10px; width: 100%; }
.chat-username { font-weight: bold; font-size: 0.9rem; color: var(--primary-color); }
.chat-message-content p { margin: 0; color: var(--text-light); white-space: pre-wrap; word-break: break-word; }
.chat-timestamp { font-size: 0.75rem; color: var(--text-muted); float: right; }
.chat-message-system { text-align: center; font-style: italic; color: var(--text-muted); }
.chat-message.self { align-self: flex-end; flex-direction: row-reverse; }
.chat-message.self .chat-message-content { background: var(--secondary-color); }
.chat-message.self .chat-username { display: none; }
.chat-message.self .chat-timestamp { color: #eee; }
.chat-form { display: flex; padding: 1rem; border-top: 1px solid var(--border-color); background: var(--bg-medium); }
.chat-form input { flex-grow: 1; padding: 0.8rem; background: #333; border: 1px solid #555; color: var(--text-light); border-radius: 5px 0 0 5px; border-right: 0; }
.chat-form button { padding: 0.8rem 1.2rem; background: var(--primary-color); color: var(--background-dark); border: none; border-radius: 0 5px 5px 0; font-weight: bold; cursor: pointer; }

/* =============================================
   19. RESPONSIVT DESIGN (MOBIL)
   ============================================= */
@media (max-width: 900px) {
    .admin-container { grid-template-columns: 1fr; }
    .edit-profile-container { grid-template-columns: 1fr; }
    .edit-avatar { grid-row: 1; }
    .profile-container { grid-template-columns: 1fr; }
    .category-list-header { display: none; }
    .category-item { grid-template-columns: 1fr; }
    .category-stats, .category-last-post { border: none; border-top: 1px dashed var(--border-color); background: var(--bg-light); text-align: left; padding-left: 2rem; }
    .category-stats { flex-direction: row; gap: 1.5rem; }
    
    /* NYTT: Responsiv profil */
    .profile-header-grid {
        grid-template-columns: 1fr; /* Stabler alt */
        text-align: center;
    }
    .profile-header-avatar {
        margin-bottom: 1rem;
    }
    .profile-header-actions {
        max-width: 300px;
        margin: 1rem auto 0 auto;
    }
    .profile-content-grid {
        grid-template-columns: 1fr; /* Stabler bio og stats */
    }
}

@media (max-width: 768px) {
    /* (Bootstrap håndterer nå mobilmeny-logikken) */
    
    /* Gammel responsiv kode (beholdes for innhold) */
    #hero { flex-direction: column; text-align: center; min-height: unset; padding: 3rem 0; }
    .hero-content, .hero-image { max-width: 100%; width: 100%; margin-bottom: 2rem; }
    .feature-grid { flex-direction: column; }
    
    /* Justerer for den nye strukturen på mobil */
    .stat-box-compact-grid {
        flex-direction: column;
        gap: 10px;
    }
    .account-info-grid {
        grid-template-columns: 1fr;
    }

    .forum-post { grid-template-columns: 1fr; }
    .post-author { border-right: 0; border-bottom: 1px solid var(--border-color); text-align: left; padding: 0.75rem 1rem; display: flex; align-items: center; gap: 1rem; }
    .post-meta { grid-column: 1; grid-row: 2; padding-left: 1rem; }
    .post-content { grid-column: 1; grid-row: 3; padding-top: 1rem; }
    .post-avatar { width: 40px; height: 40px; margin-bottom: 0; }
    .post-author-info { text-align: left; }
    .post-rank { margin-top: 0; font-size: 0.8rem; color: #999; }
}
/* =============================================
   20. RAPPORTERINGSSYSTEM
   ============================================= */

.report-btn { color: var(--text-muted); text-decoration: none; font-weight: bold; font-size: 0.8rem; margin-left: 1rem; }
.report-btn:hover { color: #ff6b6b; text-decoration: underline; }
.report-form-container { grid-column: 2; background: #1e1e1e; padding: 1rem 1.5rem; border-top: 1px dashed var(--border-color); border-radius: 0 0 8px 8px; margin-top: -1.5rem; margin-bottom: 1.5rem; }
.report-form-container form { display: flex; align-items: center; gap: 1rem; }
.report-form-container label { font-weight: bold; font-size: 0.9rem; flex-shrink: 0; }
.report-form-container textarea { flex-grow: 1; margin-bottom: 0; font-size: 0.9rem; padding: 0.5rem; rows: 2; }
.report-list { display: flex; flex-direction: column; gap: 1.5rem; }
.report-item { background: var(--bg-medium); padding: 1rem; border-radius: 5px; border-left: 4px solid var(--primary-color); }
.report-item p { margin-bottom: 0.5rem; }
.report-meta { font-size: 0.9rem; color: var(--text-muted); }
.report-post-preview { background: var(--background-dark); padding: 0.8rem; border-radius: 4px; font-style: italic; color: #ccc; border: 1px solid var(--border-color); }
.report-actions { margin-top: 1rem; display: flex; gap: 0.5rem; }
.report-actions .btn-primary,
.report-actions .btn-secondary { padding: 0.5rem 1rem; font-size: 0.9rem; text-transform: none; font-weight: normal; }

/* =============================================
   21. @MENTION STYLING
   ============================================= */
.mention-tag { color: var(--accent-color); font-weight: bold; background-color: rgba(0, 255, 255, 0.1); padding: 0 3px; border-radius: 3px; }

/* =============================================
   22. TRIBUTE.JS (@MENTION POPUP)
   ============================================= */
.tribute-container { border: 1px solid var(--border-color); background-color: var(--bg-medium); border-radius: 5px; box-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.tribute-container ul { list-style: none; margin: 0; padding: 0; }
.tribute-container li { padding: 8px 12px; display: flex; align-items: center; gap: 10px; color: var(--text-light); border-bottom: 1px solid var(--border-color); }
.tribute-container li:last-child { border-bottom: none; }
.tribute-container li.highlight,
.tribute-container li:hover { background-color: var(--secondary-color); color: white; cursor: pointer; }
.mention-item-avatar img { width: 25px; height: 25px; border-radius: 50%; object-fit: cover; }
.mention-item-username { font-weight: bold; }

/* =============================================
   23. LIVE CHAT - SIDEBAR
   ============================================= */
.chat-room-container { display: flex; flex-direction: row; gap: 1.5rem; height: 70vh; max-height: 600px; }
.chat-container { flex-grow: 1; }
.chat-sidebar { flex-basis: 250px; flex-shrink: 0; background: var(--bg-light); border: 1px solid var(--border-color); border-radius: 8px; display: flex; flex-direction: column; overflow: hidden; }
.chat-sidebar h4 { padding: 1rem; margin: 0; font-size: 0.9rem; color: var(--text-muted); text-transform: uppercase; border-bottom: 1px solid var(--border-color); background: var(--bg-medium); }
.online-user-list { list-style: none; padding: 0; margin: 0; overflow-y: auto; flex-grow: 1; }
.online-user-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color); }
.online-user-item:hover { background: var(--bg-medium); }
.online-user-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.online-user-item a { text-decoration: none; color: var(--text-light); font-weight: bold; font-size: 0.95rem; }
.online-user-item a:hover { text-decoration: underline; color: var(--primary-color); }

/* =============================================
   24. MEDLEMSLISTE (MEMBERS.PHP)
   ============================================= */
.member-list { background: var(--bg-light); border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; margin: 1.5rem 0; }
.member-item { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem; }
.member-item:not(:last-child) { border-bottom: 1px solid var(--border-color); }
.member-item:hover { background: var(--bg-medium); }
.member-avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }
.member-info { flex-grow: 1; }
.member-username { font-size: 1.2rem; font-weight: bold; color: var(--primary-color); text-decoration: none; }
.member-username:hover { text-decoration: underline; }
.member-rank { display: block; font-size: 0.9rem; color: var(--accent-color); }
.member-stats { flex-shrink: 0; text-align: right; font-size: 0.9rem; color: var(--text-muted); }
.member-stats span { display: block; }
.member-stats span strong { color: var(--text-light); }

/* =============================================
   25. WEBMAIL INTEGRASJON
   ============================================= */
.webmail-container {
    padding: 20px 5%;
    text-align: center;
}
.webmail-content-wrapper {
    max-width: 1200px;
    margin: 20px auto;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    overflow: hidden;
}
.webmail-iframe {
    width: 100%;
    height: 85vh;
    border: none;
    display: block;
}
/* =============================================
   NYTT: STIL FOR MOBIL-NEDLASTING (INDEX.PHP)
   ============================================= */
.mobile-config-links {
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px dashed var(--border-color);
    text-align: center;
}
.mobile-icons {
    font-size: 1.8rem; /* Litt mindre ikoner */
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.mobile-icons .fa-apple {
    margin-right: 1rem;
}
/* =============================================
   NYTT: FORSIDE OPPDATERINGSBOKS
   ============================================= */
#site-update {
    padding: 0 5%;
    margin-bottom: 2rem;
}
.update-box {
    background: var(--bg-medium); /* Likt som kontosenteret */
    border-bottom: 2px solid var(--primary-color);
    border-radius: 8px;
    overflow: hidden; /* For å holde innholdet pent */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
.update-header {
    background: var(--bg-light); /* Mørkere header for boksen */
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.update-header h4 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.2rem;
}
.update-header h4 i {
    margin-right: 0.5rem;
}
.update-header small {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.update-content {
    padding: 1.5rem;
    line-height: 1.7;
}
/* Styling for HTML-innhold fra TinyMCE */
.update-content p {
    margin-bottom: 1rem;
}
.update-content p:last-child {
    margin-bottom: 0;
}
.update-content h5 {
    color: var(--secondary-color);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}
/* =============================================
   NYTT: SPILLBIBLIOTEK (GAMES.PHP)
   ============================================= */

.game-library-grid {
    display: grid;
    /* Oppretter et responsivt rutenett */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.game-card {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    overflow: hidden; /* Sikrer at bildet holder seg innenfor rammen */
}
.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
    border-color: var(--primary-color);
}

.game-card-image {
    width: 100%;
    height: 160px; /* Fast høyde for bildene */
    object-fit: cover; /* Sikrer at bildet dekker, selv om proporsjonene er rare */
    border-bottom: 1px solid var(--border-color);
}

.game-card .card-body {
    padding: 1rem;
}

.game-card .card-title {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.game-card .card-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Stil for modalen (pop-up) */
.modal-content pre {
    max-height: 200px;
    overflow-y: auto;
}
/* =============================================
   NYTT: STIL FOR PROFILBILDE I NAVIGASJON
   ============================================= */
.nav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%; /* Gjør bildet rundt */
    object-fit: cover; /* Hindrer at bildet strekkes */
    vertical-align: middle; /* Sentrerer bildet med teksten */
    border: 1px solid var(--border-color);
}
/* =============================================
   NYTT: FORUM EMNELISTE-TABELL (VIEW_CATEGORY.PHP)
   ============================================= */

/* Header-en som inneholder Tittel og "Start Emne"-knapp */
.forum-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.forum-header-flex h2 {
    margin: 0; /* Fjerner standard H2-margin */
}

/* Selve tabellen */
.forum-table {
    width: 100%;
    background-color: var(--bg-light);
    border-collapse: collapse;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden; /* For å holde border-radius pen */
}

.forum-table th, .forum-table td {
    padding: 1rem 1.2rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.forum-table thead th {
    background-color: var(--bg-medium);
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
}
.forum-table tbody tr:hover {
    background-color: var(--bg-medium);
}

/* Definerer kolonnebredder */
.th-topic { width: 60%; }
.th-stats { width: 15%; text-align: center; }
.th-lastpost { width: 25%; }

/* Styling for Emne-kolonnen (td-topic) */
.td-topic {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.topic-icon {
    font-size: 1.5rem;
}
.icon-normal { color: var(--text-muted); }
.icon-sticky { color: var(--primary-color); }
.icon-locked { color: #ff6b6b; }

.topic-details {
    display: flex;
    flex-direction: column;
}
.topic-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-light);
    text-decoration: none;
}
.topic-title:hover {
    text-decoration: underline;
    color: var(--primary-color);
}
.topic-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.topic-meta a {
    color: #ccc;
    text-decoration: none;
}
.topic-meta a:hover {
    text-decoration: underline;
}

/* Styling for Statistikk-kolonnen (td-stats) */
.td-stats {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
}
.td-stats span {
    display: block;
}
.td-stats span strong {
    margin-right: 4px;
}

/* Styling for Siste Innlegg-kolonnen (td-lastpost) */
.td-lastpost {
    font-size: 0.9rem;
}
.td-lastpost a {
    display: block;
    color: #ccc;
    text-decoration: none;
    font-weight: bold;
}
.td-lastpost a:hover {
    text-decoration: underline;
}
.td-lastpost span {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
}