/* SlamBook — App Styles */

:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --secondary: #ec4899;
  --accent: #06b6d4;
  --grad-main: linear-gradient(135deg, #6366f1 0%, #ec4899 50%, #f59e0b 100%);
  --grad-card: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --shadow-color: rgba(99, 102, 241, 0.25);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', sans-serif;
  background: #f8f7ff;
  color: #1e1b4b;
  overflow-x: hidden;
}

/* ── Typography ────────────────────────────────────── */
.font-display { font-family: 'Bricolage Grotesque', sans-serif; }

/* ── Gradient Text ─────────────────────────────────── */
.gradient-text {
  background: var(--grad-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Buttons ────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #ec4899);
  color: white;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  border: none;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary-light);
  font-weight: 700;
  border-radius: 999px;
  padding: 0.6rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Nunito', sans-serif;
}
.btn-secondary:hover { background: #ede9fe; }

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  border: none;
  font-family: 'Nunito', sans-serif;
}

/* ── Cards ──────────────────────────────────────────── */
.card {
  background: white;
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.1);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(99, 102, 241, 0.18);
}

.slam-card {
  background: white;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border: 1px solid rgba(99, 102, 241, 0.1);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
.slam-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.2);
}
.slam-card .card-header {
  height: 6px;
  background: var(--grad-main);
}
.slam-card.fav .card-header {
  background: linear-gradient(90deg, #f59e0b, #ec4899);
}

/* ── Avatar ─────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}
.avatar-placeholder {
  background: var(--grad-main);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-family: 'Bricolage Grotesque', sans-serif;
}

/* ── Navigation ─────────────────────────────────────── */
.nav-bar {
  background: white/90;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(99, 102, 241, 0.12);
  position: sticky;
  top: 0;
  z-index: 100;
}

.bottom-nav {
  background: white;
  border-top: 1px solid rgba(99, 102, 241, 0.1);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  color: #9ca3af;
  transition: all 0.2s;
  cursor: pointer;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.bottom-nav .nav-item.active {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
}
.bottom-nav .nav-item .nav-icon { font-size: 22px; }

/* ── Forms ──────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.875rem;
  color: #4c1d95;
  margin-bottom: 0.4rem;
}
.form-input {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  transition: all 0.2s;
  background: #fafafa;
  color: #1e1b4b;
  outline: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  background: white;
}
.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* ── Rating Stars ───────────────────────────────────── */
.rating-stars {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-start;
}
.rating-stars .star {
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.15s;
  filter: grayscale(1);
  opacity: 0.3;
  width: auto;
  min-width: 0;
  text-align: center;
}
.rating-stars .star.active {
  filter: none;
  opacity: 1;
  transform: scale(1.1);
}

@media (max-width: 767px) {
  .rating-stars {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }
  .rating-stars .star {
    font-size: 1.2rem;
    min-width: 0;
    width: 100%;
    padding: 4px 0;
  }
}

@media (min-width: 768px) {
  .rating-stars {
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
  .rating-stars .star {
    width: auto;
    min-width: 0;
  }
}

/* ── Stat Chips ─────────────────────────────────────── */
.stat-chip {
  background: linear-gradient(135deg, #ede9fe, #fce7f3);
  border-radius: 50px;
  padding: 0.5rem 1.1rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: #4c1d95;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ── Hero gradient bg ───────────────────────────────── */
.hero-bg {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 30%, #ec4899 70%, #f59e0b 100%);
  position: relative;
  overflow: hidden;
}
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Ccircle cx='30' cy='30' r='4'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-bg > * {
  position: relative;
  z-index: 1;
}

/* ── Emoji selector ─────────────────────────────────── */
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}
.emoji-btn {
  font-size: 1.4rem;
  padding: 6px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  background: none;
  text-align: center;
}
.emoji-btn:hover { background: #ede9fe; transform: scale(1.2); }
.emoji-btn.selected { border-color: var(--primary); background: #ede9fe; }

/* ── Photo upload ───────────────────────────────────── */
.photo-drop-zone {
  border: 2.5px dashed #c4b5fd;
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #faf5ff;
}
.photo-drop-zone:hover, .photo-drop-zone.drag-over {
  border-color: var(--primary);
  background: #ede9fe;
}

/* ── QR Code ────────────────────────────────────────── */
.qr-container {
  padding: 1rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  display: inline-block;
}

/* ── Timeline ───────────────────────────────────────── */
.timeline-item { position: relative; padding-left: 2.5rem; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: -1rem;
  width: 2px;
  background: linear-gradient(to bottom, #6366f1, #ec4899);
}
.timeline-dot {
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 22px;
  height: 22px;
  background: var(--grad-main);
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 2px 8px var(--shadow-color);
}

/* ── Toasts ─────────────────────────────────────────── */
.toast {
  background: white;
  border-radius: 14px;
  padding: 0.75rem 1rem;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  pointer-events: auto;
  animation: slideInToast 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-left: 4px solid var(--primary);
}
.toast.success { border-color: #10b981; }
.toast.error   { border-color: #ef4444; }
.toast.info    { border-color: #06b6d4; }

@keyframes slideInToast {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOutToast {
  to { transform: translateX(100%); opacity: 0; }
}

/* ── Skeleton ───────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ── Search bar ─────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  gap: 8px;
  transition: all 0.2s;
}
.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.search-bar input {
  border: none;
  outline: none;
  flex: 1;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  background: transparent;
  color: #1e1b4b;
}

/* ── Share card ─────────────────────────────────────── */
.share-card {
  background: var(--grad-main);
  border-radius: 24px;
  padding: 2rem;
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.share-card::after {
  content: '📖';
  position: absolute;
  font-size: 8rem;
  opacity: 0.1;
  bottom: -1rem;
  right: -1rem;
  transform: rotate(-15deg);
}

/* ── Page transitions ───────────────────────────────── */
.page { animation: pageFadeIn 0.3s ease-out; }
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Progress bar ───────────────────────────────────── */
.progress-bar {
  height: 4px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--grad-main);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ── Confetti animation ─────────────────────────────── */
@keyframes confettiFall {
  0%   { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
  pointer-events: none;
  z-index: 9999;
}

/* ── Responsive ─────────────────────────────────────── */
@media (min-width: 768px) {
  .bottom-nav { display: none !important; }
}
@media (max-width: 767px) {
  #app-content { padding-bottom: 80px; }
}

/* ── Color picker swatch ────────────────────────────── */
.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s;
}
.color-swatch.selected { border-color: #1e1b4b; transform: scale(1.15); }

/* ── Chip filters ───────────────────────────────────── */
.filter-chip {
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  border: 2px solid #e5e7eb;
  background: white;
  color: #6b7280;
  transition: all 0.2s;
}
.filter-chip.active {
  background: linear-gradient(135deg, #6366f1, #ec4899);
  color: white;
  border-color: transparent;
}

/* ── Overflow scroll hidden scrollbar ──────────────── */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
