/* Reset & tokens */
:root {
  --bg: #fff5f7;
  --card-bg: #ffffffcc;
  --card-shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
  --text: #2d1b24;
  --muted: #6c4657;
  --accent: #ff7aa2;
  --accent-strong: #ff6b9c;
  --border-soft: #ffe0eb;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font-family: inherit;
}

/* Layout wrapper */
.page {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(16px, 4vw, 48px);
  gap: clamp(16px, 3vw, 32px);
  background: var(--bg);
}

.page-hero,
.page-thanks {
  background: radial-gradient(circle at top, #ffe0eb 0, #fff5f7 40%, #ffffff 100%);
  justify-content: center;
}

.page-gifts {
  background: var(--bg);
  align-items: stretch;
}

/* ====== HERO (index.php) ====== */
.hero-card {
  width: min(1040px, 100%);
  padding: clamp(20px, 3vw, 36px);
  border-radius: 24px;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  box-shadow: var(--card-shadow);
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: clamp(16px, 3vw, 32px);
  align-items: center;
}

.hero-photo {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-photo img {
  width: min(320px, 70vw);
  height: min(320px, 70vw);
  object-fit: cover;
  border-radius: 999px;
  border: 4px solid #ffb6c9;
  box-shadow: 0 0 0 6px var(--border-soft);
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-tagline {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.8rem;
  color: var(--accent-strong);
  font-weight: 600;
}

.hero-text h1 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.25;
}

.hero-message {
  font-size: 1rem;
  color: #5c3a4a;
}

.hero-message p + p {
  margin-top: 8px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

/* ====== BUTTONS ====== */
.btn-primary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #ff7aa2, #ff9fb7);
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(255, 122, 162, 0.4);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 22px rgba(255, 122, 162, 0.45);
}

.btn-outline {
  background: transparent;
  border: 1.8px solid #ff9fb7;
  color: #d83d73;
}

.btn-outline:hover,
.btn-outline:focus-visible {
  background: #ffe0eb;
}

/* ====== GIFTS (gifts.php) ====== */
.top-bar,
.gifts-grid,
.gifts-footer {
  width: min(1080px, 100%);
  margin: 0 auto;
}

.top-bar {
  text-align: center;
}

.top-bar h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
  margin-bottom: 6px;
}

.top-bar p {
  font-size: 0.95rem;
  color: var(--muted);
}

.gift-category {
  margin-bottom: clamp(16px, 3vw, 28px);
}

.gift-category-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 10px;
  color: #5c3a4a;
}

.gifts-row {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.gift-card {
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  min-height: 100%;
}

.gift-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.08);
}

.gift-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f7dfe8;
}

.gift-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gift-body {
  padding: 12px 14px 8px;
  flex: 1;
}

.gift-body h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.gift-body p {
  font-size: 0.85rem;
  color: var(--muted);
}

.gift-select-btn {
  margin: 10px 14px 14px;
}

.gift-card.gift-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--border-soft);
}

.gifts-footer {
  margin-top: 12px;
  text-align: center;
}

/* ====== THANK YOU (thankyou.php) ====== */
.thanks-card {
  width: min(640px, 100%);
  background: var(--card-bg);
  border-radius: 24px;
  padding: clamp(20px, 4vw, 32px);
  text-align: center;
  backdrop-filter: blur(8px);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.05);
}

.thanks-tagline {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.8rem;
  color: var(--accent-strong);
  font-weight: 600;
  margin-bottom: 6px;
}

.thanks-card h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 8px;
}

.thanks-message {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.confirm-form {
  width: 100%;
}

.selected-list {
  text-align: left;
  margin: 10px auto 20px;
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.selected-title {
  font-weight: 700;
  font-size: 1rem;
  color: #4a2c38;
}

.selected-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.selected-group {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background: #fff;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.selected-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.selected-group-title {
  font-weight: 600;
  color: #4a2c38;
}

.selected-group-count {
  font-size: 0.85rem;
  color: var(--muted);
}

.selected-group-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.selected-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.04);
}

