/* ─── Reset & Base ─────────────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #0d0d1a;
  --color-surface: #1a1a2e;
  --color-primary: #ff2d55;
  --color-primary-glow: rgba(255, 45, 85, 0.6);
  --color-text: #f0f0f5;
  --color-text-muted: #8888aa;
  --color-accent: #ff6b9d;
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius: 16px;
}

html, body {
  height: 100%;
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.hidden {
  display: none !important;
}

/* ─── Modal ────────────────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: var(--color-surface);
  border: 1px solid rgba(255, 45, 85, 0.3);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 40px var(--color-primary-glow);
  animation: slideUp 0.4s ease;
}

.modal-content h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.modal-content p {
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.form-group input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 2px solid rgba(255, 45, 85, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--color-primary);
}

.btn-primary {
  width: 100%;
  padding: 0.9rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary), #ff6b9d);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--color-primary-glow);
}

.btn-primary:active {
  transform: scale(0.97);
}

/* ─── App Layout ───────────────────────────────────────────────────────── */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(26, 26, 46, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
}

.user-badge {
  font-size: 0.85rem;
  color: var(--color-accent);
  background: rgba(255, 45, 85, 0.15);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
}

/* ─── Heart Button ─────────────────────────────────────────────────────── */
.heart-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 3rem;
}

.heart-btn {
  position: relative;
  width: 180px;
  height: 180px;
  border: none;
  background: radial-gradient(circle, rgba(255, 45, 85, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease;
  -webkit-user-select: none;
  user-select: none;
  outline: none;
}

.heart-btn::before {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--color-primary-glow) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 0;
}

.heart-btn:hover::before {
  opacity: 1;
}

.heart-icon {
  font-size: 6rem;
  z-index: 1;
  filter: drop-shadow(0 0 20px var(--color-primary-glow));
  transition: filter 0.2s;
}

/* Tap animation classes */
.heart-btn.tapped {
  animation: heartPulse 0.4s ease-out;
}

.heart-btn.tapped .heart-icon {
  animation: heartColorPulse 0.4s ease-out;
}

@keyframes heartPulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.35); }
  50% { transform: scale(0.95); }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes heartColorPulse {
  0% { filter: drop-shadow(0 0 20px var(--color-primary-glow)); }
  30% { filter: drop-shadow(0 0 50px rgba(255, 45, 85, 0.9)) brightness(1.3); }
  100% { filter: drop-shadow(0 0 20px var(--color-primary-glow)); }
}

.tap-hint {
  margin-top: 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  text-align: center;
}

/* ─── Feed ─────────────────────────────────────────────────────────────── */
.feed-section {
  width: 100%;
  max-width: 500px;
}

.feed-section h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--color-text-muted);
  text-align: center;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.feed-empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: 2rem;
  font-style: italic;
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  animation: feedSlideIn 0.3s ease-out;
}

.feed-item.new {
  animation: feedSlideInNew 0.5s ease-out;
  border-color: rgba(255, 45, 85, 0.3);
}

.feed-item-emoji {
  font-size: 1.5rem;
}

.feed-item-info {
  flex: 1;
}

.feed-item-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.feed-item-time {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

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

@keyframes feedSlideInNew {
  0% { opacity: 0; transform: translateX(-20px); background: rgba(255, 45, 85, 0.2); }
  50% { background: rgba(255, 45, 85, 0.15); }
  100% { opacity: 1; transform: translateX(0); background: var(--color-surface); }
}

/* ─── Footer ───────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1rem;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ─── Toast ────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-surface);
  border: 1px solid rgba(255, 45, 85, 0.3);
  color: var(--color-text);
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  font-size: 0.9rem;
  z-index: 2000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  animation: toastIn 0.3s ease;
  white-space: nowrap;
}

.toast.hiding {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

/* ─── Global Animations ────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* ─── Responsive ───────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .heart-btn {
    width: 220px;
    height: 220px;
  }
  .heart-icon {
    font-size: 7.5rem;
  }
  main {
    padding: 3rem 2rem;
  }
}
