/* ============================================================
   LAYOUT — Reset, structure, headers, navigation
   ============================================================ */

/* ----- Utility classes ----- */
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-middle { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }

/* ----- Reset ----- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html, body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100%;
}

body {
  background-color: var(--bg-color);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100dvh;
}

/* ----- Mobile Container ----- */
.mobile-container {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background-color: var(--bg-color);
  border-radius: 0;
  box-shadow: none;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 480px) {
  body {
    background-color: var(--desktop-bg);
  }

  .mobile-container {
    max-width: 412px;
    height: 840px;
    border-radius: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    margin: 20px 0;
  }
}

/* ----- Status Bar ----- */
.status-bar {
  height: var(--status-bar-h);
  background-color: var(--primary);
  color: var(--white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  font-size: 12px;
  font-weight: 600;
  z-index: 100;
  flex-shrink: 0;
  transition: background-color 0.3s;
}

.status-bar.light {
  background-color: transparent;
  color: var(--text-dark);
}

.status-time {
  font-variant-numeric: tabular-nums;
  min-width: 28px;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Signal bars */
.signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 12px;
}

.signal-bars .bar {
  width: 3px;
  background: currentColor;
  border-radius: 1px;
}

.signal-bars .bar:nth-child(1) { height: 3px; }
.signal-bars .bar:nth-child(2) { height: 6px; }
.signal-bars .bar:nth-child(3) { height: 9px; }
.signal-bars .bar:nth-child(4) { height: 12px; }

.carrier-text {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.icon-status { width: 14px; height: 14px; }

/* Battery icon */
.battery-icon {
  display: flex;
  align-items: center;
  gap: 1px;
}

.battery-body {
  width: 20px;
  height: 10px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  display: block;
  padding: 1.5px;
  background: transparent;
  position: relative;
}

.battery-body::after {
  content: '';
  position: absolute;
  top: 1.5px;
  left: 1.5px;
  bottom: 1.5px;
  width: 13px;
  background: currentColor;
  border-radius: 1px;
}

.battery-cap {
  width: 2px;
  height: 4px;
  background: currentColor;
  border-radius: 0 1px 1px 0;
  display: block;
}

.icon-sm { width: 14px; height: 14px; }
.icon-xs { width: 12px; height: 12px; }

/* ----- Screen Manager ----- */
.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background-color: var(--bg-color);
  overflow: hidden;
}

.screen.active {
  display: flex;
}

.content {
  flex: 1;
  overflow-y: auto;
}

.content.padded { padding: 20px; }
.content.no-padding { padding: 0; }

/* ----- App Headers ----- */
.app-header {
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-blue {
  background-color: var(--primary);
  color: var(--white);
}

.header-light {
  background-color: transparent;
  color: var(--text-dark);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Logo */
.logo-icon {
  width: 36px;
  height: 36px;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  flex-shrink: 0;
}

.logo-icon:has(.logo-img) {
  background-color: transparent;
}

.logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  display: block;
}

.brand-text h2 { font-size: 18px; font-weight: 700; line-height: 1.2; }
.brand-text p { font-size: 11px; opacity: 0.8; }

.header-title { font-size: 18px; font-weight: 600; }

/* ----- Hero & Welcome (screen-home) ----- */
.hero-banner {
  background-color: var(--primary);
  color: var(--white);
  padding: 0 20px 60px 20px;
  border-bottom-left-radius: 30px;
  border-bottom-right-radius: 30px;
}

.hero-banner h1 { font-size: 22px; margin-bottom: 5px; }
.hero-banner p { opacity: 0.9; font-size: 14px; }

.start-chat-card {
  background: var(--card-bg);
  margin: -40px 20px 20px 20px;
  border-radius: 20px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.circle-illustration {
  width: 64px;
  height: 64px;
  background-color: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 15px auto;
}

.start-chat-card h3 { font-size: 16px; margin-bottom: 5px; }
.start-chat-card p { font-size: 13px; color: var(--text-muted); margin-bottom: 15px; }

.info-section { padding: 0 20px; }
.info-section h4 { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }

.feature-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
}

.feature-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ----- Bottom Navigation ----- */
.bottom-nav {
  height: 60px;
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
}

.nav-item.active { color: var(--primary); font-weight: 600; }

.icon-wrap { position: relative; }
.nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--primary);
  color: var(--white);
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 8px;
  font-weight: bold;
}

.nav-badge.red { background: var(--red-500); }
