/* Berina Responsive Design - 100% Device Compatible */
:root {
  --navbar-height: 72px;
  --accent-1: #7c3aed;
  --accent-2: #6dd3ff;
  --text-light: #1f2937;
  --text-dark: #f1f5f9;
  --bg-light: #ffffff;
  --bg-dark: #000000;
}

html {
  background: var(--bg-light);
}

html.dark {
  background: var(--bg-dark);
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow: visible;
  color: var(--text-light);
  background: var(--bg-light);
  font-size: 16px;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: break-word;
}

html.dark body {
  color: var(--text-dark);
  background: var(--bg-dark);
}

/* CHAT WELCOME - Responsive */
.chat-welcome {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 20;
  box-sizing: border-box;
}

#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* HERO SECTION - Mobile First */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0.75rem;
  box-sizing: border-box;
  max-width: 100%;
  width: 100%;
  justify-content: center;
  background: var(--bg-light);
}

html.dark .hero {
  backgrou20px;
  height: 22

.hero-orb-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow30px;
  height: 13k: 0;
}

.hero-orb {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  box-shadow: 0 20px 50px rgba(12,16,40,0.45), inset 0 2px 10px rgba(255,255,255,0.03);
  flex-shrink: 0;
}

.hero-orb img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  max-width: 100%;
  display: block;
}

.orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  z-index: 3;
  opacity: 0.7;
  pointer-events: none;
  transition: opacity 0.5s;
}

.orb-halo {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  z-index: 2;
  background: radial-gradient(circle at 40% 30%, rgba(124,58,237,0.22), rgba(6,214,210,0.06) 40%, rgba(4,8,20,0) 60%);
}

/* LANGUAGE ROTATOR */
#hello-orbit {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.hero-language-rotator {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: none;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 100%;
  width: 100%;
  max-width: none;
}

.hero-language-text {
  display: block;
  max-width: min(90vw, 520px);
  padding: 0.25rem 0.75rem;
  font-weight: 800;
  font-size: clamp(2.5rem, 9vw, 5.5rem);
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.72);
  -webkit-text-fill-color: rgba(0, 0, 0, 0.72);
  text-shadow: 0 10px 35px rgba(255, 255, 255, 0.22);
  opacity: 0;
  transition: opacity 0.55s ease, transform 0.55s ease;
  transform: translateY(8px);
  white-space: nowrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.hero-language-text.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hero-language-text.is-dark {
  color: rgba(0, 0, 0, 0.72);
  -webkit-text-fill-color: rgba(0, 0, 0, 0.72);
}

html.dark .hero-language-text {
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  text-shadow: 0 10px 35px rgba(15, 23, 42, 0.28);
}

html.dark .hero-language-text.is-dark {
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}

.hello-text {
  display: none !important;
}

.hello-text.glow {
  display: none !important;
}

/* HERO TITLES */
.hero-title, .welcome-title {
  color: #111827;
  font-size: clamp(1.25rem, 6vw, 2rem);
  line-height: 1.2;
  margin: 0;
  font-weight: 800;
  text-align: center;
  word-break: break-word;
  max-width: 100%;
  padding: 0 0.5rem;
}

html.dark .hero-title, html.dark .welcome-title {
  color: #f1f5f9;
}

.hero-title .accent {
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 100%;
  color: #6b7280;
  text-align: center;
  font-size: clamp(0.8rem, 2vw, 0.95rem);
  margin: 0;
  padding: 0 0.75rem;
  line-height: 1.5;
  word-break: break-word;
}

html.dark .hero-sub {
  color: #9ca3af;
}

/* ACTION CARD */
.hero-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.3));
  border: 1px solid rgba(17, 24, 39, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  flex-wrap: wrap;
  justify-content: center;
}

html.dark .hero-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 40px rgba(2, 6, 23, 0.6);
}
65rem 0.85rem;
  border-radius: 12px;
  background: white;
  border: 1px solid rgba(17, 24, 39, 0.2);
  color: #1f2937;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.28s, box-shadow 0.28s, background 0.28s;
  font-size: 0.8rem;
  white-space: nowrap;
  flex: 0 1 auto;
  min-width: fit-content;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearancet-appearance: none;
  appearance: none;
  border: none;
  font-family: inherit;
}

