/* * Filename: style.css
* Description: Master stylesheet for WEBoracle 2.0
* Theme: Dark Mode / Tech Aesthetic
* Update: Profilbilder økt til 45px.
*/

:root {
    /* --- Fargepalett --- */
    --bg-body: #1a252f;       /* Deep Blue/Grey */
    --bg-panel: #2c3e50;      /* Midnight Blue */
    --bg-input: #34495e;      /* Lighter Blue */
    
    --color-text-main: #ecf0f1; /* Off-white */
    --color-text-dark: #2c3e50; /* Dark grey/blue for tags */
    --color-text-muted: #2c3e50; /* Silver */
    
    /* NY PRIMÆRFARGE: Stålblå (Ditt valg) */
    --color-primary: #385d76;   
    
    /* AKKENTFARGE: Oransje (Knapper, Hover-rammer, CTA) */
    --color-accent: #df7902;    
    
    --color-success: #27ae60;
    --color-danger: #e74c3c;
    
    --border-color: rgba(255, 255, 255, 0.1);
    
    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hard: 0 10px 30px rgba(0, 0, 0, 0.3);
    
    --font-ui: 'Barlow', -apple-system, sans-serif;
    --font-code: 'Fira Code', monospace;
    
    --radius-sm: 4px;
    --radius-md: 6px;
}

* { box-sizing: border-box; }

body {
    background-color: var(--bg-body);
    color: var(--color-text-main);
    font-family: var(--font-ui);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-y: scroll;
    letter-spacing: 0.3px;
}

/* --- LENKER (Generelt) --- */
a { color: var(--color-primary); text-decoration: none; transition: 0.2s; }
a:hover { color: #385d76; text-decoration: none; }

h1, h2, h3, h4 { margin-top: 0; font-weight: 600; color: #fff; letter-spacing: 0.5px; }
p { margin-bottom: 1rem; color: var(--color-text-muted); font-size: 1.05rem; }

/* --- LAYOUT (1400px bredde) --- */
.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }

.main-content-area { 
    width: 100%; 
    max-width: 1400px; 
    margin: 0 auto; 
    padding: 2rem; 
    flex: 1; 
    animation: fadeIn 0.3s ease-in-out; 
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- HEADER & NAVBAR --- */
.site-header {
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky; top: 0; z-index: 100;
    box-shadow: var(--shadow-soft);
}

.header-content {
    max-width: 1400px; 
    margin: 0 auto; padding: 0 1rem;
    display: flex; justify-content: space-between; align-items: center;
}

/* Header Klynger */
.header-left, .header-right { display: flex; align-items: center; }
.header-left { gap: 2rem; }
.header-right { gap: 1rem; }

.logo-text {
    font-family: var(--font-code); font-size: 1.6rem; font-weight: bold;
    color: var(--color-primary); 
    white-space: nowrap; 
}

.site-navbar ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }

/* HEADER LINKER: Hvite standard, Stålblå hover */
.site-navbar a, .nav-disabled, .adv-label {
    font-weight: 500;
    color: #ffffff; /* HVIT */
    padding: 0.5rem;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    transition: color 0.2s;
    cursor: pointer;
    white-space: nowrap; 
}

.site-navbar a:hover, .adv-search-toggle:hover .adv-label { 
    color: var(--color-primary); /* Stålblå hover */
    background: transparent;
}

.nav-disabled { color: rgba(255,255,255,0.3); cursor: not-allowed; }

.user-profile-container { display: flex; align-items: center; gap: 15px; white-space: nowrap; }
.nav-avatar {
    width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--color-primary); /* Stålblå ring */
}
.nav-username { font-weight: 600; font-size: 0.95rem; color: #fff; }
.nav-logout-link { font-size: 1.2rem; color: var(--color-danger); opacity: 0.8; line-height: 1; }

/* --- BUTTONS --- */
.btn {
    display: inline-block; padding: 0.6rem 1.4rem; border-radius: var(--radius-sm);
    font-weight: 600; text-align: center; cursor: pointer;
    border: 1px solid transparent; transition: all 0.2s;
    font-family: var(--font-ui); text-transform: uppercase; font-size: 0.9rem;
}
.btn-primary { background-color: var(--color-accent); color: #fff; }
.btn-primary:hover { background-color: #e67e22; color: #fff; box-shadow: 0 0 15px rgba(223, 121, 2, 0.4); }
.btn-secondary { background-color: transparent; color: var(--color-text-main); border: 1px solid var(--border-color); }
.btn-secondary:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* --- CARDS --- */
.card-container, .tutorial-grid, .search-results-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem; margin-top: 1rem;
}

.card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color); 
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: border-color 0.2s, box-shadow 0.2s; 
}

/* Hover på kort: Oransje ramme */
.card:hover {
    box-shadow: var(--shadow-hard);
    border-color: var(--color-accent); 
}

