/* Airy Flow — CV Reviewer base styles */

:root {
  --bg: #f4f7fe;
  --card: #ffffff;
  --text: #0f1b2d;
  --sub: #647592;
  --line: #e9eef7;
  --chip: #f1f5fc;
  --brand: #2563eb;
  --brand2: #4f8aff;
  --shadow: 0 6px 18px rgba(15, 27, 45, 0.07);
  --shadow2: 0 2px 8px rgba(15, 27, 45, 0.04);
  --r-card: 20px;
  --r-chip: 40px;
  --header-h: 64px;
  /* compat aliases used by cv-reviewer-styles.css */
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #4f8aff;
  --success: #059669;
  --danger: #dc2626;
  --warning: #f59e0b;
  --surface: #ffffff;
  --border: #e9eef7;
  --text-primary: #0f1b2d;
  --text-secondary: #647592;
}

[data-theme="dark"] {
  --bg: #0f1117;
  --card: #1a1d27;
  --text: #edf2ff;
  --sub: #8896ae;
  --line: #252836;
  --chip: #1e2130;
  --brand: #4f8aff;
  --brand2: #7ba8ff;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
  --shadow2: 0 2px 8px rgba(0, 0, 0, 0.18);
  --primary: #4f8aff;
  --primary-dark: #7ba8ff;
  --primary-light: #7ba8ff;
  --surface: #1a1d27;
  --border: #252836;
  --text-primary: #edf2ff;
  --text-secondary: #8896ae;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--bnav-h) + env(safe-area-inset-bottom, 0px));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* Header */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  background: var(--card);
  border-bottom: 1px solid var(--line);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 18px;
  padding-top: env(safe-area-inset-top, 0px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.header-left:hover { text-decoration: none; }

.header-logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.header-greeting {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}

.greeting-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--sub);
  line-height: 1.4;
}

.greeting-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.025em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.hdr-icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  position: relative;
}
.hdr-icon-btn:hover { background: var(--chip); }
.hdr-icon-btn:active { transform: scale(0.94); }
.hdr-icon-btn svg { width: 22px; height: 22px; }

/* Theme icon toggle */
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* Side menu / drawer */
.expanded-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  max-width: 86vw;
  height: 100vh;
  height: 100dvh;
  background: var(--card);
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
  padding: 1.5rem;
  padding-top: 4.5rem;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1100;
  overflow-y: auto;
}
.expanded-menu.active { transform: translateX(0); }

.expanded-menu::-webkit-scrollbar { width: 4px; }
.expanded-menu::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.menu-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--chip);
  color: #dc2626;
}
.menu-close-btn:hover { background: #fde2e2; color: #dc2626; }

.menu-items-container,
.menu-items {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  width: 100%;
  transition: background 0.15s ease, color 0.15s ease;
}
.menu-item:hover { background: var(--chip); color: var(--brand); text-decoration: none; }

.menu-item-dropdown { display: flex; flex-direction: column; }

.dropdown-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.dropdown-icon.open { transform: rotate(180deg); }

.dropdown-content {
  display: none;
  padding-left: 1rem;
  margin-top: 0.25rem;
}

/* JS-injected class shims — token-safe for dark mode */
.text-primary { color: var(--brand) !important; }
.text-text-secondary { color: var(--sub) !important; }
.border-border { border-color: var(--line) !important; }
.bg-background-light { background: var(--card) !important; }
.text-danger { color: #dc2626 !important; }

[data-theme="dark"] .bg-white { background: var(--card) !important; }
[data-theme="dark"] .bg-gray-50 { background: var(--chip) !important; }
[data-theme="dark"] code.bg-gray-200 {
  background: var(--chip) !important;
  color: var(--text) !important;
}

/* Minimal Tailwind-compat utilities not in Tailwind CDN output */
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.mx-auto { margin-left: auto; margin-right: auto; }
.gap-4 { gap: 1rem; }

/* Bottom nav */
:root {
  --bnav-h: 60px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--line);
  z-index: 200;
  display: flex;
  justify-content: center;
  padding-bottom: var(--safe-bottom);
}

.bottom-nav-inner {
  width: 100%;
  max-width: 560px;
  height: var(--bnav-h);
  display: flex;
  align-items: stretch;
}

.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--sub);
  font-size: 10.5px;
  font-weight: 600;
  transition: color 0.15s;
  border: none;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.bnav-item svg {
  width: 22px;
  height: 22px;
  transition: color 0.15s;
}

.bnav-item.active,
.bnav-item.active svg {
  color: var(--brand);
  stroke: var(--brand);
}

.bnav-item:hover { color: var(--brand); }

/* Responsive */
@media (max-width: 768px) {
  :root { --header-h: 58px; }
  .app-header { padding: 0 14px; padding-top: env(safe-area-inset-top, 0px); }
  .header-logo { width: 30px; height: 30px; }
  .greeting-name { font-size: 15px; }
  .greeting-sub { font-size: 10px; }
}

@media (min-width: 769px) {
  .expanded-menu { width: 320px; }
}