.hero-action-btn:hover {4px);
  box-shadow: 0 8px 16px rgba(124, 58, 237, 0.15);
  background: #f0f0f0);
  background: rgba(124, 58, 237, 0.05);
}

.hero-action-btn:active {
  transform: translateY(-2px);
}

html.dark .hero-action-btn {
  border-color: rgba(255, 255, 255, 0.08);
  color: #dfe9ff;
}

html.dark .hero-action-btn:hover {
  border-color: rgba(124, 58, 237, 0.3);
  background: rgba(124, 58, 237, 0.1);
}

.hero-input {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

.hero-input .input-box {
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(17, 24, 39, 0.2);
  color: #1f2937;
  font-size: 0.9rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.28s, background 0.28s;
  -webkit-appearance: none;
  appearance: none;
}

.hero-input .input-box:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.5);
  background: #ffffff;
}

html.dark .hero-input .input-box {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.08);
  color: #dfe9ff;
}

html.dark .hero-input .input-box:focus {
  border-color: rgba(124, 58, 237, 0.5);
  background: rgba(255, 255, 255, 0.04);
}

/* TRANSITIONS */
.fade-hidden {
  opacity: 0;
  transform: translateY(8px) scale(0.995);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

/* CHAT APP */
.chat-app {
  position: relative;
  z-index: 30;
  padding-bottom: 120px;
  width: 100%;
  box-sizing: border-box;
}

/* NAVBAR */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  z-index: 60;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.18));
  box-shadow: 0 6px 20px rgba(8, 10, 20, 0.06);
  width: 100%;
  box-sizing: border-box;
}

html.dark #navbar {
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.82), rgba(2, 6, 23, 0.28));
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
}

body {
  padding-top: var(--navbar-height);
}

/* INPUT WRAPPER */
.chat-input-wrapper {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
  pointer-events: none;
  width: 100%;
  box-sizing: border-box;
}

.chat-input-wrapper > * {
  pointer-events: auto;
}

html.dark .chat-input-wrapper {
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.86));
}

/* HELPERS */
.center-full {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#berina-welcome, #berina-welcome * {
  filter: none !important;
  -webkit-filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* ============ RESPONSIVE: TABLETS (768px) ============ */
@media (max-width: 768px) {
  :root {
    --navbar-height: 64px;
  }

  .hero {
    gap: 1rem;
    padding: 1rem 0.75rem;
  }

  .hero-orb-wrap {
    width: 240px;
    height: 240px;
  }

  .hero-orb {
    width: 140px;
    height: 140px;
  }

  .hero-title, .welcome-title {
    font-size: clamp(1.25rem, 5vw, 1.75rem);
  }

  .hero-card {
    max-width: 100%;
    gap: 0.6rem;
  }

  .hero-action-btn {
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
  }

  .hero-input .input-box {
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
  }
}

/* ============ RESPONSIVE: PHONES (600px) ============ */
@media (max-width: 600px) {
  :root {
    --navbar-height: 60px;
  }

  body {
    padding-top: var(--navbar-height);
    font-size: 15px;
  }

  .hero {
    gap: 0.875rem;
    padding: 1rem 0.75rem;
    justify-content: center;
  }

  .hero-orb-wrap {
    width: 200px;
    height: 200px;
  }

  .hero-orb {
    width: 120px;
    height: 120px;
  }

  .hero-title, .welcome-title {
    font-size: clamp(1.1rem, 5vw, 1.5rem);
    padding: 0.25rem 0.5rem;
    margin: 0.1rem 0;
  }

  .hero-sub {
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    padding: 0 0.5rem;
    margin: 0.1rem 0;
  }

  .hero-language-text {
    font-size: clamp(1.1rem, 7vw, 2.2rem);
    letter-spacing: 0.05em;
    padding: 0.15rem 0.3rem;
  }

  .hero-card {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 0.75rem;
  }

  .hero-action-btn {
    width: 100%;
    padding: 0.65rem;
    font-size: 0.8rem;
  }

  .hero-input {
    width: 100%;
  }

  .hero-input .input-box {
    padding: 0.65rem;
    font-size: 0.85rem;
  }

  #navbar {
    height: var(--navbar-height);
  }

  .chat-input-wrapper {
    padding: 0.75rem;
  }
}

