/* ==========================================================================
   Travel · Apple & Google Minimalist Design System (Decks Style)
   ========================================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Google Sans", "Plus Jakarta Sans", -apple-system, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  /* Apple Light Palette */
  --bg-app: #fbfbfd;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-subtle: #f5f5f7;
  --bg-active: #e8e8ed;
  --border-hairline: rgba(0, 0, 0, 0.08);
  --border-card: rgba(0, 0, 0, 0.06);

  --text-main: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;

  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-light: rgba(0, 113, 227, 0.08);

  --primary: #1d1d1f;
  --primary-hover: #000000;

  --badge-public-bg: #e8f0fe;
  --badge-public-text: #1967d2;
  --badge-pass-bg: #fef7e0;
  --badge-pass-text: #b06000;
  --badge-private-bg: #f1f3f4;
  --badge-private-text: #5f6368;

  --nav-height: 64px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 4px 18px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
  --shadow-card-hover: 0 12px 30px -4px rgba(0, 0, 0, 0.1), 0 4px 12px -2px rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 24px 60px -10px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] {
  --bg-app: #000000;
  --bg-card: #1c1c1e;
  --bg-card-hover: #242426;
  --bg-subtle: #161618;
  --bg-active: #2c2c2e;
  --border-hairline: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.06);

  --text-main: #f5f5f7;
  --text-secondary: #a1a1a6;
  --text-tertiary: #6e6e73;

  --accent: #2997ff;
  --accent-hover: #47a6ff;
  --accent-light: rgba(41, 151, 255, 0.12);

  --primary: #ffffff;
  --primary-hover: #f5f5f7;

  --badge-public-bg: #1e293b;
  --badge-public-text: #60a5fa;
  --badge-pass-bg: #3f2a0e;
  --badge-pass-text: #f59e0b;
  --badge-private-bg: #27272a;
  --badge-private-text: #a1a1aa;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 4px 18px -2px rgba(0, 0, 0, 0.4);
  --shadow-card-hover: 0 12px 30px -4px rgba(0, 0, 0, 0.6);
  --shadow-modal: 0 24px 60px -10px rgba(0, 0, 0, 0.7);
}

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

html, body {
  min-height: 100vh;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow-x: hidden;
  width: 100%;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(251, 251, 253, 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-hairline);
  transition: background-color 0.2s, border-color 0.2s;
  width: 100%;
}

.is-embedded .app-header {
  display: none !important;
}

[data-theme="dark"] .app-header {
  background: rgba(0, 0, 0, 0.82);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

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

/* Decks-style Logo (Clean text, no icon) */
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-main);
  cursor: pointer !important;
  user-select: none;
}

.brand-name {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
  white-space: nowrap;
  color: var(--text-main);
  line-height: 1;
}

.header-search {
  flex: 1;
  max-width: 440px;
  position: relative;
}

.search-input-wrap {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 38px;
  padding: 0 38px 0 36px;
  background: var(--bg-subtle);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  color: var(--text-main);
  font-family: inherit;
  transition: all 0.15s ease;
}

.search-input:focus {
  outline: none;
  background: var(--bg-card);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.search-kbd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  padding: 2px 6px;
  border-radius: 4px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.25);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-hairline);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-card);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  color: var(--text-secondary);
}

.btn-icon:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

/* User Pill & Separate Dropdown */
.user-menu-wrap {
  position: relative;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.user-pill:hover {
  border-color: var(--border-card);
  background: var(--bg-card);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}

.user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
  min-width: 300px !important;
  width: 320px !important;
  max-width: 360px !important;
  padding: 10px !important;
  z-index: 120;
}

.user-dropdown.active {
  display: flex;
  flex-direction: column;
}

.dropdown-user-info {
  padding: 10px 12px 14px;
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: 8px;
}

.dropdown-user-info strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-user-info small {
  font-size: 12.5px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 2px;
}

.dropdown-trial-pill {
  margin-top: 10px;
  font-size: 12px;
  color: #0284c7;
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.2);
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 500;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
}

.dropdown-trial-pill span {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.dropdown-trial-pill .pill-dot {
  opacity: 0.45;
  font-weight: 700;
  font-size: 11px;
}

.dropdown-trial-pill.expired {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.2);
}

.dropdown-trial-pill.active {
  color: #16a34a;
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.2);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap !important;
}

.dropdown-item:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.dropdown-item.upgrade-action {
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  font-weight: 600;
  margin-bottom: 4px;
}

.dropdown-item.upgrade-action:hover {
  background: rgba(37, 99, 235, 0.14);
  color: #1d4ed8;
}

.dropdown-item.danger {
  color: #d93025;
  border-top: 1px solid var(--border-hairline);
  margin-top: 4px;
}

.dropdown-item.danger:hover {
  background: #fce8e6;
  color: #c5221f;
}

[data-theme="dark"] .dropdown-item.danger:hover {
  background: #3c1414;
}

/* ==========================================================================
   Main Layout & Filters
   ========================================================================== */

