:root {
  --background-dark: #0A0A0A;
  --surface-dark: #141414;
  --text-primary: #EDEDED;
  --text-secondary: #888888;
  --border-color: rgba(255, 255, 255, 0.08);

  --bg-blur: 0px;
  --bg-brightness: 1.0;
}
#start-chat-btn svg {
  transform: rotate(180deg);
}

/* --- Generell Styling --- */
* { box-sizing: border-box; }
html { height: 100%; }
body {
  font-family: 'Brooklyn', sans-serif;
  color: var(--text-primary);
  margin: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  overflow: hidden;
  background-color: #000;
  position: relative; 
}

/* ==========================================================================
   BAKGRUNNS-MOTOR
   ========================================================================== */

#background-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  filter: blur(var(--bg-blur)) brightness(var(--bg-brightness));
  transition: filter 0.8s ease, transform 0.8s ease;
}

#intro-glitch-video, .mode-background-video {
  position: absolute;
  top: 50%; left: 50%;
  min-width: 100%; min-height: 100%;
  width: auto; height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  transition: opacity 1.5s ease-in-out;
}

#main-static-background {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image: url('assets/img/bakgrunn.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

#main-static-background.active {
  opacity: 1;
}

#intro-glitch-video.hidden {
  opacity: 0;
  pointer-events: none;
}

.mode-background-video {
  opacity: 0;
}
.mode-background-video.active {
  opacity: 1;
}


/* --- Diverse Overlegg --- */
#background-overlay {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1; 
  background-color: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  transition: all 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}
body.chat-active #background-overlay {
  background-color: rgba(0, 0, 0, 0.4); 
  backdrop-filter: blur(12px);
}
#video-overlay-container {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 150;
    pointer-events: none;
}
#video-overlay-container video {
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0;
}


/* ==========================================================================
   LANDINGSSIDE & HOVED-APP
   ========================================================================== */

#landing-screen { position: relative; z-index: 10; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: opacity 0.5s ease-out; }
#landing-logo { width: 90%; max-width: 600px; height: auto; opacity: 0; filter: drop-shadow(0 0 15px rgba(74, 239, 254, 0.3)); animation: dramatic-glitch-in 2s cubic-bezier(0.165, 0.84, 0.44, 1) forwards; animation-play-state: paused; }
#logline { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); font-family: 'JetBrains Mono', monospace; margin: 20px 0 0 0; opacity: 0; transition: opacity 0.5s ease; text-shadow: 0 0 5px rgba(0,0,0,0.5); }
#start-chat-btn { background: transparent; border: none; color: var(--text-primary); font-family: 'Brooklyn'; cursor: pointer; margin-top: 40px; display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: 0; transition: opacity 0.5s ease; animation: bounce 2s infinite ease-in-out; animation-play-state: paused; filter: drop-shadow(0 2px 10px rgba(0,0,0,0.4)); }
#content-column { width: 100%; max-width: 1300px; height: 100%; background: rgba(0, 0, 0, 0.2); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-left: 1px solid var(--border-color); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; align-items: center; opacity: 0; transform: translateY(20px) scale(0.98); transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1); pointer-events: none; position: absolute; z-index: 2; }
.content-inner { width: 100%; max-width: 1100px; height: 100%; display: flex; flex-direction: column; }
#main-header { width: 100%; padding: 15px 30px; flex-shrink: 0; text-align: center; position: relative; height: 64px; }
#header-logo { height: 34px; width: auto; position: absolute; top: 15px; left: 50%; transform: translateX(-50%); opacity: 0; transition: opacity 0.4s ease; }
#chatbox-wrapper { width: 100%; flex-grow: 1; position: relative; overflow: hidden; min-height: 0; }
#chatbox { height: 100%; overflow-y: auto; padding: 10px 24px 24px 24px; display: flex; flex-direction: column; gap: 24px; }
#chatbox::-webkit-scrollbar { width: 4px; }
#chatbox::-webkit-scrollbar-track { background: transparent; }
#chatbox::-webkit-scrollbar-thumb { background: #222; border-radius: 2px; }
.msg { display: flex; align-items: flex-start; gap: 12px; max-width: 85%; }
.avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; background-size: cover; background-position: center; }
.msg-content { background-color: rgba(248, 248, 248, 0.1); padding: 12px 16px; border-radius: 12px; line-height: 1.7; word-break: break-word; color: var(--text-primary); font-size: 1rem; }
.msg-content p { margin: 0 0 16px 0; }
.msg-content p:last-child { margin-bottom: 0; }
.user { align-self: flex-end; flex-direction: row-reverse; }
.user .avatar { background-image: url('assets/img/user-ikon.png'); }
.user .msg-content { background-color: rgba(70, 115, 170, 0.5); }
.bot { align-self: flex-start; }
.bot .avatar { background-image: url('assets/img/gpt-ikon.png'); }
#input-wrapper { width: 100%; padding: 20px 30px 30px 30px; flex-shrink: 0; z-index: 20; }
#prompt-suggestions { display: flex; gap: 8px; margin-bottom: 12px; justify-content: center; flex-wrap: wrap; }
.prompt-btn { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-color); color: var(--text-secondary); padding: 6px 12px; border-radius: 99px; cursor: pointer; font-size: 0.9rem; transition: all 0.2s ease; }
.prompt-btn:hover { background: rgba(255, 255, 255, 0.1); color: var(--text-primary); }
#chat-form { display: flex; gap: 12px; background: rgba(20, 20, 20, 0.5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 16px; padding: 12px; border: 1px solid var(--border-color); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); }
.form-controls-wrapper { display: flex; flex-direction: column; gap: 8px; }
.textarea-wrapper { flex-grow: 1; display: flex; }
#vic-level-container { position: relative; }
#vic-level { appearance: none; -webkit-appearance: none; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); color: var(--text-primary); border-radius: 8px; padding: 8px 32px 8px 15px; font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; cursor: pointer; transition: all 0.2s ease; }
#vic-level-container::after { content: '▼'; font-size: 10px; position: absolute; top: 50%; right: 12px; transform: translateY(-50%); color: var(--text-secondary); pointer-events: none; }
#userInput { flex: 1; font-size: 1rem; border: none; background: transparent; color: var(--text-primary); outline: none; padding: 8px; resize: none; min-height: 50px; max-height: 200px; line-height: 1.5; }
#sendBtn { align-self: flex-end; padding: 8px; border: none; background-color: rgba(255, 255, 255, 0.1); color: var(--text-secondary); cursor: pointer; border-radius: 8px; display: flex; transition: all 0.2s ease; }
#sendBtn:hover { background: #4aeffe; color: black; }
#sendBtn svg { width: 20px; height: 20px; }


