
/* =====================================================
   TINVIN AI — FULL SCREEN CRYSTAL GLASS REDESIGN
   New layout • Large glass workspace • Responsive
   Visual only — Keep existing JavaScript functionality
===================================================== */

:root {
  --bg: #070a18;
  --panel: rgba(17, 25, 49, .68);
  --glass: rgba(24, 34, 66, .52);
  --glass-strong: rgba(29, 41, 78, .78);
  --border: rgba(145, 175, 255, .19);
  --border-light: rgba(255, 255, 255, .12);
  --text: #f4f6ff;
  --muted: #929dbb;
  --gold: #e9bd63;
  --blue: #55a8ff;
  --purple: #9565ff;
  --pink: #e16bda;
  --cyan: #54e0f5;
  --radius: 25px;
  --shadow: 0 25px 80px rgba(0, 0, 0, .35);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(ellipse at 12% 8%, rgba(64, 112, 255, .20), transparent 34%),
    radial-gradient(ellipse at 88% 18%, rgba(153, 76, 255, .18), transparent 35%),
    radial-gradient(ellipse at 50% 100%, rgba(30, 176, 220, .10), transparent 42%),
    #070a18;
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  isolation: isolate;
}

/* BACKGROUND LIGHT */

.app-shell::before,
.app-shell::after {
  content: "";
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .15;
  pointer-events: none;
  z-index: -1;
}

.app-shell::before {
  top: 10%;
  left: -190px;
  background: #386cff;
}

.app-shell::after {
  right: -190px;
  bottom: 0;
  background: #a34dff;
}

/* TOP BAR */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  min-height: 72px;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  background: rgba(8, 13, 30, .72);
  border-bottom: 1px solid rgba(160, 180, 255, .13);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.5px;
}

.brand-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, #398eff, #8058ef 60%, #d36bdb);
  box-shadow:
    0 0 24px rgba(95, 110, 255, .35),
    inset 0 1px 1px rgba(255,255,255,.4);
}

.menu-toggle {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: #eaf0ff;
  background: rgba(255,255,255,.055);
  cursor: pointer;
  transition: .25s ease;
}

.menu-toggle:hover {
  background: rgba(91, 140, 255, .18);
  border-color: rgba(110, 165, 255, .5);
}

.premium-top-btn {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(233, 189, 99, .4);
  border-radius: 14px;
  color: #ffe4a7;
  font-weight: 800;
  background: linear-gradient(135deg, rgba(233,189,99,.19), rgba(181,117,35,.09));
  box-shadow: 0 0 22px rgba(233,189,99,.09);
  cursor: pointer;
  transition: .25s ease;
}

.premium-top-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(233,189,99,.2);
}

/* SIDEBAR */

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(2, 5, 16, .65);
  backdrop-filter: blur(7px);
  opacity: 0;
  visibility: hidden;
  transition: .3s ease;
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar {
  position: fixed;
  z-index: 200;
  top: 12px;
  bottom: 12px;
  left: 12px;
  width: 285px;
  padding: 19px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border: 1px solid rgba(150, 175, 255, .22);
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(28, 40, 78, .94), rgba(12, 18, 39, .96));
  box-shadow: 0 25px 90px rgba(0,0,0,.5);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  transform: translateX(calc(-100% - 25px));
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
  overflow-y: auto;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--border);
  color: #fff;
  font-weight: 900;
}

#closeMenu {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: #fff;
  background: rgba(255,255,255,.06);
  cursor: pointer;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.menu-item {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #cbd5f2;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: .22s ease;
}

.menu-item:hover,
.menu-item.active {
  color: #fff;
  border-color: rgba(111, 151, 255, .25);
  background: linear-gradient(100deg, rgba(72,126,255,.19), rgba(154,91,255,.13));
  box-shadow: inset 3px 0 #7a8fff;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

/* REMOVE THE LARGE INTRO TEXT AREA */

#workspacePage > .hero {
  display: none !important;
}

#workspacePage > .footer {
  display: none !important;
}

/* MAIN WORKSPACE */

.page {
  display: none;
  width: 100%;
  min-height: calc(100vh - 72px);
}