/* ============ RESPONSIVE: SMALL PHONES (480px) ============ */
@media (max-width: 480px) {
  :root {
    --navbar-height: 56px;
  }

  html, body {
    font-size: 14px;
  }

  .hero {
    gap: 0.875rem;
    padding: 0.875rem;
  }

  .hero-orb-wrap {
    width: 200px;
    height: 200px;
  }

  .hero-orb {
    width: 120px;
    height: 120px;
  }

  .hero-title, .welcome-title {
    font-size: clamp(1.1rem, 5vw, 1.5rem);
    margin: 0.25rem 0;
  }

  .hero-sub {
    font-size: clamp(0.75rem, 2vw, 0.85rem);
    padding: 0 0.5rem;
  }

  .hero-language-text {
    font-size: clamp(1rem, 6vw, 2rem);
    letter-spacing: 0.04em;
  }

  .hero-card {
    padding: 0.75rem;
    gap: 0.5rem;
  }

  .hero-action-btn {
    padding: 0.6rem;
    font-size: 0.8rem;
    min-width: 0;
  }

  .hero-input .input-box {
    padding: 0.6rem;
    font-size: 0.85rem;
  }

  .chat-input-wrapper {
    padding: 0.65rem;
  }
}

/* ============ RESPONSIVE: VERY SMALL PHONES (380px) ============ */
@media (max-width: 380px) {
  .hero-orb-wrap {
    width: 180px;
    height: 180px;
  }

  .hero-orb {
    width: 110px;
    height: 110px;
  }

  .hero-title, .welcome-title {
    font-size: clamp(1rem, 5vw, 1.25rem);
  }

  .hero-language-text {
    font-size: clamp(0.9rem, 5.5vw, 1.75rem);
    letter-spacing: 0.03em;
  }

  .hero-card {
    padding: 0.65rem;
  }

  .hero-action-btn {
    padding: 0.5rem;
    font-size: 0.75rem;
  }

  .hero-input .input-box {
    padding: 0.5rem;
    font-size: 0.8rem;
  }
}

/* ============ LANDSCAPE MODE ============ */
@media (max-height: 600px) and (orientation: landscape) {
  .hero {
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .hero-orb-wrap {
    width: 150px;
    height: 150px;
  }

  .hero-orb {
    width: 90px;
    height: 90px;
  }

  .hero-title, .welcome-title {
    font-size: clamp(1rem, 4vw, 1.5rem);
    margin: 0.15rem 0;
  }

  .hero-sub {
    font-size: clamp(0.7rem, 2vw, 0.85rem);
    margin: 0.1rem 0;
  }

  .hero-card {
    padding: 0.6rem;
    gap: 0.5rem;
  }

  .chat-input-wrapper {
    padding: 0.5rem;
  }
}

/* ============ HIGH DPI / RETINA ============ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero-orb {
    box-shadow: 0 20px 50px rgba(12, 16, 40, 0.45),
      inset 0 2px 10px rgba(255, 255, 255, 0.03);
  }

  .hero-card {
    box-shadow: 0 12px 40px rgba(2, 6, 23, 0.6);
  }
}

/* ============ TOUCH DEVICES ============ */
@media (hover: none) and (pointer: coarse) {
  .hero-action-btn {
    min-height: 44px;
    min-width: 44px;
  }

  .hero-action-btn:active {
    transform: translateY(-2px);
    background: rgba(124, 58, 237, 0.08);
  }

  .hero-input .input-box {
    min-height: 44px;
    font-size: 16px;
  }

  .hero-input .input-box:focus {
    zoom: 1;
  }
}

/* ============ DARK MODE ============ */
@media (prefers-color-scheme: dark) {
  :root {
    --text-light: #1f2937;
    --text-dark: #f1f5f9;
  }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