/* VIKTIG: Spesifikk selektor for hovedbilde i kort */
.card img { width: 100%; height: 180px; object-fit: cover; border-bottom: 1px solid var(--border-color); }

.card-content { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.card-content h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.card-content h3 a { color: #fff; }
.card-content h3 a:hover { color: var(--color-primary); }

/* --- SIDEBAR WIDGETS (Ingen ramme) --- */
.sidebar-widget .card { 
    border: none !important;       
    background-color: transparent; 
    box-shadow: none;              
    padding: 0 !important;         
}

/* --- AUTHOR META (Cards) - FIKSET STØRRELSE TIL 45px --- */
.author-meta {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border-color);
}

/* VIKTIG: Spesifikk selektor for å vinne over ".card img" */
.card .author-meta .author-img {
    width: 45px;            /* ØKT: Til 45px */
    height: 45px;           /* ØKT: Til 45px */
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--color-primary); 
    border-bottom: 1px solid var(--color-primary);
    flex-shrink: 0;
    margin: 0;
}

.author-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

.author-name { 
    color: #fff; 
    font-weight: 600; 
    font-size: 0.8rem;
}

.author-job { 
    color: var(--color-text-muted); 
    font-size: 0.7rem;
    margin-bottom: 2px;
}

.post-date { 
    color: var(--color-primary); 
    font-size: 0.65rem;     
    opacity: 0.8;
}

/* --- TAGS (Buttons in cards) --- */
.meta-tags { margin-bottom: 1rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.category-tag { 
    background: #ecf0f1; color: #2c3e50; 
    border: 1px solid var(--color-accent);
    padding: 3px 10px; border-radius: 12px; font-size: 0.75rem; 
    font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}

/* --- FORMS --- */
input, textarea, select {
    width: 100%; padding: 12px; background-color: var(--bg-input);
    border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    color: #fff; font-family: var(--font-ui); margin-bottom: 1rem;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--color-primary); }

/* --- SIDEBAR (Tutorials) --- */
.tutorial-layout { display: grid; grid-template-columns: 250px 1fr; gap: 2rem; align-items: start; }
.tutorial-sidebar {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    position: sticky; top: 100px;
}
.cat-list { list-style: none; padding: 0; margin: 0; }
.cat-list li { margin-bottom: 5px; }
.cat-list a { display: block; padding: 8px 12px; color: var(--color-text-muted); border-radius: 4px; }
.cat-list a:hover { background-color: rgba(255,255,255,0.05); color: var(--color-primary); }
.cat-list a.active { background-color: var(--color-primary); color: #fff; font-weight: bold; }

/* --- LOGIN MODAL --- */
#login-modal-wrapper {
    position: fixed; top: 70px; right: 20px; width: 300px;
    background-color: var(--bg-panel); padding: 2rem;
    border-radius: var(--radius-md); box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    border: 1px solid var(--border-color); z-index: 2000;
    display: none; opacity: 0; transform: translateY(-20px); transition: all 0.3s;
}
#login-modal-wrapper.is-visible { display: block; opacity: 1; transform: translateY(0); animation: slideDownFade 0.3s forwards; }
@keyframes slideDownFade { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

/* Lenker i Login Modal Footer (Sølv -> Oransje) */
.login-footer-link {
    color: var(--color-text-muted) !important;
    text-decoration: none;
    transition: color 0.2s ease;
}
.login-footer-link:hover {
    color: var(--color-accent) !important;
    text-decoration: none;
}

/* --- UTILS --- */
.advanced-panel { background: #151e26; border-bottom: 1px solid var(--color-primary); overflow: hidden; max-height: 0; transition: max-height 0.4s; }
.advanced-panel.open { max-height: 400px; padding: 2rem 0; }
.site-footer { background-color: #151e26; padding: 3rem 0; margin-top: 4rem; border-top: 1px solid var(--border-color); text-align: center; font-size: 0.9rem; }
.footer-content { max-width: 1400px; margin: 0 auto; padding: 0 1rem; } 
.footer-nav ul { list-style: none; padding: 0; display: flex; justify-content: center; gap: 2rem; margin-bottom: 2rem; }
pre { background: #151e26 !important; border-radius: var(--radius-md); padding: 1.5rem; border: 1px solid #333; overflow-x: auto; }
code { font-family: var(--font-code); }
.copy-code-btn { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,0.1); color: #ccc; border: none; padding: 4px 8px; border-radius: 4px; cursor: pointer; }

@media (max-width: 900px) { .tutorial-layout, .home-layout { grid-template-columns: 1fr !important; } }
@media (max-width: 768px) {
    .header-content { flex-direction: column; gap: 1rem; }
    .site-navbar ul { gap: 1rem; font-size: 0.9rem; flex-wrap: wrap; justify-content: center; }
    .card-container { grid-template-columns: 1fr; }
    .user-profile-container { margin-top: 10px; }
}