/* ==========================================================================
   AKTIV CHAT-MODUS & GRUNN-ANIMASJONER
   ========================================================================== */
body.chat-active #landing-screen { opacity: 0; pointer-events: none; }
body.chat-active #scroll-effect { animation: fake-scroll 0.8s cubic-bezier(0.7, 0, 0.3, 1) forwards; }
body.chat-active #content-column { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
body.chat-active #header-logo { opacity: 1; }
.thinking-container { display: flex; align-items: center; gap: 10px; animation: thinking-fade-in 0.3s ease; }
.thinking-container p { margin: 0; font-style: italic; color: var(--text-secondary); }
.thinking-indicator { display: flex; align-items: center; padding: 6px 0; flex-shrink: 0; }
.thinking-indicator span { height: 8px; width: 8px; margin: 0 2px; background-color: var(--text-secondary); border-radius: 50%; animation: bounce-dot 1.4s infinite ease-in-out both; }
.thinking-indicator span:nth-child(2) { animation-delay: 0.2s; }
.thinking-indicator span:nth-child(3) { animation-delay: 0.4s; }
.reveal-animation { animation: reveal-bubble 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; }

/* ==========================================================================
   FLYTENDE ELEMENTER & INFO-PANEL
   ========================================================================== */
#sticker { position: fixed; bottom: 20px; right: 20px; width: 300px; height: auto; z-index: 100; cursor: grab; user-select: none; opacity: 1; transition: opacity 0.5s ease, transform 0.2s ease; }
#sticker:active { cursor: grabbing; transform: scale(1.1); }
body.chat-active #sticker { opacity: 0; pointer-events: none; }
#version-box { position: fixed; bottom: 15px; left: 15px; z-index: 100; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; background: rgba(10, 10, 10, 0.4); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 10px; border-radius: 8px; border: 1px solid var(--border-color); }
#version-box span { color: var(--text-secondary); font-size: 0.9rem; padding: 0 2px; }
.version-box-buttons { display: flex; gap: 8px; }
.info-style-btn { background: none; border: 1px solid var(--text-secondary); color: var(--text-secondary); padding: 2px 8px; font-size: 0.75rem; font-family: 'Brooklyn', sans-serif; border-radius: 4px; cursor: pointer; transition: all 0.2s ease; }
.info-style-btn:hover { background: var(--text-secondary); color: var(--background-dark); }
#info-panel { position: fixed; bottom: 15px; left: 200px; z-index: 100; width: 100%; max-width: 400px; background: #141414; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 20px; border-radius: 12px; border: 1px solid var(--border-color); box-shadow: 0 5px 20px rgba(0,0,0,0.3); opacity: 1; transform: translateY(0); transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
#info-panel.hidden { opacity: 0; transform: translateY(20px); pointer-events: none; }
#info-panel-close-btn { position: absolute; top: 8px; right: 8px; background: none; border: none; font-size: 1.5rem; color: var(--text-secondary); cursor: pointer; line-height: 1; }
#info-panel h2 { margin-top: 0; }
#info-panel p { line-height: 1.6; color: var(--text-secondary); font-size: 0.9rem; }
#info-panel p:last-child { margin-bottom: 0; }
#info-panel strong { color: var(--text-primary); }


