/* ── Liquid Glass Theme — Visual styles only ──
   Structural layout is in /static/chat/base.css.
   This file contains ONLY colors, backgrounds, borders, shadows, and liquid glass effects.
*/


/* ── Theme Variables ── */
:root {
  --primary-blue: #123a5a;
  --primary-hover: #0f2f49;
  --secondary-blue: #2b78c5;
  --accent-light: #eaf4ff;
  --surface-bg: #ffffff;
  --subtle-bg: #f6fafe;
  --text-primary: #0b1f2a;
  --text-secondary: #4b5b66;
  --border-color: #dde7f0;
  --success-green: #1f8a5b;
  --warning-yellow: #d99a1a;
  --error-red: #d64545;
  --info-blue: #2b78c5;

  --header-height: 4.775rem;
  --tab-height: 3.125rem;
  --input-area-height: 5rem;
  --border-radius: 25px;
  --font-family: "Vazirmatn", sans-serif;
}


/* ── Body ── */
body {
  font-family: var(--font-family);
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--surface-bg) 60%);
  background-attachment: fixed;
}


/* ── Header ── */
header {
  color: var(--surface-bg);
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  padding: 0 20px;
  z-index: 100;
  flex-shrink: 0;
  position: fixed;
  font-weight: 600;
  background: #00000000;
  justify-content: space-between;
}

.the-slogan { line-height: 25px; }

.logo-container {
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: start;
  gap: 12px;
}

.the-logo {
  width: 45px; height: 45px;
  display: flex; justify-content: center; align-items: center;
  flex: 1; flex-direction: column;
  background: #fff; border-radius: 50%;
  overflow: hidden;
}

.logo-container img { width: 45px; height: 45px; object-fit: contain; }

.header-title {
  font-size: 1.2rem; font-weight: bold;
  color: #fff; text-shadow: 1px 1px #000;
}

.header-subtitle {
  font-size: 16px; opacity: 0.5; font-weight: 900;
  text-shadow: 1px 1px #000;
  text-transform: uppercase; letter-spacing: 12.5px;
}

/* Header liquid glass layers */
header > .liquidGlass-effect {
  position: absolute; z-index: 0; inset: 0;
  backdrop-filter: blur(3px) saturate(180%);
  -webkit-backdrop-filter: blur(3px) saturate(180%);
  overflow: hidden;
}
header > .liquidGlass-tint { z-index: 1; position: absolute; inset: 0; }
header > .liquidGlass-shine { position: absolute; inset: 0; z-index: 2; overflow: hidden; }
header > .liquidGlass-text {
  z-index: 3; display: flex; flex-direction: row;
  align-items: center; width: 100%; gap: 0;
}


/* ── Liquid Glass Components ── */
.liquidGlass-effect {
  position: absolute; z-index: 0; inset: 0;
  backdrop-filter: blur(3px) saturate(180%);
  overflow: hidden; border-radius: inherit;
}

.liquidGlass-shine {
  position: absolute; inset: 0; border-radius: inherit;
  z-index: 2; overflow: hidden; border-radius: 25px;
  box-shadow: inset 2px 2px 1px 0 rgba(255,255,255,0.5),
             inset -1px -1px 1px 1px rgba(255,255,255,0.5);
}

.liquidGlass-text { position: relative; z-index: 3; }

.action-btn > .liquidGlass-tint {
  z-index: 1; position: absolute; inset: 0;
  border-radius: 25px; background: rgba(255,255,255,0.3);
  transition: background 0.3s ease;
}


/* ── Accessibility Controls ── */
.a11y-hamburger {
  width: 2.7rem; height: 2.7rem;
  position: relative; overflow: hidden;
  background: none; border: none;
  color: #fff; cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 25px !important;
  border: 2px solid transparent;
  z-index: 110;
}
.a11y-hamburger .liquidGlass-shine { background: transparent; }
.a11y-hamburger .liquidGlass-text { display: flex; justify-content: center; align-items: center; }

.a11y-dropdown-content {
  display: flex; flex-direction: column;
  gap: 10px; padding: 12px; border-radius: 16px;
  position: relative; overflow: hidden;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(30,30,30,0.6);
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.05);
}

