/* ===== ESCAPE WITH EXCUSES — STYLESHEET ===== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,400&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  --bg: #f6f5f2;
  --bg2: #eeecea;
  --surface: #ffffff;
  --surface2: #f0ede8;
  --border: rgba(0,0,0,0.08);
  --text: #1a1714;
  --text2: #5a5552;
  --text3: #9a9390;
  --accent: #e85d26;
  --accent2: #f07a47;
  --accent-soft: rgba(232,93,38,0.1);
  --accent-glow: rgba(232,93,38,0.25);
  --green: #2ecc6e;
  --blue: #3d8ef0;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.1);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.12);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --font-display: 'Sora', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
  --blob1: #ffd6b8;
  --blob2: #ffc8e8;
  --blob3: #c8e0ff;
}

[data-theme="dark"] {
  --bg: #111010;
  --bg2: #181716;
  --surface: #1e1c1b;
  --surface2: #252220;
  --border: rgba(255,255,255,0.07);
  --text: #f0ede8;
  --text2: #a09890;
  --text3: #605850;
  --accent: #ff6b35;
  --accent2: #ff8c5a;
  --accent-soft: rgba(255,107,53,0.12);
  --accent-glow: rgba(255,107,53,0.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
  --blob1: rgba(255,107,53,0.15);
  --blob2: rgba(255,80,120,0.12);
  --blob3: rgba(80,120,255,0.12);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

/* ===== NAVBAR ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 64px;
  background: rgba(var(--bg-rgb, 246,245,242), 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

[data-theme="dark"] .navbar {
  background: rgba(17,16,16,0.85);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo .logo-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}

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

.theme-toggle {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition);
  color: var(--text2);
}

.theme-toggle:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(15deg);
}

/* ===== BLOBS ===== */
.blobs-container {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  animation: blobFloat 12s ease-in-out infinite;
}

.blob-1 {
  width: 500px; height: 500px;
  top: -100px; left: -100px;
  background: var(--blob1);
  animation-delay: 0s;
}

.blob-2 {
  width: 400px; height: 400px;
  top: 20%; right: -80px;
  background: var(--blob2);
  animation-delay: -4s;
}

.blob-3 {
  width: 350px; height: 350px;
  bottom: 10%; left: 30%;
  background: var(--blob3);
  animation-delay: -8s;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* ===== HERO ===== */
.hero {
  position: relative;
  z-index: 1;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 40px;
}

.hero-content {
  text-align: center;
  max-width: 680px;
  width: 100%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(232,93,38,0.2);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 24px;
  animation: fadeUp 0.6s ease forwards;
}

.hero-badge .pulse {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -2px;
  color: var(--text);
  margin-bottom: 16px;
  animation: fadeUp 0.6s 0.1s ease forwards;
  opacity: 0;
}

.hero-title .accent-word {
  color: var(--accent);
  position: relative;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 48px;
  animation: fadeUp 0.6s 0.2s ease forwards;
  opacity: 0;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== SEARCH BOX ===== */
.search-wrapper {
  position: relative;
  /* Elevated above all page content so dropdown is never clipped */
  z-index: 500;
  animation: fadeUp 0.6s 0.3s ease forwards;
  opacity: 0;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 6px 6px 6px 24px;
  box-shadow: var(--shadow-md), 0 0 0 0 var(--accent-glow);
  transition: all 0.3s ease;
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), 0 0 0 4px var(--accent-glow);
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--text);
  padding: 12px 0;
  caret-color: var(--accent);
}

.search-input::placeholder { color: var(--text3); }

.search-btn {
  width: 48px; height: 48px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
  color: #fff;
}

.search-btn:hover {
  background: var(--accent2);
  transform: scale(1.05);
}

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

/* ===== SUGGESTIONS DROPDOWN ===== */
.suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  /* Must be above everything — navbar is 100, blobs are 0, hero is 1 */
  z-index: 9999;
  display: none;
  animation: dropDown 0.2s ease;
}

.suggestions.open { display: block; }

@keyframes dropDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition);
  font-size: 14px;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
}

.suggestion-item:last-child { border-bottom: none; }

.suggestion-item:hover,
.suggestion-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.suggestion-item .sug-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.suggestion-category {
  padding: 6px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text3);
  background: var(--bg2);
}

