:root{
  --navy:#0B2545;
  --navy-deep:#071A34;
  --saffron:#FF9933;
  --green:#0E7A3D;
  --paper:#F6F3EC;
  --gold:#C9A227;
  --ink:#1B2430;
  --muted:#6b7280;
  --card:#ffffff;
}
*{box-sizing:border-box;}
html,body{
  margin:0;
  height:100%;
  font-family:'Segoe UI',-apple-system,BlinkMacSystemFont,sans-serif;
  background:
    radial-gradient(1200px 500px at 20% -10%, rgba(255,153,51,0.08), transparent 60%),
    radial-gradient(1200px 500px at 100% 0%, rgba(14,122,61,0.08), transparent 60%),
    var(--paper);
  color:var(--ink);
}

/* Launcher button */
#launcher{
  position:fixed;
  bottom:24px;
  right:24px;
  width:60px;
  height:60px;
  border-radius:50%;
  border:none;
  background:linear-gradient(135deg,var(--navy),var(--navy-deep));
  color:#fff;
  font-size:26px;
  cursor:pointer;
  box-shadow:0 10px 30px rgba(11,37,69,0.35);
  z-index:9999;
  transition:transform .15s ease;
}
#launcher:hover{ transform: scale(1.06); }

/* Chat widget shell */
.phone{
  position:fixed;
  bottom:24px;
  right:24px;
  width:400px;
  max-width:calc(100vw - 32px);
  background:var(--card);
  border-radius:20px;
  box-shadow:0 20px 60px rgba(11,37,69,0.30);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  height:min(640px, calc(100vh - 48px));
  z-index:9999;
}
.phone[hidden]{
  display:none !important;
}
.tricolor{
  height:6px; width:100%;
  background:linear-gradient(90deg,var(--saffron) 0 33.3%, #ffffff 33.3% 66.6%, var(--green) 66.6% 100%);
  flex-shrink:0;
}
header{
  background:linear-gradient(135deg,var(--navy),var(--navy-deep));
  color:#fff;
  padding:14px 16px;
  display:flex;
  align-items:center;
  gap:12px;
  flex-shrink:0;
  position:relative;
}
.avatar{
  width:40px;height:40px;border-radius:50%;
  background:radial-gradient(circle at 30% 30%, var(--gold), #8a6d1a);
  display:flex;align-items:center;justify-content:center;
  font-size:18px;
  border:2px solid rgba(255,255,255,0.4);
  flex-shrink:0;
}
header .title{font-weight:700;font-size:14.5px;}
header .sub{font-size:11px;opacity:0.75;margin-top:2px;}
#closeBtn{
  margin-left:auto;
  background:transparent;
  border:none;
  color:#fff;
  font-size:16px;
  cursor:pointer;
  opacity:.8;
}
#closeBtn:hover{opacity:1;}

.breadcrumb{
  background:#EFEAE0;
  padding:7px 16px;
  font-size:10.5px;
  color:var(--muted);
  border-bottom:1px solid #e3ddcf;
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  flex-shrink:0;
  min-height:14px;
}
.breadcrumb span.crumb{color:var(--navy);font-weight:600;}
.breadcrumb span.sep{color:#c9c2ae;}

.chat{
  flex:1;
  overflow-y:auto;
  padding:16px 14px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.row{display:flex; gap:8px; align-items:flex-end;}
.small-icon{
  width:24px;height:24px;border-radius:50%;
  background:var(--navy);color:#fff;font-size:11px;
  display:flex;align-items:center;justify-content:center;flex-shrink:0;
}
.bot-bubble{
  background:#fff;
  border:1px solid #e7e1d2;
  border-radius:16px 16px 16px 4px;
  padding:11px 13px;
  font-size:13px;
  line-height:1.5;
  max-width:86%;
  box-shadow:0 2px 8px rgba(11,37,69,0.05);
}
.bot-bubble a{color:var(--navy); font-weight:700; text-decoration:none; border-bottom:1px solid var(--saffron);}
.bot-bubble strong{color:var(--navy);}
.bot-bubble ul{
  margin:6px 0 0 0;
  padding-left:18px;
  list-style-type:disc;
}
.bot-bubble li{
  margin-bottom:4px;
  line-height:1.4;
}
.bot-bubble li:last-child{margin-bottom:0;}
.bot-bubble .details-link{
  display:inline-block;
  margin-top:4px;
}
.user-bubble{
  align-self:flex-end;
  background:var(--navy);
  color:#fff;
  border-radius:16px 16px 4px 16px;
  padding:9px 13px;
  font-size:13px;
  max-width:80%;
}
.options{
  display:flex;
  flex-direction:column;
  gap:7px;
  margin-top:2px;
  padding-left:32px;
}
.opt-btn{
  text-align:left;
  background:#fff;
  border:1.5px solid var(--navy);
  color:var(--navy);
  padding:8px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:600;
  cursor:pointer;
  transition:all .15s ease;
}
.opt-btn:hover{background:var(--navy); color:#fff;}
.opt-btn.emergency{ border-color:#B3261E; color:#B3261E; }
.opt-btn.emergency:hover{ background:#B3261E; color:#fff; }
.opt-btn.back{ border-color:var(--muted); color:var(--muted); }
.opt-btn.back:hover{ background:var(--muted); color:#fff; }

.inputRow{
  display:flex;
  gap:8px;
  padding:10px 14px;
  border-top:1px solid #eee;
  flex-shrink:0;
}
.inputRow[hidden]{
  display:none !important;
}
.inputRow input{
  flex:1;
  padding:9px 12px;
  border-radius:999px;
  border:1.5px solid #d8d2c2;
  font-size:13px;
  outline:none;
}
.inputRow input:focus{ border-color:var(--navy); }
.inputRow button{
  background:var(--navy);
  color:#fff;
  border:none;
  padding:0 16px;
  border-radius:999px;
  font-size:12.5px;
  font-weight:600;
  cursor:pointer;
}
.inputRow button:hover{ background:var(--navy-deep); }

footer{
  padding:8px 14px;
  text-align:center;
  font-size:10px;
  color:var(--muted);
  border-top:1px solid #f0ede4;
  flex-shrink:0;
}

@media (max-width:480px){
  .phone{
    right:16px; left:16px; bottom:16px;
    width:auto;
    height:min(600px, calc(100vh - 32px));
  }
}

/* ============================================================
   Embassy of India, Bratislava — Chat Assistant
   Government-style theme: navy + saffron + green
   ============================================================ */

:root {
  --navy: #0b2a5b;
  --navy-2: #123a7a;
  --saffron: #ff9933;
  --green: #138808;
  --white: #ffffff;
  --bg: #f3f6fb;
  --text: #1c2a3f;
  --muted: #5d6b82;
  --border: #d9e1ee;
  --shadow: 0 18px 50px rgba(11, 42, 91, .28);
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans", Roboto, Arial, sans-serif;
  color: var(--text);
}

button { font-family: inherit; cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--saffron);
  outline-offset: 2px;
}

/* ---------------- Launcher ---------------- */

#launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 62px;
  height: 62px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff;
  font-size: 26px;
  box-shadow: 0 8px 22px rgba(11, 42, 91, .4);
  z-index: 9999;
  display: grid;
  place-items: center;
  border-bottom: 4px solid var(--saffron);
  transition: transform .2s ease;
  animation: floaty 3s ease-in-out infinite;
}
#launcher:hover { transform: scale(1.08); }

.launcher-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--saffron);
  opacity: 0;
  animation: ring 2.4s ease-out infinite;
}

@keyframes ring {
  0%   { transform: scale(.9); opacity: .8; }
  100% { transform: scale(1.5); opacity: 0; }
}
@keyframes floaty {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -5px; }
}

/* ---------------- Widget ---------------- */

.phone {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 380px;
  max-width: calc(100vw - 24px);
  height: 600px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 10000;
  transform-origin: bottom right;
  animation: popIn .35s cubic-bezier(.2, .9, .3, 1.2);
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(24px) scale(.92); }
  to   { opacity: 1; transform: none; }
}

/* Tricolour strip */
.tricolor {
  height: 6px;
  flex: none;
  background: linear-gradient(90deg,
    var(--saffron) 0 33.3%, #fff 33.3% 66.6%, var(--green) 66.6% 100%);
  background-size: 200% 100%;
  animation: flow 6s linear infinite;
}
@keyframes flow { to { background-position: 200% 0; } }

/* ---------------- Header ---------------- */

header {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
}

.avatar {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: #fff;
  border-radius: 50%;
  border: 2px solid var(--saffron);
}

.head-text { flex: 1; min-width: 0; }
.title { font-weight: 700; font-size: 16px; letter-spacing: .3px; }
.sub   { font-size: 11.5px; opacity: .85; }

#closeBtn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: 14px;
  transition: background .2s, transform .2s;
}
#closeBtn:hover { background: rgba(255, 255, 255, .3); transform: rotate(90deg); }

/* Speaker toggle — small, left of header */
.speak-btn {
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  transition: background .2s, transform .2s, opacity .2s;
}
.speak-btn svg { width: 15px; height: 15px; }
.speak-btn:hover { background: rgba(255, 255, 255, .28); transform: scale(1.08); }
.speak-btn .ico-off { display: none; }
.speak-btn.off .ico-on { display: none; }
.speak-btn.off .ico-off { display: block; }
.speak-btn.off { opacity: .65; }

.speak-btn.speaking {
  background: var(--saffron);
  border-color: var(--saffron);
  animation: speakPulse 1s ease-in-out infinite;
}
@keyframes speakPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 153, 51, .7); }
  50%      { box-shadow: 0 0 0 7px rgba(255, 153, 51, 0); }
}

