/* ============================================================
   FrogBot — AI assistant rendered as an iPhone 17 Pro Max
   Super-realistic design with Premium Titanium styling & Glare
   ============================================================ */

/* ---------- Launcher ---------- */
.fc-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 150;
  width: 62px;
  height: 62px;
  border-radius: var(--r-pill);
  background: var(--solid-bg);
  color: var(--solid-fg);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  transition: transform .5s var(--easing), opacity .4s var(--easing);
  will-change: transform;
}
.fc-fab:hover {
  transform: translateY(-4px) scale(1.05);
}
.fc-fab svg {
  width: 28px;
  height: 28px;
}
.fc-fab__ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1.5px solid var(--solid-bg);
  animation: fc-ping 2.4s var(--easing) infinite;
  opacity: 0;
}
@keyframes fc-ping {
  0% { transform: scale(1); opacity: .6; }
  100% { transform: scale(1.5); opacity: 0; }
}
.fc-fab.hidden {
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}
.fc-fab__badge {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid var(--solid-fg);
}
[data-theme="light"] .fc-fab__badge {
  background: #000;
  color: #fff;
  border-color: var(--solid-fg);
}

/* ---------- Phone wrapper ---------- */
.fc-phone {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 180;
  width: min(360px, 92vw);
  height: min(740px, 88vh);
  opacity: 0;
  visibility: hidden;
  transform: translateY(40px) scale(.9);
  transform-origin: bottom right;
  transition: opacity .5s var(--easing), transform .6s var(--easing), visibility .5s;
  touch-action: auto;
}
.fc-phone.open {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.fc-phone.dragging {
  transition: none;
}

/* ---------- Titanium frame & Chassis ---------- */
.phone {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 56px;
  padding: 3px;
  box-shadow: 
    0 25px 50px -12px rgba(0,0,0,0.5), 
    0 0 0 1px rgba(0,0,0,0.25),
    inset 0 0 2px 1px rgba(255,255,255,0.15);
  background: linear-gradient(135deg, 
    #2c2c2e 0%, 
    #48484a 25%, 
    #1c1c1e 50%, 
    #3a3a3c 75%, 
    #2c2c2e 100%
  );
  transition: background var(--t);
}

/* Desert / Natural Titanium colors */
[data-theme="light"] .phone {
  background: linear-gradient(135deg, 
    #d1c7bd 0%, 
    #e3dacd 25%, 
    #bdae9f 50%, 
    #ebdcd0 75%, 
    #d1c7bd 100%
  );
  box-shadow: 
    0 25px 50px -12px rgba(0,0,0,0.25), 
    0 0 0 1px rgba(0,0,0,0.12),
    inset 0 0 2px 1px rgba(255,255,255,0.4);
}

/* Inner metal edge line */
.phone::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.4), rgba(0,0,0,0.2) 50%, rgba(255,255,255,0.2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* Realistic Glass Glare Overlay */
.phone__glare {
  position: absolute;
  inset: 4px;
  border-radius: 51px;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.16) 0%, 
    rgba(255, 255, 255, 0.08) 28%, 
    rgba(255, 255, 255, 0) 28.5%, 
    rgba(255, 255, 255, 0) 100%
  );
  pointer-events: none;
  z-index: 100;
}

/* Speaker Grill */
.phone__speaker {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: #111;
  border-radius: 99px;
  z-index: 110;
  box-shadow: inset 0 1px 1px rgba(0,0,0,0.8);
}
[data-theme="light"] .phone__speaker {
  background: #333;
}

/* Ultra-thin screen border & bezel matrix */
.phone__bezel {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 53px;
  background: #000000;
  padding: 7px; /* Modern ultra-thin bezels (iPhone 16 Pro styling) */
  overflow: hidden;
  box-shadow: inset 0 0 4px rgba(0,0,0,0.6);
}

.phone__screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 46px;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  display: flex;
  flex-direction: column;
  transition: background var(--t), color var(--t);
  box-shadow: inset 0 0 2px rgba(0,0,0,0.8);
}