/* ===== RECENT SEARCHES CHIPS ===== */
.recent-section {
  margin-top: 24px;
  animation: fadeUp 0.6s 0.4s ease forwards;
  opacity: 0;
}

.recent-label {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 10px;
  font-weight: 500;
}

.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.chip {
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== FEATURES SECTION ===== */
.features-section {
  position: relative;
  z-index: 1;
  padding: 80px 24px;
  max-width: 960px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.feature-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.feature-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.feature-desc {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}

/* ===== EXCUSE PAGE LAYOUT ===== */
.excuse-page {
  min-height: 100vh;
  padding: 80px 24px 60px;
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
}

/* ===== TOP SEARCH BAR ON EXCUSE PAGE ===== */
.excuse-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 6px 6px 6px 20px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.3s;
}

.excuse-search-bar:focus-within { border-color: var(--accent); }

.excuse-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  padding: 10px 0;
  caret-color: var(--accent);
}

.excuse-search-input::placeholder { color: var(--text3); }

.bar-btn {
  height: 40px;
  padding: 0 16px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bar-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.bar-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.bar-btn.primary:hover { background: var(--accent2); }

/* ===== MODES PILLS ===== */
.modes-section {
  margin-bottom: 24px;
}

.modes-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 10px;
}

.modes-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mode-pill {
  padding: 7px 16px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.mode-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.mode-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* ===== EXCUSE CARD ===== */
.excuse-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  transition: all var(--transition);
}

.card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface2);
}

.card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-label .ai-badge {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 10px;
}

.char-count {
  font-size: 12px;
  color: var(--text3);
}

.card-body {
  padding: 32px 28px;
  min-height: 160px;
  position: relative;
}

.excuse-output {
  font-size: 20px;
  line-height: 1.65;
  color: var(--text);
  font-weight: 400;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Shimmer loading */
.shimmer-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shimmer-line {
  height: 20px;
  background: linear-gradient(90deg, var(--surface2) 25%, var(--bg2) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: shimmer 1.5s infinite;
}

.shimmer-line:nth-child(2) { width: 85%; }
.shimmer-line:nth-child(3) { width: 65%; }

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ===== ACTION BUTTONS ===== */
.action-btn {
  height: 38px;
  padding: 0 18px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.action-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.action-btn.primary:hover {
  background: var(--accent2);
  transform: translateY(-1px);
}

.action-btn.success {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* ===== HISTORY / FAVORITES PANEL ===== */
.side-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.panel-header {
  padding: 14px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-body {
  max-height: 220px;
  overflow-y: auto;
}

.panel-body::-webkit-scrollbar { width: 4px; }
.panel-body::-webkit-scrollbar-track { background: transparent; }
.panel-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.panel-item {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
  transition: background var(--transition);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  line-height: 1.5;
}

.panel-item:hover { background: var(--accent-soft); color: var(--text); }
.panel-item:last-child { border-bottom: none; }

.panel-item-del {
  color: var(--text3);
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1;
  padding: 2px;
  border-radius: 4px;
  transition: color var(--transition);
}

.panel-item-del:hover { color: var(--accent); }

.panel-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--text3);
  font-size: 13px;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--text);
  color: var(--bg);
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease, toastOut 0.3s 2.5s ease forwards;
  pointer-events: none;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-8px); }
}

/* ===== TRY ANOTHER BUTTON ===== */
.try-another-section {
  text-align: center;
  margin-top: 32px;
}

.try-another-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
}

.try-another-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text3);
  font-size: 13px;
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .navbar { padding: 0 16px; }
  
  .hero-title { letter-spacing: -1px; }
  
  .features-grid { grid-template-columns: 1fr; }
  
  .side-panels { grid-template-columns: 1fr; }
  
  .modes-row { gap: 6px; }
  .mode-pill { font-size: 12px; padding: 6px 12px; }
  
  .card-body { padding: 24px 20px; }
  .excuse-output { font-size: 17px; }
  
  .card-footer { padding: 12px 16px; }
  
  .bar-btn { padding: 0 12px; font-size: 12px; }

  .excuse-search-bar { flex-wrap: wrap; gap: 6px; }
}

@media (max-width: 480px) {
  .hero { padding: 80px 16px 40px; }
  .excuse-page { padding: 80px 16px 60px; }
  .search-box { padding: 4px 4px 4px 18px; }
  .search-input { font-size: 15px; }
}