/* ---------------- Breadcrumb ---------------- */

.breadcrumb {
  flex: none;
  min-height: 30px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--muted);
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.breadcrumb:empty { display: none; }
.crumb { color: var(--navy); font-weight: 600; animation: fadeIn .3s; }
.sep { margin: 0 6px; color: var(--saffron); font-weight: 700; }

/* ---------------- Chat area ---------------- */

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 153, 51, .08), transparent 40%),
    radial-gradient(circle at 0 100%, rgba(19, 136, 8, .07), transparent 40%),
    var(--bg);
  scroll-behavior: smooth;
}
.chat::-webkit-scrollbar { width: 6px; }
.chat::-webkit-scrollbar-thumb { background: #b8c4da; border-radius: 6px; }

.row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  animation: slideLeft .35s ease both;
}

.small-icon {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 15px;
  background: #fff;
  border: 1.5px solid var(--saffron);
  border-radius: 50%;
}

.bot-bubble {
  max-width: 82%;
  padding: 10px 13px;
  font-size: 14px;
  line-height: 1.5;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: 4px 14px 14px 14px;
  box-shadow: 0 2px 6px rgba(11, 42, 91, .07);
  overflow-wrap: anywhere;
}
.bot-bubble p { margin: 0 0 8px; }
.bot-bubble p:last-child { margin-bottom: 0; }