/* Tactile 3D Buttons */
.phone__btn {
  position: absolute;
  border-radius: 3px;
  z-index: -1;
  background: #333;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.phone__btn--action {
  left: -2px;
  top: 115px;
  width: 2px;
  height: 30px;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(to right, #444, #222);
}

.phone__btn--vu {
  left: -2px;
  top: 165px;
  width: 2px;
  height: 52px;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(to right, #444, #222);
}

.phone__btn--vd {
  left: -2px;
  top: 228px;
  width: 2px;
  height: 52px;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(to right, #444, #222);
}

.phone__btn--power {
  right: -2px;
  top: 195px;
  width: 2px;
  height: 75px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(to left, #444, #222);
}

[data-theme="light"] .phone__btn {
  background: #bbb;
}
[data-theme="light"] .phone__btn--action,
[data-theme="light"] .phone__btn--vu,
[data-theme="light"] .phone__btn--vd {
  background: linear-gradient(to right, #e3dacd, #bdae9f);
}
[data-theme="light"] .phone__btn--power {
  background: linear-gradient(to left, #e3dacd, #bdae9f);
}

/* ---------- Dynamic Island ---------- */
.phone__island {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99;
  width: 95px;
  height: 29px;
  background: #000;
  border-radius: 99px;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  touch-action: none;
}
.phone__island:active {
  cursor: grabbing;
}
.phone__island::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(24, 43, 67, 0.8) 0%, rgba(12, 21, 36, 0.9) 60%, #000 100%);
  box-shadow: inset 0 0 1px rgba(255,255,255,0.2);
}
.island__cam {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(20, 36, 57, 0.85) 0%, rgba(8, 15, 26, 0.95) 70%, #000 100%);
  box-shadow: inset 0 0 1px rgba(255,255,255,0.2);
}

/* ---------- Status Bar ---------- */
.fc-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 10px 24px 0 28px;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -0.01em;
  z-index: 10;
}
.fc-status__time {
  font-variant-numeric: tabular-nums;
}
.fc-status__icons {
  display: flex;
  align-items: center;
  gap: 5px;
}
.fc-status__icons svg {
  height: 11px;
  width: auto;
  fill: var(--fg);
  opacity: 0.85;
}

/* ---------- Chat ---------- */
.fc-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.fc-chat__head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.01);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: grab;
}
.fc-chat__head:active {
  cursor: grabbing;
}

.fc-ava {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--solid-bg);
  color: var(--solid-fg);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.fc-ava svg {
  width: 22px;
  height: 22px;
}
.fc-ava__dot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--bg);
}

.fc-chat__id {
  flex: 1;
  min-width: 0;
}
.fc-chat__id h4 {
  font-family: 'Unbounded';
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.fc-chat__id span {
  font-size: 11px;
  color: var(--fg-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

.fc-chat__min {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  transition: background .3s;
}
.fc-chat__min:hover {
  background: var(--muted);
}
.fc-chat__min svg {
  width: 14px;
  height: 14px;
}

.fc-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.fc-msgs::-webkit-scrollbar {
  width: 0;
}

.fc-msg {
  max-width: 82%;
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.45;
  border-radius: 18px;
  animation: fc-rise .4s var(--easing) both;
  word-wrap: break-word;
}
@keyframes fc-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.fc-msg.bot {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.fc-msg.user {
  align-self: flex-end;
  background: var(--solid-bg);
  color: var(--solid-fg);
  border-bottom-right-radius: 4px;
}

.fc-typing {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  padding: 12px 14px;
  border-radius: 18px;
  display: flex;
  gap: 4px;
}
.fc-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg-dim);
  animation: fc-blink 1.2s var(--easing) infinite;
}
.fc-typing i:nth-child(2) { animation-delay: .18s; }
.fc-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes fc-blink {
  0%, 60%, 100% { opacity: .25; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* Quick Chips */
.fc-chips {
  display: flex;
  gap: 6px;
  padding: 8px 14px 4px;
  overflow-x: auto;
  flex: 0 0 auto;
  scrollbar-width: none;
}
.fc-chips::-webkit-scrollbar {
  display: none;
}
.fc-chip {
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 600;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--fg-dim);
  background: transparent;
  transition: border-color .3s, background .3s, color .3s;
}
.fc-chip:hover {
  border-color: var(--fg);
  color: var(--fg);
  background: var(--muted);
}

/* Input Area */
.fc-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 10px;
  flex: 0 0 auto;
}
.fc-input input {
  flex: 1;
  min-width: 0;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--fg);
  font: inherit;
  font-weight: 500;
  font-size: 13.5px;
  transition: border-color .3s;
}
.fc-input input:focus {
  outline: none;
  border-color: var(--fg);
}
.fc-input button {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--solid-bg);
  color: var(--solid-fg);
  display: grid;
  place-items: center;
  transition: transform .35s var(--easing), opacity .3s;
}
.fc-input button:hover {
  transform: scale(1.05);
}
.fc-input button:disabled {
  opacity: .4;
  pointer-events: none;
}
.fc-input button svg {
  width: 17px;
  height: 17px;
}

/* iOS Home Indicator Bar */
.phone__home {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 5px;
  border-radius: 99px;
  background: var(--fg);
  opacity: .25;
  z-index: 110;
  cursor: pointer;
  transition: opacity 0.3s;
}
.phone__home:hover {
  opacity: 0.5;
}

.fc-msgs {
  padding-bottom: 24px;
}

/* Responsive adjustments */
@media (max-width: 560px) {
  .fc-phone {
    right: 50%;
    transform: translate(50%, 40px) scale(.92);
    width: min(340px, 94vw);
  }
  .fc-phone.open {
    transform: translate(50%, 0);
  }
  .fc-fab {
    right: 18px;
    bottom: 18px;
  }
}