.main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 80px;
  width: 100%;
}

.hero-dashboard {
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-title {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.18;
}

.hero-desc {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.5;
}

.tabs-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: 24px;
  padding-bottom: 12px;
  flex-wrap: wrap;
  gap: 16px;
}

.view-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.tab-btn.active {
  color: var(--accent);
  background: var(--accent-light);
}

.tab-count {
  font-size: 11px;
  font-family: var(--font-mono);
  background: var(--bg-subtle);
  color: var(--text-tertiary);
  padding: 2px 7px;
  border-radius: 10px;
}

.tab-btn.active .tab-count {
  background: var(--accent);
  color: #fff;
}

/* Tags Carousel */
.tags-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 16px;
  margin-bottom: 28px;
  scrollbar-width: none;
  width: 100%;
}

.tags-bar::-webkit-scrollbar {
  display: none;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}

.tag-chip:hover {
  border-color: var(--border-card);
  color: var(--text-main);
}

.tag-chip.active {
  background: var(--text-main);
  color: var(--bg-card);
  border-color: var(--text-main);
}

.tag-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

/* ==========================================================================
   Travel Guides Grid
   ========================================================================== */

.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 28px;
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

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

.guide-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-subtle);
  overflow: hidden;
}

.guide-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.guide-card:hover .guide-thumb {
  transform: scale(1.03);
}

.guide-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-country {
  background: rgba(29, 29, 31, 0.82);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.badge-vis {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
}

.badge-vis.public { background: var(--badge-public-bg); color: var(--badge-public-text); }
.badge-vis.password { background: var(--badge-pass-bg); color: var(--badge-pass-text); }
.badge-vis.private { background: var(--badge-private-bg); color: var(--badge-private-text); }

.guide-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.guide-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 6px;
  color: var(--text-main);
}

.guide-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.guide-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.guide-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-subtle);
  padding: 2px 7px;
  border-radius: 4px;
}

.guide-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-tertiary);
}

.guide-author {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.guide-dates {
  font-family: var(--font-mono);
}

/* Visibility Selector Cards (Decks Style) */
.vis-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.vis-card {
  padding: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  text-align: left;
}

.vis-card:hover {
  border-color: var(--border-card);
  background: var(--bg-card);
}

.vis-card.active {
  border-color: var(--accent);
  background: var(--accent-light);
}

.vis-card-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.vis-card-desc {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.3;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-card);
  border-radius: var(--radius-lg);
  grid-column: 1 / -1;
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.empty-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.empty-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ==========================================================================
   Modals & Dialogs (Decks Style)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-sheet {
  background: var(--bg-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  transform: scale(0.96);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
}

.modal-backdrop.active .modal-sheet {
  transform: scale(1);
}

.modal-header {
  padding: 22px 26px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-hairline);
}

.modal-title-group h3 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-title-group p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.modal-close-btn:hover {
  background: var(--border-hairline);
  color: var(--text-main);
}

.modal-body {
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.form-group .form-hint {
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-main);
  font-family: inherit;
  transition: border-color 0.15s, background-color 0.15s;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-card);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.modal-footer {
  padding: 16px 26px 22px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-hairline);
}

/* Google Sign-in Button (Decks Style) */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 18px;
  background: #ffffff;
  color: #3c4043;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid #dadce0;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.btn-google:hover {
  background: #f8f9fa;
  border-color: #c0c4cc;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

/* Request Account (Faded Outlined Button & Form) */
.btn-request-account {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-hairline);
  background: transparent;
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 18px;
  user-select: none;
}

.btn-request-account:hover {
  border-style: solid;
  border-color: var(--border-card);
  color: var(--text-main);
  background: var(--bg-subtle);
}