.bot-bubble a {
  display: inline-block;
  padding: 6px 12px;
  color: #fff;
  background: var(--navy);
  border-radius: 20px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  transition: background .2s, transform .2s;
}
.bot-bubble a:hover { background: var(--green); transform: translateX(3px); }

.user-bubble {
  max-width: 80%;
  padding: 9px 13px;
  margin-bottom: 10px;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  border-radius: 14px 14px 4px 14px;
  animation: slideRight .3s ease both;
}

.content-sentence {
  display: inline;
  padding-left: 10px;
  border-left: 3px solid var(--saffron);
}
.official-info {
  margin-top: 4px;
  padding-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px dashed var(--border);
}

/* ---------------- Options ---------------- */

.options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 12px 36px;
}

.opt-btn {
  position: relative;
  padding: 10px 14px;
  text-align: left;
  font-size: 13.5px;
  color: var(--navy);
  background: #fff;
  border: 1.5px solid var(--navy);
  border-radius: 12px;
  overflow: hidden;
  opacity: 0;
  animation: slideUp .4s ease forwards;
  transition: color .25s, transform .2s, box-shadow .2s;
  z-index: 0;
}
.opt-btn:nth-child(1)  { animation-delay: .00s; }
.opt-btn:nth-child(2)  { animation-delay: .05s; }
.opt-btn:nth-child(3)  { animation-delay: .10s; }
.opt-btn:nth-child(4)  { animation-delay: .15s; }
.opt-btn:nth-child(5)  { animation-delay: .20s; }
.opt-btn:nth-child(6)  { animation-delay: .25s; }
.opt-btn:nth-child(7)  { animation-delay: .30s; }
.opt-btn:nth-child(8)  { animation-delay: .35s; }
.opt-btn:nth-child(n+9){ animation-delay: .40s; }

/* sliding fill on hover */
.opt-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--navy);
  transform: translateX(-101%);
  transition: transform .3s ease;
  z-index: -1;
}
.opt-btn:hover { color: #fff; transform: translateX(4px); box-shadow: 0 4px 12px rgba(11, 42, 91, .25); }
.opt-btn:hover::before { transform: none; }
.opt-btn:active { transform: scale(.98); }

.opt-btn.emergency { color: #b00020; border-color: #b00020; }
.opt-btn.emergency::before { background: #b00020; }
.opt-btn.emergency:hover { color: #fff; }

.opt-btn.back {
  color: var(--muted);
  border-color: var(--border);
  background: #f7f9fc;
}
.opt-btn.back::before { background: var(--muted); }
.opt-btn.back:hover { color: #fff; }

/* ---------------- Input row ---------------- */

.inputRow {
  flex: none;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid var(--border);
  animation: slideUp .3s ease;
}
.inputRow input {
  flex: 1;
  padding: 10px 12px;
  font-size: 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  transition: border-color .2s, box-shadow .2s;
}
.inputRow input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(11, 42, 91, .15);
}
.inputRow button {
  padding: 0 16px;
  color: #fff;
  font-weight: 600;
  background: var(--green);
  border: 0;
  border-radius: 10px;
  transition: filter .2s, transform .2s;
}
.inputRow button:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ---------------- Footer ---------------- */

footer {
  flex: none;
  padding: 7px 10px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  background: #fff;
  border-top: 1px solid var(--border);
}

/* ---------------- Animations ---------------- */

@keyframes fadeIn     { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideLeft  { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes slideRight { from { opacity: 0; transform: translateX(14px); }  to { opacity: 1; transform: none; } }
@keyframes slideUp    { from { opacity: 0; transform: translateY(10px); }  to { opacity: 1; transform: none; } }

/* ---------------- Mobile ---------------- */

@media (max-width: 480px) {
  .phone {
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .options { margin-left: 0; }
}

/* ---------------- Reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .opt-btn { opacity: 1; }
}
