@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;700&family=DM+Mono:wght@400;500&family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,600;1,9..144,300&display=swap');

/* ── ROOT TOKENS ───────────────────────────────────────────────── */
:root {
    --bg:          #0b0f1a;
    --surface:     #121829;
    --surface2:    #1a2235;
    --surface3:    #1f2a40;
    --border:      rgba(255,255,255,0.07);
    --border-hi:   rgba(0,229,160,0.25);

    --accent-green: #00e5a0;
    --accent-blue:  #4f8cff;
    --accent-red:   #ff6b6b;
    --accent-gold:  #ffc94a;

    /* job-card alternating */
    --job-even:    #162030;
    --job-odd:     #1a2840;
    --job-active-from: #00594a;
    --job-active-to:   #003d6e;

    --text-primary:   #eef2ff;
    /* --text-secondary: #8894b4; */
    --text-secondary: #b3c2eb;
    --text-muted:     #4a5470;

    --radius-sm:  6px;
    --radius-md:  12px;
    --radius-lg:  20px;

    --shadow-card:  0 2px 12px rgba(0,0,0,0.45), 0 1px 3px rgba(0,0,0,0.3);
    --shadow-panel: 0 4px 32px rgba(0,0,0,0.55), 0 1px 4px rgba(0,0,0,0.3);
    --transition: 0.25s ease;
}

/* ── RESET ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body, html {
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    background-color: var(--bg);
    font-family: 'DM Sans', 'Titillium Web', sans-serif;
    font-size: large;
    font-weight: 400;
    color: var(--text-primary);
}

img {
    border-radius: var(--radius-md);
    padding: 0;
}

/* ── LAYOUT ─────────────────────────────────────────────────────── */
.container {
    display: flex;
    height: 97vh;
    isolation: isolate; /* Creates a new stacking context */
}

/* ── TOP BAR ─────────────────────────────────────────────────────── */
#topline {
    background: var(--surface);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    margin: 10px 20px 10px 10px;
    padding: 0 20px;
    width: calc(100% - 30px);
    height: 6vh;
    font-family: 'DM Sans', 'Titillium Web', sans-serif;
    font-weight: 700;
    font-size: larger;
    display: flex;
    flex-direction: row;
    align-items: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}

/* ── CLOCK ───────────────────────────────────────────────────────── */
#myClockFlexBlock {
    flex: 15%;
    display: flex;
    justify-content: center;
    align-self: center;
    text-align: center;
}

#myClock {
    align-self: center;
    text-align: center;
    border-radius: var(--radius-md);
    padding: 6px 14px;
    padding-right: 80px;
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
    font-family: 'DM Mono', monospace;
    font-size: 1.4em;
    font-weight: 500;
    letter-spacing: 0.06em;
    box-shadow: var(--shadow-card);
}

/* ── INFO LINE ───────────────────────────────────────────────────── */
#infoline {
    align-self: center;
    text-align: center;
    flex: 36%;
    /* padding-right: 50px; */
    color: var(--text-secondary);
    font-size: 0.9em;
    letter-spacing: 0.03em;
}

/* ── TOP ICONS ───────────────────────────────────────────────────── */
.topicon {
    height: 32px;
    vertical-align: text-bottom;
    /* filter: invert(0) opacity(0.7); */
}

/* ── TYPOGRAPHY ──────────────────────────────────────────────────── */
h3 {
    margin-bottom: 5px;
    color: var(--text-primary);
    font-weight: 600;
}

.list-overskrift {
    margin-top: 0;
    margin-bottom: 5px;
    color: var(--text-secondary);
    /* color: var(--accent-green); */
    font-size: 0.6em;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ── COUNTDOWN / PROGRESS ─────────────────────────────────────────── */
#countdown {
    box-sizing: border-box;
    padding: 10px 10px 10px 16px;
    margin: 0;
    font-size: smaller;
    width: 100%;
    background: var(--surface2);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

#progressbarBg {
    position: relative;
    flex-shrink: 0;
    width: 100%;
    height: 6px;
    background: var(--surface3);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
    border: none;
}

#progressbar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
    width: 0%;
    border-radius: 3px;
    animation: progress 10s linear forwards;
    box-shadow: 0 0 8px var(--accent-green);
}

@keyframes progress {
    from { width: 0; }
    to   { width: 100%; }
}

