/* ============================================================
   FONTS
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

@font-face {
  font-family: 'GillSans';
  src: url('GillSans.ttc') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: 'GillSans', 'Gill Sans', 'Gill Sans MT', Calibri, sans-serif;
  background: #eae6df;
  color: #111;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

/* ============================================================
   SCREENS
   ============================================================ */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #eae6df;
  transition: transform 0.35s ease, opacity 0.35s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.screen.hidden {
  display: none;
}

.screen.slide-right {
  transform: translateX(100%);
  display: flex;
}

/* ============================================================
   NOTIFICATION CARD
   ============================================================ */
.notif-card {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-120px);
  width: calc(100% - 32px);
  max-width: 420px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.notif-card.show {
  transform: translateX(-50%) translateY(0);
}

.notif-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.notif-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #888;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.notif-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.notif-name {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #111;
  margin-bottom: 1px;
}

.notif-text {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   INTRO SCREEN
   ============================================================ */
#screen-intro {
  padding: 60px 32px 40px;
  justify-content: flex-start;
  gap: 0;
}

.intro-identity {
  width: 100px;
  height: auto;
  margin-bottom: 28px;
}

.intro-title-img {
  width: min(28%, 126px);
  height: auto;
  margin-bottom: 36px;
}

.intro-body {
  width: 100%;
  max-width: 420px;
  margin-bottom: 48px;
}

.intro-body p {
  font-size: clamp(18px, 4.5vw, 22px);
  line-height: 1.45;
  color: #111;
  margin-bottom: 20px;
}

.intro-body p:last-child {
  margin-bottom: 0;
}

.btn-primary {
  display: block;
  width: 100%;
  max-width: 420px;
  padding: 20px 24px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 400;
  color: #111;
  background: transparent;
  border: 1.5px solid #111;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 24px;
  transition: background 0.15s, color 0.15s;
}

.btn-primary:active {
  background: #111;
  color: #eae6df;
}

.btn-link {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 17px;
  color: #111;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 0;
}

/* ============================================================
   CHAT SCREEN
   ============================================================ */
#screen-chat {
  padding: 0;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  background: #eae6df;
  flex-shrink: 0;
  width: 100%;
}

.chat-header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.chat-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
}

.chat-name {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #111;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.08);
  font-family: inherit;
  font-size: 22px;
  font-weight: 300;
  color: #111;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.info-btn {
  font-size: 18px;
  font-style: italic;
  font-weight: 600;
}

.messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

/* Chat bubbles */
.bubble-wrap {
  display: flex;
  width: 100%;
}

.bubble-wrap.olena {
  justify-content: flex-start;
}

.bubble-wrap.user {
  justify-content: flex-end;
}

.bubble {
  max-width: 72%;
  padding: 10px 16px;
  border-radius: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.45;
  word-break: break-word;
}

.bubble.olena {
  background: #ffffff;
  color: #111;
  border-bottom-left-radius: 6px;
}

.bubble.user {
  background: #5b5bd6;
  color: #fff;
  border-bottom-right-radius: 6px;
}

/* Typing dots */
.typing-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 14px 18px;
  background: #ffffff;
  border-radius: 20px;
  border-bottom-left-radius: 6px;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aaa;
  animation: bounce 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
}

/* API panel */
.api-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  background: rgba(255,255,255,0.9);
  border-top: 1px solid rgba(0,0,0,0.1);
  width: 100%;
}

.api-panel.show {
  display: flex;
}

.api-panel p {
  font-size: 14px;
  color: #555;
  text-align: center;
}

.api-panel input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  background: #fff;
  transition: border-color 0.2s;
}

.api-panel input:focus {
  border-color: #5b5bd6;
}

.api-panel input.error {
  border-color: #e04;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.api-panel button {
  padding: 10px 28px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
}

/* Chat input bar */
.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 24px;
  background: #eae6df;
  width: 100%;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  padding: 12px 18px;
  border: 1.5px solid #ccc;
  border-radius: 24px;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: #111;
  background: #fff;
  resize: none;
  outline: none;
  overflow: hidden;
  line-height: 1.4;
  min-height: 44px;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: #999;
}

.chat-input:disabled {
  opacity: 0.5;
}

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #aaa;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.send-btn svg {
  width: 20px;
  height: 20px;
}

.send-btn.active {
  background: #5b5bd6;
}

/* ============================================================
   ABOUT SCREEN
   ============================================================ */
#screen-about {
  padding: 0;
  overflow-y: auto;
  align-items: flex-start;
}

.about-header {
  padding: 16px 20px 8px;
  width: 100%;
  flex-shrink: 0;
}

.about-content {
  padding: 8px 32px 60px;
  max-width: 480px;
  width: 100%;
}

.about-content h2 {
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 24px;
  color: #111;
}

.about-content p {
  font-size: clamp(16px, 4vw, 18px);
  line-height: 1.55;
  color: #111;
  margin-bottom: 20px;
}

.about-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 48px;
  gap: 8px;
}

.about-logo {
  width: min(30%, 120px);
  height: auto;
  margin-bottom: 16px;
}

.about-identity {
  width: 80px;
  height: auto;
}