.page.active {
  display: block;
}

#workspacePage {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 18px 25px 30px;
}

/* TOOL TABS */

.workspace-tabs {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 18px;
  padding: 7px;
  display: flex;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(145, 175, 255, .18);
  border-radius: 19px;
  background: rgba(20, 29, 56, .65);
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.workspace-tab {
  min-height: 43px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: #aebbdc;
  background: transparent;
  font-weight: 750;
  cursor: pointer;
  transition: .25s ease;
}

.workspace-tab:hover {
  color: #fff;
  background: rgba(255,255,255,.06);
}

.workspace-tab.active {
  color: #fff;
  border-color: rgba(133, 157, 255, .3);
  background: linear-gradient(120deg, rgba(56,143,255,.30), rgba(139,83,255,.28));
  box-shadow: 0 5px 22px rgba(90,110,255,.16);
}

/* LARGE GLASS PANELS */

.workspace-panel {
  width: 100%;
  min-width: 0;
  animation: glassEnter .35s ease both;
}

.workspace-panel[hidden] {
  display: none !important;
}

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

/* Hide repeated tool headings for a cleaner full-screen workspace */

.workspace-panel > .tool-heading {
  display: none !important;
}

/* CHAT — LARGE GLASS SCREEN */

#chatPage {
  width: 100%;
  min-width: 0;
}

#chatPage .chat-layout {
  width: 100% !important;
  max-width: 1200px !important;
  height: calc(100vh - 155px) !important;
  min-height: 510px !important;
  max-height: 1000px !important;
  margin: 0 auto !important;
  padding: 24px !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(133, 164, 255, .24) !important;
  border-radius: 30px !important;
  background:
    radial-gradient(ellipse at 5% 0%, rgba(58,139,255,.12), transparent 40%),
    radial-gradient(ellipse at 100% 100%, rgba(164,79,255,.13), transparent 42%),
    linear-gradient(145deg, rgba(24,35,68,.78), rgba(10,16,35,.84)) !important;
  box-shadow:
    0 25px 90px rgba(0,0,0,.30),
    inset 0 1px 1px rgba(255,255,255,.10),
    0 0 50px rgba(83,112,255,.06) !important;
  backdrop-filter: blur(32px) !important;
  -webkit-backdrop-filter: blur(32px) !important;
}

#chatPage .chat-history {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(121,143,255,.45) transparent;
}

#chatPage .chat-compose {
  flex-shrink: 0;
  border: 1px solid rgba(142,166,255,.28) !important;
  border-radius: 21px !important;
  background: rgba(7,13,30,.76) !important;
  box-shadow:
    0 12px 35px rgba(0,0,0,.23),
    inset 0 1px rgba(255,255,255,.08) !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

#chatPage #chatInput {
  color: #fff;
  background: transparent;
}

#chatPage #chatInput::placeholder {
  color: #8795b8;
}

#chatPage #sendBtn {
  border: 1px solid rgba(180,190,255,.3);
  background: linear-gradient(135deg, #388eff, #7859f2, #bd64e9);
  box-shadow: 0 5px 22px rgba(107,105,255,.25);
}

/* TRANSLATOR */

#translatorPage {
  width: 100%;
  max-width: 1200px;
  min-height: calc(100vh - 155px);
  margin: 0 auto;
  padding: 24px;
  border: 1px solid rgba(133,164,255,.23);
  border-radius: 30px;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(53,141,255,.12), transparent 42%),
    radial-gradient(ellipse at 100% 100%, rgba(175,80,255,.13), transparent 42%),
    rgba(17,26,52,.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

#translatorPage .translator-languages {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

#translatorPage .translator-history {
  min-height: 240px;
  max-height: 55vh;
  overflow-y: auto;
}

#translatorPage .translator-compose {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 21px;
  background: rgba(7,13,30,.65);
  backdrop-filter: blur(20px);
}

/* QR SCANNER */