/* ==========================================================================
   MODUS-SPESIFIKK STYLING & ANIMASJONER
   ========================================================================== */

/* --- Dritings Vic™ --- */
body.theme-dritings #background-container { filter: blur(4px) brightness(0.7); transform: scale(1.03); }
#content-column.double-vision-active { animation: double-vision 1.5s ease-in-out forwards; }
.msg.dritings-drift { animation: drift-up-down 8s ease-in-out infinite; } 

/* --- Nattmodus --- */
#spotlight-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; background: radial-gradient(circle at center, rgba(0,0,0,0.2) 30%, rgba(0,0,0,0.95) 85%); opacity: 0; pointer-events: none; transition: opacity 3s ease-in-out; }
body.theme-latenight #spotlight-overlay { opacity: 1; } 

/* --- Rollo Modus --- */
body.theme-rollo_modus #background-overlay { background: rgba(10, 20, 40, 0.2); backdrop-filter: blur(2px) sepia(0.3); } 

/* --- Disco Modus --- */
#disco-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 150; pointer-events: none; opacity: 0; background: hsla(0, 100%, 50%, 0.2); }
#disco-overlay.active { opacity: 1; animation: disco-lights 4s linear infinite; }
.msg.disco-mode .msg-content { animation: disco-lights 4s linear infinite; } 

/* --- Fergemodus --- */
.msg.ferge-mode .msg-content {
    filter: sepia(0.3);
    border: 1px solid rgba(212, 198, 179, 0.2);
    animation: slow-fade-in 1s ease;
}

/* --- Snarky/Banning Modus --- */
#content-column.snarky-shake { animation: shake-window 0.4s cubic-bezier(.36,.07,.19,.97) both; } 

/* --- Manisk Vic Modus --- */
.msg.manic-mode-active .msg-content { 
    animation: pulse-glow 1.5s infinite alternate; 
    border: 2px solid;
}
.msg.manic-mode-active p { 
    animation: text-shake 0.82s cubic-bezier(.36,.07,.19,.97) both infinite; 
    display: inline-block;
}

/* --- Tenke-boble former --- */
.thinking-indicator {
    transition: all 0.4s ease;
}
.thinking-container.rollo .thinking-indicator {
    width: 28px;
    height: 28px;
    background-color: var(--text-secondary);
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 3h1v18H4zM6 16h11.31l-3.35-3.35L17.5 9H6zm1.7-6.7l2.8 2.8L13.31 9H7.7z"/></svg>');
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M4 3h1v18H4zM6 16h11.31l-3.35-3.35L17.5 9H6zm1.7-6.7l2.8 2.8L13.31 9H7.7z"/></svg>');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    animation: none;
}
.thinking-container.rollo .thinking-indicator span { display: none; }

.thinking-container.attentin .thinking-indicator {
    width: 14px;
    height: 28px;
    background-color: #ff4d4d;
    border-radius: 14px 14px 0 0;
    position: relative;
    animation: shake-pill 0.3s infinite;
}
.thinking-container.attentin .thinking-indicator::after {
    content: '';
    position: absolute;
    bottom: -14px; left: 0;
    width: 14px; height: 14px;
    background-color: #fff;
    border-radius: 0 0 14px 14px;
}
.thinking-container.attentin .thinking-indicator span { display: none; }