.a11y-btn {
  width: 2.7rem; height: 2.7rem;
  position: relative; overflow: hidden;
  background: none; border: none;
  color: #fff; font-family: var(--font-family);
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all 0.3s ease;
  border-radius: 25px !important;
  overflow: hidden; border: 2px solid transparent;
}
.a11y-btn .liquidGlass-shine { background: transparent; }
.a11y-btn .liquidGlass-text { display: flex; justify-content: center; }

button:hover {
  background: #ffffffa3; color: #333;
  transform: scale(1.05);
}


/* ── Liquid Glass Switcher ── */
.switcher {
  display: flex; align-items: center; gap: 0;
  width: 100%; max-width: 420px; height: 58px;
  box-sizing: border-box;
  padding: 6px 8px 8px;
  border: none; border-radius: 99em;
  background: #bbbbbc1f;
  backdrop-filter: blur(8px) url(#switcher) saturate(150%);
  -webkit-backdrop-filter: blur(8px) saturate(150%);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, #fff 10%, transparent),
    inset 1.8px 3px 0px -2px color-mix(in srgb, #fff 90%, transparent),
    inset -2px -2px 0px -2px color-mix(in srgb, #fff 80%, transparent),
    inset -3px -8px 1px -6px color-mix(in srgb, #fff 60%, transparent),
    inset -0.3px -1px 4px 0px color-mix(in srgb, #000 12%, transparent),
    inset -1.5px 2.5px 0px -2px color-mix(in srgb, #000 20%, transparent),
    inset 0px 3px 4px -2px color-mix(in srgb, #000 20%, transparent),
    inset 2px -6.5px 1px -4px color-mix(in srgb, #000 10%, transparent),
    0px 1px 5px 0px color-mix(in srgb, #000 10%, transparent),
    0px 6px 16px 0px color-mix(in srgb, #000 8%, transparent);
  z-index: 99; flex-shrink: 0; align-self: center;
}

.switcher__legend {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; border: 0; padding: 0;
  white-space: nowrap; clip-path: inset(100%);
  clip: rect(0 0 0 0); overflow: hidden;
}

.switcher__input {
  clip: rect(0 0 0 0); clip-path: inset(100%);
  height: 1px; width: 1px; overflow: hidden;
  position: absolute; white-space: nowrap;
}

.switcher__icon {
  display: block; width: 100%;
  transition: scale 200ms cubic-bezier(0.5,0,0,1);
}

.switcher__filter { position: absolute; width: 0; height: 0; z-index: -1; }

.switcher__option {
  display: flex; justify-content: center; align-items: center;
  padding: 0 14px; width: 208px; height: 48px;
  box-sizing: border-box; border-radius: 99em;
  opacity: 1; transition: all 160ms; gap: 8px;
}

.switcher__option:hover { --c: var(--secondary-blue); cursor: pointer; }
.switcher__option:hover .switcher__icon { scale: 1.2; }
.switcher__option:has(input:checked) { --c: var(--text-primary); cursor: auto; }
.switcher__option:has(input:checked) .switcher__icon { scale: 1; }

.switcher::after {
  content: ""; position: absolute;
  left: 5px; top: 5px;
  display: block; width: 210px; height: calc(100% - 10px);
  border-radius: 99em; background: #ffffff30;
  z-index: -1;
  -webkit-backdrop-filter: blur(3px) saturate(180%);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, #fff 10%, transparent),
    inset 2px 1px 0px -1px color-mix(in srgb, #fff 90%, transparent),
    inset -1.5px -1px 0px -1px color-mix(in srgb, #fff 80%, transparent),
    inset -2px -6px 1px -5px color-mix(in srgb, #fff 60%, transparent),
    inset -1px 2px 3px -1px color-mix(in srgb, #000 20%, transparent),
    inset 0px -4px 1px -2px color-mix(in srgb, #000 10%, transparent),
    0px 3px 6px 0px color-mix(in srgb, #000 8%, transparent);
}

.switcher:has(input[c-option="1"]:checked)::after {
  translate: 0 0; transform-origin: right;
  transition: translate 400ms cubic-bezier(1,0,0.4,1);
  animation: scaleToggle 440ms ease;
}
.switcher:has(input[c-option="2"]:checked)::after {
  translate: 100% 0 !important; transform-origin: left;
  transition: translate 400ms cubic-bezier(1,0,0.4,1);
  animation: scaleToggle2 440ms ease;
}
.switcher[c-previous="1"]:has(input[c-option="2"]:checked)::after { transform-origin: left; }
.switcher[c-previous="1"]:has(input[c-option="2"]:checked) .switcher__option { text-shadow: 1px 1px #000; }

@keyframes scaleToggle { 0% { scale: 1 1; } 50% { scale: 1.1 1; } 100% { scale: 1 1; } }
@keyframes scaleToggle2 { 0% { scale: 1 1; } 50% { scale: 1.2 1; } 100% { scale: 1 1; } }


/* ── Messages ── */
.message .bubble {
  text-shadow: 1px 1px 1px #505050;
  color: #fff;
}

.message.bot .bubble {
  border-radius: var(--border-radius);
  border-bottom-right-radius: 0;
  box-shadow: inset 2px 2px 1px 0 rgba(255,255,255,0.5),
             inset -1px -1px 1px 1px rgba(255,255,255,0.5);
}

.message.user .liquidGlass-shine { border-bottom-left-radius: 0; }
.message.bot .liquidGlass-shine { border-bottom-right-radius: 0; }

.message.user .bubble {
  border-radius: var(--border-radius);
  border-bottom-left-radius: 0;
}

body:not(.video-mode) .message .liquidGlass-shine {
  box-shadow: none;
  border: 1px solid #484848;
}


/* ── Questions ── */
.questions-list li {
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: #000; text-shadow: none;
}
.questions-list li:hover {
  background: var(--secondary-blue);
  color: white; border-color: var(--secondary-blue);
}
.questions-list li::before { color: var(--secondary-blue); }
.questions-list li:hover::before { color: white; }

.show-more-btn {
  background: transparent;
  color: var(--secondary-blue);
  border: 1.5px dashed var(--secondary-blue);
  border-radius: 12px;
}
.show-more-btn:hover { background: var(--accent-light); border-style: solid; }


/* ── Video View ── */
#video-view { background-color: rgba(0,0,0,0.7); }

.action-btn {
  position: relative; overflow: hidden;
  background: none; border: none;
  color: white; padding: 12px 30px;
  font-family: var(--font-family);
  font-size: 18px; font-weight: 600;
  cursor: pointer; transition: all 0.3s ease;
  border-radius: 25px !important;
  border: 2px solid transparent;
}
.action-btn > div, .action-btn { border-radius: 60px !important; }
.action-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.action-btn:hover > .liquidGlass-tint { background: rgba(255,255,255,0.45); }


/* ── Input Area ── */
#input-area {
  background-color: transparent;
  padding: 0 20px;
}

.input-wrapper {
  position: relative; width: 100%; max-width: 800px;
  display: flex; align-items: center;
}

.input-glass {
  border-radius: 2rem; overflow: hidden;
  box-shadow: 0 6px 6px rgba(0,0,0,0.2), 0 0 20px rgba(0,0,0,0.1);
  transition: all 0.4s cubic-bezier(0.175,0.885,0.32,2.2);
}
.input-glass, .input-glass > div { border-radius: 27px; }
.input-glass .liquidGlass-tint {
  backdrop-filter: blur(3px) saturate(180%);
  -webkit-backdrop-filter: blur(3px) saturate(180%);
  filter: url(#glass-distortion); overflow: hidden;
}
.input-glass .liquidGlass-shine {
  box-shadow: inset 2px 2px 1px 0 rgba(255,255,255,0.5),
             inset -1px -1px 1px 1px rgba(255,255,255,0.5);
}

#user-input {
  width: 100%; min-height: 55px;
  max-height: calc(3 * 1.5em + 24px);
  padding: 12px 20px 12px 103px;
  border-radius: 20px; border: none;
  background-color: transparent;
  font-family: var(--font-family);
  font-size: 1rem; line-height: 1.5em;
  outline: none; resize: none; overflow-y: auto;
  position: relative; z-index: 3;
  transition: all 0.3s ease; color: #fff;
}
#user-input::placeholder { color: #fff !important; }

#send-btn {
  position: absolute; left: 9px; bottom: 9px;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background-color: var(--primary-blue); border: none;
  color: white; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s, background-color 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1); z-index: 10;
}
#send-btn:hover { background-color: var(--primary-hover); }
#send-btn:not(.stop-mode) svg { transform: rotate(180deg) translateX(2px); }

#send-btn.stop-mode {
  background: rgba(43,120,197,0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.mic-btn {
  position: absolute; left: 56px; bottom: 10px;
  width: 42px; height: 42px; border-radius: 50%;
  background-color: transparent; border: none;
  color: var(--primary-blue); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; z-index: 10; background: #ffffff;
}
.mic-btn:hover { background-color: rgba(18,58,90,0.1); }
.mic-btn.recording { background-color: var(--error-red); color: white; }

.dot { background-color: var(--primary-blue); }


/* ── Morph Transition ── */
.morph-transition {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(18,58,90,0.85); z-index: 100;
  animation: morphPixelate 0.8s ease-out forwards;
  backdrop-filter: blur(3px);
  display: flex; justify-content: center; align-items: center;
}
.morph-transition::before {
  content: ""; position: absolute; width: 100%; height: 100%;
  background: repeating-linear-gradient(45deg,
    rgba(255,255,255,0.1) 0px, rgba(255,255,255,0.1) 2px,
    transparent 2px, transparent 4px);
  animation: morphMove 1.5s linear infinite;
}
@keyframes morphPixelate {
  0%   { opacity: 0; filter: blur(0px); transform: scale(1); }
  40%  { opacity: 1; filter: blur(10px); transform: scale(1.05); }
  100% { opacity: 0; filter: blur(0px); transform: scale(1); }
}
@keyframes morphMove {
  0%   { background-position: 0 0; }
  100% { background-position: 28px 28px; }
}


/* ── Layout Overrides ── */
div#text-view { width: 858px; margin: 0 auto 0; padding: 0; }

body:not(.video-mode) .app-layout { background: #1d1d1d; }


/* ── Mobile ── */
@media (max-width: 1280px) {
  .switcher { max-width: 320px; }
  .switcher__option span { display: none; }
  .switcher__option { width: 50%; }
  .switcher::after { left: 2px; top: 5px; width: calc(52% - 12px); }
}

@media (max-width: 768px) {
  :root {
    --header-height: 3.75rem;
    --tab-height: 2.8rem;
    --input-area-height: 4.375rem;
  }
  header { padding: 10px; }

  .app-layout header > .liquidGlass-text {
    display: flex; flex: 1;
    flex-direction: row; justify-content: space-between;
  }
  body.video-mode .app-layout { max-width: 100%; width: 100%; height: 100%; border-radius: 0; border: none; }

  .switcher, .switcher__option { flex: 1; height: 45px; }
  .switcher::after { height: calc(100% - 10px); top: 2px; }
  div#text-view { max-width: 96%; }
  .switcher__filter { display: none; }
  .switcher { max-width: 70%; }

  .action-btn { padding: 11px 20px; font-size: 16px; }
  #user-input { min-height: 45px; font-size: 16px; padding-left: 50px; }
}

@media (max-width: 690px) {
  .switcher::after { left: 7px; top: 3px; height: calc(100% - 7px) !important; width: calc(52% - 11px); }
}

@media (min-width: 769px) {
  .app-layout {
    background-color: rgba(255,255,255,0.95);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  }
  #video-view { border-radius: 0; background-color: #000; }
  #avatar-video { border-radius: 0; object-position: center 20%; }
  #input-area {
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
  }
}


/* ── High Contrast Mode ── */
body.high-contrast {
  --primary-blue: #000000; --primary-hover: #333333;
  --secondary-blue: #ffffff; --accent-light: #000000;
  --surface-bg: #222; --subtle-bg: #ffffff;
  --text-primary: #000000; --text-secondary: #000000;
  --border-color: #000000;
  --success-green: #000000; --warning-yellow: #000000;
  --error-red: #000000; --info-blue: #000000;
  background: #44444444;
}

body.high-contrast * { color: #fff !important; }

body.high-contrast .message.bot .bubble {
  background-color: #303030; border: 2px solid #000000;
  color: #e1e2e3 !important; border-bottom-right-radius: 0;
}

body.high-contrast .message.user .bubble {
  background-color: #181818; color: #fff; border: 2px solid #000;
}

body.high-contrast svg { color: #e1e2e3 !important; }

body.high-contrast header { color: #fff; gap: 11px; }

body.high-contrast .switcher {
  background: #0000008a; border: 2px solid #000;
  box-shadow: 0 0 0 1px #000, 0 1px 3px 0 rgba(255,255,255,0.15),
    0 -2px 4px 0 rgba(0,0,0,0.4) inset, 0 1px 5px 0 rgba(0,0,0,0.05) inset;
}
body.high-contrast .switcher__option { --c: #000; }
body.high-contrast .switcher__option:has(input:checked) { --c: #fff; }
.high-contrast .switcher::after {
  background: linear-gradient(0deg, #151515 0%, #252525 92.05%);
  box-shadow: 0 1px 1px 0 rgba(255,255,255,0.15) inset,
    0 4px 6px -2px rgba(0,0,0,0.4), 0 2px 2px -1px rgba(10,13,18,0.4), 0 0 0 1px #000;
}
.high-contrast .switcher::after { height: calc(100% - 6px); }

body.high-contrast .a11y-dropdown-content {
  background: linear-gradient(0deg, #151515 0%, #252525 92.05%);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6),
    0 1px 1px 0 rgba(255,255,255,0.15) inset, 0 0 0 1px #000;
}

body.high-contrast .a11y-btn {
  background: linear-gradient(0deg, #151515 0%, #252525 92.05%);
  box-shadow: 0 1px 1px 0 rgba(255,255,255,0.15) inset,
    0 4px 6px -2px rgba(0,0,0,0.4), 0 2px 2px -1px rgba(10,13,18,0.4), 0 0 0 1px #000;
}

.high-contrast button:hover {
  background: linear-gradient(0deg, #151515 0%, #252525 92.05%);
  color: #333; transform: scale(1.05);
}

body.high-contrast .action-btn { color: #fff; border: 2px solid #000; background: #000000a3; }
body.high-contrast .action-btn > .liquidGlass-tint { background: rgba(0,0,0,0.9); }
body.high-contrast .action-btn:hover > .liquidGlass-tint { background: rgba(255,255,255,0.9); }
body.high-contrast .action-btn:hover { color: #000; }

body.high-contrast #send-btn {
  background: linear-gradient(0deg, #151515 0%, #252525 92.05%);
  box-shadow: 0 1px 1px 0 rgba(255,255,255,0.15) inset,
    0 4px 6px -2px rgba(0,0,0,0.4), 0 2px 2px -1px rgba(10,13,18,0.4), 0 0 0 1px #000;
}
body.high-contrast #send-btn svg path { fill: #fff; }

.high-contrast #user-input {
  background: #000000a3;
  box-shadow: 0 0 0 1px #000, 0 1px 3px 0 rgba(255,255,255,0.15),
    0 -2px 4px 0 rgba(0,0,0,0.4) inset, 0 1px 5px 0 rgba(0,0,0,0.05) inset;
  color: #e1e2e3;
}
.high-contrast #user-input::placeholder { color: #e1e2e3; }

.high-contrast .mic-btn {
  background: linear-gradient(0deg, #151515 0%, #252525 92.05%);
  box-shadow: 0 1px 1px 0 rgba(255,255,255,0.15) inset,
    0 4px 6px -2px rgba(0,0,0,0.4), 0 2px 2px -1px rgba(10,13,18,0.4), 0 0 0 1px #000;
}

.high-contrast .questions-list li:hover { background: #0a0a0a; border-color: #989898; }