.req-account-banner {
  background: rgba(0, 113, 227, 0.08);
  border: 1px solid rgba(0, 113, 227, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-main);
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.req-account-banner-icon {
  font-size: 16px;
  line-height: 1;
}

.req-success-card {
  text-align: center;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.req-success-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
}

/* Generation Progress Box */
.gen-progress {
  display: none;
  padding: 24px;
  background: var(--accent-light);
  border: 1px solid rgba(0, 113, 227, 0.2);
  border-radius: var(--radius-md);
  text-align: center;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.gen-progress.active {
  display: flex;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(0, 113, 227, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #1d1d1f;
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-modal);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.25s ease;
}

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

/* ==========================================================================
   Mobile Responsiveness (Fixes screenshot 3)
   ========================================================================== */

@media (max-width: 768px) {
  .header-inner {
    padding: 0 16px;
    gap: 8px;
  }
  .header-search {
    display: none;
  }
  .user-name {
    display: none; /* Collapse text, keep avatar pill compact on mobile */
  }
  .user-pill {
    padding: 3px;
  }
  .btn-primary span {
    font-size: 13px;
  }
  .btn {
    height: 34px;
    padding: 0 12px;
  }
  .btn-icon {
    width: 34px;
    height: 34px;
  }
  .hero-title {
    font-size: 26px;
  }
  .main-container {
    padding: 20px 16px 80px;
  }
  .guides-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .vis-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Users Management Roster (Decks Superadmin Style)
   ========================================================================== */
.users-table-wrap {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
}

.users-table-head {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-hairline);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.users-list-body {
  max-height: 360px;
  overflow-y: auto;
}

.user-row {
  display: flex;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-hairline);
  transition: background 0.15s ease;
}

.user-row:last-child {
  border-bottom: none;
}

.user-row:hover {
  background: var(--bg-subtle);
}

.user-row-info {
  flex: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.user-avatar-small {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}

.user-avatar-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-meta-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-meta-col strong {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-meta-col small {
  font-size: 11.5px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-row-role {
  flex: 1;
  padding: 0 8px;
}

.user-row-sub {
  flex: 1.3;
  padding: 0 8px;
}

.user-role-select,
.user-sub-select {
  height: 34px;
  font-size: 12px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  color: var(--text-main);
  width: 100%;
  cursor: pointer;
}

.user-sub-select {
  font-size: 12px;
  padding: 0 8px;
  font-weight: 500;
}

.settings-nav-tabs {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--border-hairline);
  padding: 0 24px 14px;
}

.settings-tab-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.settings-tab-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.settings-tab-btn.active {
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
  border-color: rgba(37, 99, 235, 0.3);
  font-weight: 600;
}

.user-row-action {
  width: 65px;
  display: flex;
  justify-content: flex-end;
}

.btn-icon-danger {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.15s ease;
}

.btn-icon-danger:hover {
  background: #ef4444;
  color: #ffffff;
}

.badge-lock {
  font-size: 13px;
  opacity: 0.7;
}

/* Cover Selection Grid */
.cover-thumb-option {
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.cover-thumb-option:hover {
  transform: scale(1.03);
  border-color: var(--accent) !important;
}

/* ==========================================================================
   Auth Mode Tabs & 7-Day Trial Styling
   ========================================================================== */
.auth-mode-tabs {
  display: flex;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--border-hairline);
}

.auth-mode-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-mode-tab.active {
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.auth-tab-chip {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 9999px;
  background: rgba(0, 113, 227, 0.12);
  color: #0071e3;
  font-weight: 600;
}

.trial-signup-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(0, 113, 227, 0.06);
  border: 1px solid rgba(0, 113, 227, 0.18);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  text-align: left;
}

.trial-callout-sparkle {
  color: #0071e3;
  font-size: 16px;
  line-height: 1.2;
}

.trial-signup-callout strong {
  font-size: 13px;
  color: var(--text-main);
  display: block;
}

.trial-signup-callout p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 2px 0 0;
}

/* User Pill Subscription Badges */
.badge-sub-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

.badge-sub-pill.trial {
  background: rgba(0, 113, 227, 0.1);
  color: #0071e3;
}

.badge-sub-pill.expired {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
  cursor: pointer;
  animation: pulse 2s infinite;
}

.badge-sub-pill.active {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.dropdown-item.upgrade-action {
  color: #0071e3;
  font-weight: 600;
  background: rgba(0, 113, 227, 0.06);
  border-radius: 6px;
  margin: 4px 6px;
}

.dropdown-item.upgrade-action:hover {
  background: rgba(0, 113, 227, 0.12);
}

/* ==========================================================================
   Budget Guidance & Info Popover
   ========================================================================== */
.btn-info-icon {
  background: none;
  border: none;
  color: #0071e3;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.btn-info-icon:hover {
  background: rgba(0, 113, 227, 0.08);
}

.info-callout {
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.info-callout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.info-callout-header strong {
  color: var(--text-main);
  font-size: 13px;
}

.info-callout-close {
  background: none;
  border: none;
  font-size: 13px;
  color: var(--text-tertiary);
  cursor: pointer;
}

.info-examples-list {
  margin: 6px 0 4px 16px;
  padding: 0;
}

.info-examples-list li {
  margin-bottom: 4px;
}

.info-examples-list strong {
  color: var(--text-main);
}

/* ==========================================================================
   Upgrade Modal & Stripe Pricing
   ========================================================================== */
.upgrade-icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 113, 227, 0.1);
  color: #0071e3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 24px 20px 20px;
  margin-bottom: 18px;
  text-align: center;
}

.pricing-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(0, 113, 227, 0.1);
  color: #0071e3;
  padding: 3px 10px;
  border-radius: 9999px;
  margin-bottom: 12px;
}

.pricing-amount {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  line-height: 1;
}

.pricing-currency {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-main);
}

.pricing-num {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.pricing-interval {
  font-size: 14px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.pricing-tagline {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 8px 0 16px;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border-hairline);
  padding-top: 14px;
}

.pricing-features li {
  font-size: 13px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-checkout-stripe {
  width: 100%;
  height: 46px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #0071e3;
  border-color: #0071e3;
  border-radius: var(--radius-sm);
  color: #ffffff;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-checkout-stripe:hover {
  opacity: 0.92;
}
