/* ============================================
   TOKENS — dark, Play-Store + App Store hybrid
   ============================================ */
:root {
  --bg: #0F1115;
  --surface: #16181E;
  --surface-2: #1E2128;
  --surface-3: #252931;
  --border: #2C3038;
  --border-subtle: #1E2128;
  --text: #E3E5E8;
  --text-secondary: #B0B5BD;
  --text-dim: #8B919A;
  --accent: #4285F4;
  --accent-hover: #5A95F5;
  --accent-soft: rgba(66, 133, 244, 0.12);
  --green: #34A853;
  --gold: #FBBC05;
  --red: #EA4335;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --display: 'Google Sans', 'Roboto', system-ui, -apple-system, sans-serif;
  --body: 'Roboto', system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="light"] {
  --bg: #F8F9FA;
  --surface: #FFFFFF;
  --surface-2: #F1F3F4;
  --surface-3: #E8EAED;
  --border: #DADCE0;
  --border-subtle: #F1F3F4;
  --text: #202124;
  --text-secondary: #5F6368;
  --text-dim: #70757A;
  --shadow-sm: 0 1px 2px rgba(60,64,67,0.1);
  --shadow: 0 4px 12px rgba(60,64,67,0.15);
  --shadow-lg: 0 12px 40px rgba(60,64,67,0.2);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

* { box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.skip-link {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 10px 20px;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  z-index: 1000;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
  outline: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

button, a, input, select, textarea, .app-row, .cat-chip, .detail-close, .close-x {
  min-height: 44px;
  min-width: 44px;
}

/* ============================================
   TOPBAR — scroll-driven shrink (CSS + JS fallback)
   ============================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(15, 17, 21, 0.92);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border-subtle);
  transition: box-shadow var(--transition), padding var(--transition);
}

.topbar.scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  transition: padding var(--transition);
}

.topbar.scrolled .topbar-inner {
  padding: 8px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  text-decoration: none;
  color: inherit;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.brand-name {
  font-family: var(--display);
  font-size: clamp(16px, 2.5vw, 19px);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.search-shell {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 8px 14px;
  color: var(--text-dim);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-shell:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-shell input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  min-height: 32px;
  padding: 0;
}

.search-shell input::placeholder { color: var(--text-dim); }

.ai-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 0 4px 12px;
  border-left: 1px solid var(--border);
  user-select: none;
  min-height: 32px;
}

.ai-toggle input {
  accent-color: var(--accent);
  cursor: pointer;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
}

.ai-toggle.active { color: var(--accent); }
.ai-toggle.active .ai-label { text-shadow: 0 0 12px var(--accent); }

.list-app-btn {
  font-family: var(--display);
  font-size: 13.5px;
  font-weight: 500;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 24px;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.list-app-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.list-app-btn:active {
  transform: translateY(0);
}

.list-app-btn .btn-icon {
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
}

.tabs {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 4px;
  padding: 0 20px;
}

.tab {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  padding: 10px 14px;
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  border-radius: 0;
  transition: color var(--transition-fast), border-color var(--transition-fast);
  position: relative;
}

.tab:hover { color: var(--text-secondary); }

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab:focus-visible {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

@media (max-width: 640px) {
  .topbar-inner {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 14px;
  }
  .brand { order: 1; }
  .list-app-btn { order: 2; padding: 8px 14px; }
  .list-app-btn .btn-text { display: none; }
  .list-app-btn .btn-icon { display: block; font-size: 20px; }
  .search-shell { order: 3; flex-basis: 100%; }
  .tabs { padding: 0 14px; }
  .tab { padding: 8px 10px; font-size: 13px; }
}

@media (max-width: 360px) {
  .ai-label { display: none; }
}

/* ============================================
   MAIN
   ============================================ */
.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 20px 80px;
}

.category-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 14px;
  margin-bottom: 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.category-rail::-webkit-scrollbar { display: none; }

.cat-chip {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
  user-select: none;
}

.cat-chip:hover {
  background: var(--surface-2);
  border-color: var(--text-dim);
}

.cat-chip:active {
  transform: scale(0.96);
}

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

.cat-chip:focus-visible {
  transform: scale(1.02);
}

.section-label {
  font-family: var(--display);
  font-size: clamp(20px, 3vw, 24px);
  font-weight: 500;
  margin: 8px 0 16px;
  letter-spacing: -0.01em;
}

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.skeleton-icon {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-line {
  height: 14px;
  width: 60%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-line.short {
  width: 35%;
  height: 12px;
}

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

@media (prefers-reduced-motion: reduce) {
  .skeleton-icon, .skeleton-line {
    animation: none;
    background: var(--surface-2);
  }
}

/* ============================================
   APP LIST — Play-Store row style
   ============================================ */
.app-list {
  display: flex;
  flex-direction: column;
}

.app-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast), transform var(--transition-fast);
  position: relative;
  outline: none;
}

.app-row:hover {
  background: var(--surface);
}

.app-row:active {
  transform: scale(0.995);
}

.app-row:focus-visible {
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--accent);
}

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

.app-icon {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  box-shadow: var(--shadow-sm);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.app-meta {
  flex: 1;
  min-width: 0;
}

.app-name {
  font-family: var(--display);
  font-size: 15.5px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-tagline {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-sub {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.star-icon {
  color: var(--gold);
  font-size: 13px;
}

.rating-text {
  color: var(--text-secondary);
  font-weight: 500;
}

.review-count {
  color: var(--text-dim);
}

.match-note {
  font-size: 11px;
  color: var(--accent);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.match-note::before {
  content: "✦";
  font-size: 9px;
  opacity: 0.7;
}

.app-price {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  min-width: 70px;
  text-align: right;
  padding: 4px 0;
}

.app-price.free { color: var(--green); }
.app-price.paid { color: var(--red); }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-dim);
}

.empty-state .headline {
  font-family: var(--display);
  font-size: 20px;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 500;
}

.empty-state .sub {
  font-size: 14px;
  line-height: 1.5;
  max-width: 400px;
  margin: 0 auto;
}

.empty-state .empty-cta {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.empty-state .empty-cta:hover {
  background: var(--surface-3);
  border-color: var(--text-dim);
}

/* ============================================
   DETAIL PANEL — product page
   ============================================ */
.detail-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  display: none;
  overflow-y: auto;
  opacity: 0;
  transition: opacity var(--transition-slow);
}

.detail-overlay.open {
  display: block;
  opacity: 1;
}

.detail-panel {
  max-width: 780px;
  margin: 0 auto;
  padding: 16px 20px 80px;
  transform: translateY(20px);
  transition: transform var(--transition-slow);
}

.detail-overlay.open .detail-panel {
  transform: translateY(0);
}

.detail-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  padding: 8px 0 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.detail-close:hover { color: var(--text); }

.detail-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.detail-icon {
  width: 96px;
  height: 96px;
  min-width: 96px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 34px;
  color: #fff;
  box-shadow: var(--shadow);
  text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.detail-title {
  font-family: var(--display);
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 500;
  margin: 0 0 4px;
  line-height: 1.2;
}

.detail-dev {
  color: var(--accent);
  font-size: 13.5px;
  margin-bottom: 10px;
  font-weight: 500;
}

.detail-stats {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 12px;
  color: var(--text-dim);
  min-width: 56px;
}

.stat .val {
  font-family: var(--display);
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
}

.stat .star-val {
  color: var(--gold);
}

.detail-actions {
  margin: 24px 0 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.install-btn {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: 24px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 48px;
}

.install-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(66, 133, 244, 0.35);
}

.install-btn:active {
  transform: translateY(0);
}

.install-btn.disabled {
  background: var(--surface-2);
  color: var(--text-dim);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.link-note {
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

.link-note::before {
  content: "ⓘ";
  font-size: 14px;
  color: var(--text-dim);
}

.detail-section {
  margin-top: 32px;
}

.detail-section h3 {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 12px;
  color: var(--text);
}

.detail-desc {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0 0 10px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.detail-tag {
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--text-dim);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.detail-tag:hover {
  background: var(--surface-2);
  border-color: var(--text-dim);
}

.screenshot-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.screenshot-row::-webkit-scrollbar { height: 4px; }
.screenshot-row::-webkit-scrollbar-track { background: transparent; }
.screenshot-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.screenshot-card {
  width: 180px;
  height: 320px;
  min-width: 180px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  text-align: center;
  padding: 16px;
  position: relative;
  overflow: hidden;
  scroll-snap-align: start;
  transition: transform var(--transition-fast);
}

.screenshot-card:hover {
  transform: scale(1.02);
}

.screenshot-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 40%, rgba(0,0,0,0.15) 100%);
  pointer-events: none;
}

.screenshot-card .ss-label {
  position: relative;
  z-index: 1;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.screenshot-card .ss-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
  opacity: 0.3;
}

@media (max-width: 640px) {
  .detail-header { gap: 14px; }
  .detail-icon { width: 72px; height: 72px; min-width: 72px; font-size: 26px; border-radius: 18px; }
  .detail-stats { gap: 14px; }
  .screenshot-card { width: 150px; height: 266px; min-width: 150px; }
}

/* ============================================
   SUBMIT MODAL
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
  opacity: 0;
  transition: opacity var(--transition);
}

.modal-overlay.open {
  display: flex;
  opacity: 1;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 28px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-slow);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal h2 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 4px;
}

.modal .sub {
  font-size: 13.5px;
  color: var(--text-dim);
  margin: 0 0 20px;
  line-height: 1.4;
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 500;
}

.field-hint {
  text-transform: none;
  letter-spacing: normal;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: var(--surface-2);
  color: var(--text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  font-family: var(--body);
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--text-dim);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

.field textarea { resize: vertical; min-height: 70px; }

.field input:user-invalid,
.field select:user-invalid,
.field textarea:user-invalid {
  border-color: var(--red);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.btn-ghost {
  font-size: 14px;
  background: none;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 24px;
  cursor: pointer;
  font-family: var(--body);
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  min-height: 44px;
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--text-dim);
}

.btn-primary {
  font-size: 14px;
  font-weight: 500;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 24px;
  cursor: pointer;
  font-family: var(--body);
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 44px;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.close-x {
  position: absolute;
  top: 16px;
  right: 18px;
  cursor: pointer;
  color: var(--text-dim);
  background: none;
  border: none;
  font-size: 18px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.close-x:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* Firefox */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* ============================================
   AUTH BUTTON & AUTH MODAL STYLES
   ============================================ */
.auth-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 24px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--body);
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
  min-height: 40px;
}

.auth-btn:hover {
  background: var(--surface-3);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.auth-btn-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  gap: 8px;
}

.auth-tab {
  flex: 1;
  padding: 10px 14px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.auth-error-msg {
  background: rgba(229, 72, 77, 0.12);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* Icon Buttons (Theme Switcher, Developer Dashboard) */
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.icon-btn:hover {
  background: var(--surface-3);
  border-color: var(--accent);
  transform: scale(1.05);
}

/* Rating Breakdown Bars */
.rating-breakdown-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin: 16px 0 24px;
  display: flex;
  gap: 20px;
  align-items: center;
}

.rating-score-box {
  text-align: center;
  min-width: 90px;
}

.rating-big-num {
  font-family: var(--display);
  font-size: 42px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.rating-stars-inline {
  color: var(--gold);
  font-size: 14px;
  margin: 4px 0;
}

.rating-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rating-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.rating-bar-track {
  flex: 1;
  height: 8px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
}

.rating-bar-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 4px;
}

/* Reviews List */
.review-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
}

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

.review-author {
  font-weight: 500;
  font-size: 13.5px;
  color: var(--text);
}

.review-stars {
  color: var(--gold);
  font-size: 12px;
}

.review-comment {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Review Submission Form */
.review-form {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
}

.star-rating-select {
  display: flex;
  gap: 6px;
  margin: 8px 0 12px;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-dim);
}

.star-rating-select span.selected,
.star-rating-select span.hover {
  color: var(--gold);
}

/* Developer Dashboard Apps List */
.dev-app-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
}

.dev-app-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dev-app-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  color: #fff;
}

.dev-app-actions {
  display: flex;
  gap: 8px;
}

.btn-danger-sm {
  background: rgba(234, 67, 53, 0.15);
  color: var(--red);
  border: 1px solid var(--red);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.btn-danger-sm:hover {
  background: var(--red);
  color: #fff;
}

.btn-ghost-sm {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.btn-ghost-sm:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================
   SECONDARY ACTION BUTTONS (detail panel: copy link, badge, report)
   ============================================ */
.secondary-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.secondary-action-btn:hover {
  background: var(--surface-2);
  border-color: var(--text-dim);
}

.secondary-action-btn.subtle {
  color: var(--text-dim);
}

.secondary-action-btn.subtle:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ============================================
   BADGE PREVIEW
   ============================================ */
.badge-preview {
  margin: 4px 0 16px;
  padding: 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm, 10px);
  display: flex;
  justify-content: center;
}

#badge-snippet {
  font-family: monospace;
  font-size: 12px;
  resize: vertical;
}

/* ============================================
   TOAST
   ============================================ */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 22px;
  border-radius: 24px;
  font-size: 13.5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 500;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: 90vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   DEV DASHBOARD TABS (My Apps / Reports)
   ============================================ */
.dev-dash-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  gap: 8px;
}

.dev-dash-tab {
  padding: 10px 14px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.dev-dash-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.reports-count-badge {
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.4;
}

.backup-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}