#qrPage {
  width: 100%;
  min-height: calc(100vh - 155px);
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  border: 1px solid rgba(133,164,255,.23);
  border-radius: 30px;
  background:
    radial-gradient(ellipse at 10% 10%, rgba(70,130,255,.12), transparent 42%),
    radial-gradient(ellipse at 90% 90%, rgba(180,80,255,.12), transparent 42%),
    rgba(17,26,52,.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

#qrPage .qr-container {
  max-width: 720px;
  margin: 20px auto;
  border-radius: 25px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.035);
  box-shadow: inset 0 1px rgba(255,255,255,.07);
}

/* SETTINGS */

#settingsPage {
  min-height: calc(100vh - 72px);
  padding: 35px 24px;
}

#settingsPage .settings-heading {
  max-width: 1000px;
  margin: 0 auto 25px;
  color: #fff;
}

#settingsPage .settings-grid {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 18px;
}

#settingsPage .panel {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 23px;
  background: linear-gradient(145deg, rgba(31,44,82,.65), rgba(14,21,43,.75));
  box-shadow: 0 15px 45px rgba(0,0,0,.18);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.back-btn {
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid var(--border);
  border-radius: 13px;
  color: #eaf0ff;
  background: rgba(255,255,255,.06);
  cursor: pointer;
}

/* INPUTS */

.textarea,
.select,
input,
#themeSelect,
#interfaceLang {
  color: #f5f7ff;
  border: 1px solid rgba(139,164,255,.25);
  border-radius: 14px;
  background: rgba(7,13,30,.68);
  outline: none;
}

.textarea:focus,
.select:focus,
input:focus,
#themeSelect:focus,
#interfaceLang:focus {
  border-color: rgba(91,160,255,.7);
  box-shadow: 0 0 0 3px rgba(73,139,255,.12);
}

select option {
  color: #fff;
  background: #141d38;
}

/* BUTTONS */

.primary-btn,
.secondary-btn {
  min-height: 45px;
  padding: 11px 20px;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: .22s ease;
}

.primary-btn {
  color: #fff;
  border: 1px solid rgba(157,174,255,.28);
  background: linear-gradient(125deg, #398eff, #8059f0, #b65fe2);
  box-shadow: 0 7px 24px rgba(91,111,255,.2);
}

.secondary-btn {
  color: #dce5ff;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.055);
}

.primary-btn:hover,
.secondary-btn:hover,
.back-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
}

.status {
  color: #91cfff;
}

/* SCROLLBARS */

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(117,143,255,.42) transparent;
}

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border-radius: 20px;
  background: rgba(117,143,255,.38);
}

/* RESPONSIVE */

@media (min-width: 1400px) {
  #workspacePage {
    padding-left: 45px;
    padding-right: 45px;
  }

  #chatPage .chat-layout {
    max-width: 1320px !important;
  }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 64px;
    padding: 9px 13px;
  }

  .brand {
    font-size: 17px;
  }

  .brand-icon {
    width: 39px;
    height: 39px;
  }

  .premium-top-btn {
    min-height: 39px;
    padding: 0 12px;
    font-size: 12px;
  }

  #workspacePage {
    padding: 12px 10px 18px;
  }

  .workspace-tabs {
    width: 100%;
    margin-bottom: 12px;
    padding: 5px;
    gap: 4px;
    border-radius: 15px;
  }

  .workspace-tab {
    flex: 1;
    min-width: 0;
    min-height: 42px;
    padding: 0 7px;
    font-size: 12px;
  }

  #chatPage .chat-layout {
    height: calc(100dvh - 140px) !important;
    min-height: 420px !important;
    padding: 13px !important;
    border-radius: 22px !important;
  }

  #translatorPage,
  #qrPage {
    min-height: calc(100dvh - 140px);
    padding: 14px;
    border-radius: 22px;
  }

  #settingsPage {
    padding: 20px 12px;
  }

  #settingsPage .settings-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    top: 8px;
    bottom: 8px;
    left: 8px;
    width: min(300px, calc(100vw - 35px));
  }
}

@media (max-width: 390px) {
  .premium-top-btn {
    padding: 0 9px;
    font-size: 11px;
  }

  .workspace-tab {
    font-size: 11px;
  }

  #chatPage .chat-layout {
    padding: 10px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