.thinking-container.vicmani .thinking-indicator {
    animation: bounce-bubble 0.8s infinite ease-in-out, bounce-dot 1.4s infinite ease-in-out both;
}
/* I style.css (legg til på slutten) */
.form-controls-wrapper {
    display: flex;
    align-items: center; /* Sørger for at alt står på linje */
    gap: 8px;
}
.svg-container {
    background-color: #fff;
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.svg-container svg {
    width: 100%;
    height: auto;
    display: block;
}

.mode-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 8px 15px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 37px; /* Samme høyde som select-boksen */
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   KEYFRAMES OG RESPONSIVITET
   ========================================================================== */
@keyframes dramatic-glitch-in { 0% { transform: scale(0.6); opacity: 0; filter: blur(10px) drop-shadow(0 0 5px rgba(74, 239, 254, 0.1)); } 50% { opacity: 1; transform: scale(1.0) translate(-2px, 2px); filter: blur(0) drop-shadow(0 0 25px rgba(74, 239, 254, 0.5)); } 60% { transform: scale(1.0) translate(2px, -2px); } 70% { transform: scale(1.0) translate(0, 0); } 100% { transform: scale(1); opacity: 1; filter: blur(0) drop-shadow(0 0 15px rgba(74, 239, 254, 0.3)); } }
@keyframes blink-caret { from, to { color: transparent; } 50% { color: var(--text-primary); } }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } 60% { transform: translateY(-5px); } }
@keyframes fake-scroll { from { top: 100%; } to { top: -100%; } }
@keyframes thinking-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes bounce-dot { 0%, 80%, 100% { transform: scale(0.5); opacity: 0.5; } 40% { transform: scale(1.0); opacity: 1; } }
@keyframes reveal-bubble { from { opacity: 0; transform: translateY(15px) scale(0.9); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes double-vision { 0% { transform: translate(0, 0) scale(1); filter: blur(0); } 25% { transform: translate(-10px, 2px) scale(1.01); filter: blur(1px); } 50% { transform: translate(10px, -2px) scale(1.01); filter: blur(1px); } 100% { transform: translate(0, 0) scale(1); filter: blur(0); } }
@keyframes disco-lights { 0% { background-color: hsla(0, 100%, 50%, 0.2); border-color: hsla(0, 100%, 50%, 0.8); } 25% { background-color: hsla(90, 100%, 50%, 0.2); border-color: hsla(90, 100%, 50%, 0.8); } 50% { background-color: hsla(180, 100%, 50%, 0.2); border-color: hsla(180, 100%, 50%, 0.8); } 75% { background-color: hsla(270, 100%, 50%, 0.2); border-color: hsla(270, 100%, 50%, 0.8); } 100% { background-color: hsla(360, 100%, 50%, 0.2); border-color: hsla(360, 100%, 50%, 0.8); } }
@keyframes shake-window { 10%, 90% { transform: translate3d(-1px, 0, 0) scale(1); } 20%, 80% { transform: translate3d(2px, 0, 0) scale(1); } 30%, 50%, 70% { transform: translate3d(-3px, 0, 0) scale(1); } 40%, 60% { transform: translate3d(3px, 0, 0) scale(1); } }
@keyframes pulse-glow { from { box-shadow: 0 0 10px #ff00c1, 0 0 20px #ff00c1, 0 0 30px #ff00c1; border-color: #ff00c1; } to   { box-shadow: 0 0 20px #00f6ff, 0 0 30px #00f6ff, 0 0 40px #00f6ff; border-color: #00f6ff; } }
@keyframes text-shake { 10%, 90% { transform: translate3d(-0.5px, 0, 0); } 20%, 80% { transform: translate3d(1px, 0, 0); } 30%, 50%, 70% { transform: translate3d(-1.5px, 0, 0); } 40%, 60% { transform: translate3d(1.5px, 0, 0); } }
@keyframes drift-up-down { 0%, 100% { transform: translateY(0); } 25% { transform: translateY(-8px) rotate(-0.5deg); } 75% { transform: translateY(8px) rotate(0.5deg); } }
@keyframes slow-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes shake-pill { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-2px) rotate(-3deg); } 75% { transform: translateX(2px) rotate(3deg); } }
@keyframes bounce-bubble { 0%, 100% { transform: translateY(0); animation-timing-function: ease-out; } 50% { transform: translateY(-10px); animation-timing-function: ease-in; } }

@media (max-width: 768px) {
  #sticker, #version-box, #info-panel { display: none; }
  #main-header { padding: 15px 15px; }
  #chatbox { padding: 10px 15px 15px 15px; gap: 18px; }
  #input-wrapper { padding: 15px; }
  #chat-form { flex-direction: column; }
  .textarea-wrapper { width: 100%; }
  .msg { max-width: 90%; }
  .msg-content { font-size: 0.95rem; }
  #prompt-suggestions { margin-bottom: 10px; }
  .prompt-btn { padding: 5px 10px; font-size: 0.8rem; }
  #userInput { min-height: 40px; font-size: 0.95rem; }
}