.selected-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff7aa2, #ff9fb7);
  color: #fff;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.selected-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.selected-name {
  font-weight: 600;
  font-size: 1rem;
}

.selected-desc {
  font-size: 0.9rem;
  color: #5c3a4a;
  line-height: 1.5;
}

.no-selection {
  font-size: 0.9rem;
  color: #7a5062;
  text-align: center;
  margin-bottom: 10px;
}

.btn-chip {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
}

/* Utilities
   -------------------------------------------------- */
.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-block {
  width: 100%;
}

.button-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

/* Responsif */
@media (max-width: 1024px) {
  .hero-card {
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .hero-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-text {
    align-items: center;
  }

  .hero-actions {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .hero-card {
    padding: 18px;
  }

  .hero-photo img {
    width: min(260px, 80vw);
    height: min(260px, 80vw);
  }

  .thanks-card {
    padding: 18px 16px;
  }

  .gifts-row {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 520px) {
  .hero-actions .btn-primary,
  .hero-actions .btn-outline,
  .gifts-footer .btn-primary,
  .thanks-card .btn-primary,
  .thanks-card .btn-outline {
    width: 100%;
  }

  .gift-select-btn {
    width: calc(100% - 28px);
  }
}

/* ====== ADMIN PAGE (admin.php) ====== */
.admin-panel {
  width: min(1100px, 100%);
  background: var(--card-bg);
  border-radius: 28px;
  padding: clamp(20px, 4vw, 36px);
  text-align: left;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(8px);
}

.admin-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: clamp(18px, 3vw, 28px);
}

.admin-section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.admin-section-title {
  font-size: 1rem;
  color: #4a2c38;
}

.admin-gift-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-gift-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background: #fff;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.04);
}

.admin-gift-thumb {
  width: 70px;
  height: 70px;
  border-radius: 16px;
  overflow: hidden;
  background: #f7dfe8;
  flex-shrink: 0;
}

.admin-gift-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-gift-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-gift-name {
  font-weight: 600;
  font-size: 1rem;
}

.admin-gift-meta {
  font-size: 0.86rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-gift-desc {
  font-size: 0.88rem;
  color: #5c3a4a;
  white-space: pre-wrap;
}

.admin-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ffe0eb;
  font-size: 0.8rem;
  color: #c2185b;
}

.admin-chip.neutral {
  background: #f5f5f5;
  color: #7a5062;
}

.admin-gift-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 160px;
}

.admin-gift-count {
  text-align: right;
  font-weight: 600;
  color: #4a2c38;
}

.admin-gift-count span {
  font-size: 1.4rem;
  display: block;
}

.admin-gift-count small {
  font-size: 0.8rem;
  color: var(--muted);
}

.admin-gift-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-gift-action {
  font-size: 0.86rem;
  color: #d83d73;
  text-decoration: underline;
}

.admin-gift-action.reset {
  color: #8e44ad;
}

.admin-gift-action.delete {
  color: #c0392b;
}

.admin-log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-log-item {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #f5d4e3;
  align-items: center;
}

.admin-log-number {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  background: #ffe0eb;
  color: #c2185b;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-log-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-log-entry-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-log-time {
  font-size: 0.85rem;
  color: var(--muted);
}

.admin-log-gifts {
  margin: 0;
  padding-left: 20px;
  list-style: disc;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
  color: #4a2c38;
}

.admin-log-gifts li {
  line-height: 1.4;
}

@media (max-width: 900px) {
  .admin-gift-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .admin-gift-side {
    grid-column: span 2;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (max-width: 600px) {
  .admin-gift-item {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .admin-gift-thumb {
    width: 60px;
    height: 60px;
  }

  .admin-gift-side {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-gift-actions {
    justify-content: flex-start;
  }
}