/* ── SCROLLING DESCRIPTION ────────────────────────────────────────── */
#description {
    --content-height: 0;
    --container-height: 0;
    transform: translateY(min(calc(1 * (var(--content-height)) * 1px), 0px));
    animation: mymove 10s 1;
    animation-timing-function: ease-in-out;
    color: var(--text-secondary);
    font-size: 0.95em;
    line-height: 1.7;
}

@keyframes mymove {
    0%   { transform: translateY(0); }
    100% { transform: translateY(min(calc(1 * (var(--content-height)) * 1px), 0px)); }
}

/* #descrbox {
    overflow: hidden;
    position: relative;

/* Standard property */
  /* mask-image: linear-gradient(to bottom, 
    transparent 0%, 
    black 10%, 
    black 90%, 
    transparent 100%
  ); */
  /* Webkit prefix for Chrome/Safari/Edge */
  /* -webkit-mask-image: linear-gradient(to bottom, 
    transparent 0%, 
    black 10%, 
    black 90%, 
    transparent 100%
  ); */

/* }  */

#descrbox {
    overflow: hidden;
    position: relative;

    /* 1. Older WebKit specific syntax (Most likely to work on Anthias) */
    -webkit-mask-image: -webkit-linear-gradient(top, 
        rgba(0,0,0,0) 0%, 
        rgba(0,0,0,1) 10%, 
        rgba(0,0,0,1) 90%, 
        rgba(0,0,0,0) 100%
    );

    /* 2. Modern WebKit syntax */
    -webkit-mask-image: linear-gradient(to bottom, 
        transparent 0%, 
        black 10%, 
        black 90%, 
        transparent 100%
    );

    /* 3. Force the mask to cover the whole area */
    -webkit-mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;

    /* Standard fallbacks */
    mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%);
    mask-size: 100% 100%;
}


/* ── EVENT IMAGES ─────────────────────────────────────────────────── */
.eventimage {
    min-height: 5vh;
    max-height: 10vh;
    margin-top: 4px;
    margin-bottom: 0;
    padding: 10px;
    border-radius: var(--radius-sm);
    /* opacity: 0.8; */
    
    /* This ensures the image doesn't stretch and respects its alpha */
    object-fit: contain; 
    
    /* Remove the solid background */
    background-color: transparent; 
    /* This creates a soft "halo" only around the visible parts of the image */
    /* filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8)) 
            drop-shadow(0 0 2px rgba(255, 255, 255, 1.0));
     */
/* This prevents the image from looking "milky" */
    image-rendering: -webkit-optimize-contrast;

     filter: 
        drop-shadow(0 0 1px rgba(0,0,0,0.5)) 
        drop-shadow(0 0 7px rgba(255,255,255,1.5));
}



/* ── EVENT LIST (SIDEBAR) ─────────────────────────────────────────── */
#event-list {
    font-size: larger;
    width: 27vw;
    height: 94vh;
    overflow-y: scroll;
    border-radius: var(--radius-lg);
    margin-left: 0;
    margin-right: 0;
    background-color: transparent;
    padding-bottom: 10px;
}

#event-list::-webkit-scrollbar {
    width: 4px;
    border-radius: 4px;
}
#event-list::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}
#event-list::-webkit-scrollbar-thumb {
    background: var(--surface3);
    border-radius: 4px;
}

/* ── EVENT ITEMS ─────────────────────────────────────────────────── */
.event-item {
    padding: 12px 14px;
    cursor: pointer;
    font-family: 'DM Sans', 'Titillium Web', sans-serif;
    font-weight: 400;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin: 12px 8px 0 10px;
    box-shadow: var(--shadow-card);
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
    position: relative;
    overflow: hidden;
}

/* subtle left accent line */
.event-item::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent-green);
    border-radius: 3px 0 0 3px;
    opacity: 0;
    transition: opacity var(--transition);
}

.event-item:hover {
    transform: translateX(3px);
    border-color: var(--border-hi);
}

.event-item:hover::before {
    opacity: 1;
}

/* Old/past items */
.event-item.old {
    color: var(--text-muted);
    border-color: rgba(255,255,255,0.03);
    opacity: 0.55;
}

/* Active/selected */
.event-item.active {
    background: linear-gradient(135deg, var(--job-active-from), var(--job-active-to));
    border-color: var(--border-hi);
    /* color: var(--text-primary); */
    color: var(--accent-green);
    box-shadow: 0 0 20px rgba(0,229,160,0.1), var(--shadow-card);
}

.event-item.active::before {
    opacity: 1;
}

/* Active job item */
.event-item.active.job-item {
    background: linear-gradient(135deg, #003d5c, #001f3a);
    border-color: rgba(79,140,255,0.3);
    box-shadow: 0 0 20px rgba(79,140,255,0.1), var(--shadow-card);
}

.event-item.active.job-item::before {
    background: var(--accent-blue);
}

/* Alternating inactive items */
.event-item:not(.active):nth-child(even) {
    background: var(--job-even);
    color: var(--text-secondary);
}

.event-item:not(.active):nth-child(odd) {
    background: var(--job-odd);
    color: var(--text-secondary);
}

/* Job-specific alternating */
.event-item:not(.active).job-item:nth-child(even) {
    background: #162130;
    color: var(--text-secondary);
}

.event-item:not(.active).job-item:nth-child(odd) {
    background: #1c2a3a;
    color: var(--text-secondary);
}

/* ── EVENT DETAILS (MAIN PANEL) ───────────────────────────────────── */
#event-details {
    width: 75vw;
    height: 97vh;
    padding: 28px 32px;
    margin-top: 8px;
    margin-left: 5px;
    margin-right: 20px;
    font-size: x-large;
    white-space: pre-wrap;
    overflow-y: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    opacity: 1;

    background: var(--surface);
    color: var(--text-secondary);
    box-shadow: var(--shadow-panel);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);

    transition: opacity 1.0s ease-in-out;
}

#event-details::-webkit-scrollbar { width: 4px; }
#event-details::-webkit-scrollbar-track { background: transparent; }
#event-details::-webkit-scrollbar-thumb {
    background: var(--surface3);
    border-radius: 4px;
}

#event-details.fade-out {
    opacity: 0;
}

/* ── QR CODES ─────────────────────────────────────────────────────── */
#qr-code {
    background: var(--surface2);
    color: var(--text-secondary);
    position: absolute;
    top: 20px;
    right: 10px;
    width: 160px;
    height: 170px;
    font-size: x-small;
    text-align: center;
    z-index: 1000;
    box-shadow: var(--shadow-panel);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 8px;
}

#qrcode {
    background: var(--surface2);
    position: absolute;
    color: var(--text-secondary);
    bottom: 20px;
    right: 10px;
    width: 155px;
    height: 175px;
    font-size:small;
    text-align: center;
    z-index: 999;
    box-shadow: var(--shadow-panel);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 8px;
}

/* ── NO EVENTS OVERLAY ────────────────────────────────────────────── */
#no-events {
    display: none;
    background: rgba(18, 24, 41, 0.92);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    position: absolute;
    color: var(--text-secondary);
    bottom: 30vh;
    right: 5vw;
    width: 90vw;
    height: 30vh;
    font-size: 60px;
    text-align: center;
    line-height: 30vh;
    margin: auto;
    z-index: 999;
    box-shadow: var(--shadow-panel);
}

/* ── LINKS ────────────────────────────────────────────────────────── */
.indesclink {
    color: var(--accent-green);
    text-decoration: none;
    border-bottom: 1px solid rgba(0,229,160,0.3);
    transition: border-color var(--transition), color var(--transition);
}

.indesclink:hover {
    color: #fff;
    border-color: var(--accent-green);
}

.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--surface2);
    border: 1px solid var(--border);
    font-size: 0.8em;
    font-weight: 500;
    margin: 0 4px;
}

.stat-chip.programming { color: var(--accent-blue); }
.stat-chip.infra       { color: #a78bfa; }
.stat-chip.support     { color: var(--accent-green); }
.stat-chip.cyber       { color: var(--accent-red); }
.stat-chip.programming .topicon { filter: invert(55%) sepia(80%) saturate(500%) hue-rotate(190deg); }
.stat-chip.infra       .topicon { filter: invert(55%) sepia(80%) saturate(500%) hue-rotate(220deg); }
.stat-chip.support     .topicon { filter: invert(55%) sepia(80%) saturate(600%) hue-rotate(115deg); }
.stat-chip.cyber       .topicon { filter: invert(55%) sepia(80%) saturate(600%) hue-rotate(320deg); }