/* Design System Variables */
:root {
  --bg: #0B0B0F;
  --bg2: #12121A;
  --gold: #F5C451;
  --goldSoft: #FFF0C9;
  --accent: var(--gold);
  --accent2: var(--goldSoft);
  --card: rgba(255,255,255,0.06);
  --glass: rgba(255,255,255,0.12);
  --text: #F3F4F6;
  --muted: #B3B7C0;
  --ripple-color: #F5C451;
  --ripple-opacity: 0.35;
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(80vw 40vh at 85% 10%, rgba(245,196,81,0.10) 0%, rgba(245,196,81,0.00) 70%),
    radial-gradient(60vw 35vh at 15% 25%, rgba(255,240,201,0.10) 0%, rgba(255,240,201,0.00) 65%),
    radial-gradient(160vw 120vh at 50% 120%, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.00) 85%),
    var(--bg);
  background-attachment: fixed, fixed, fixed, scroll;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Bottom Halo */
body::after {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  bottom: -24px;
  height: 220px;
  pointer-events: none;
  background: radial-gradient(65% 180px at 50% 100%,
    rgba(245,196,81,0.12) 0%,
    rgba(255,240,201,0.06) 38%,
    rgba(0,0,0,0) 82%
  );
  filter: blur(28px);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 70%);
  mask-image: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 70%);
  z-index: 0;
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px;
  position: relative;
  z-index: 1;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 40px;
}

.admin-title {
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: 48px;
  background: linear-gradient(90deg, #F5C451, #FFF0C9);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.muted {
  color: var(--muted);
  font-size: 16px;
}

/* Filters Section */
.filters-section {
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-bar {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.search-bar .material-symbols-rounded {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-input {
  padding-left: 48px !important;
  width: 100%;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.filter-btn {
  transition: all 0.3s ease;
}

.filter-btn.active {
  background: rgba(245,196,81,0.15);
  border-color: rgba(245,196,81,0.45);
  color: var(--gold);
  box-shadow: 0 6px 20px rgba(245,196,81,0.25);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(245,196,81,0.25);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.stat-card .material-symbols-rounded {
  font-size: 40px;
  color: var(--gold);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
}

/* Input */
.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  outline: none;
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.input::placeholder {
  color: rgba(243,244,246,0.55);
}

.input:focus {
  border-color: rgba(245,196,81,0.55);
  box-shadow: 0 0 0 2px rgba(245,196,81,0.25);
  background: rgba(255,255,255,0.075);
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  border: 1px solid rgba(245,196,81,0.25);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(245,196,81,0.45);
  box-shadow: 0 4px 12px rgba(245,196,81,0.2);
}

.btn:active {
  transform: translateY(0);
}

/* Loader */
.loader {
  text-align: center;
  padding: 60px 20px;
}

.spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto 20px;
  border: 4px solid rgba(245,196,81,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Gifts Grid */
.gifts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.gift-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gift-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245,196,81,0.35);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4), 0 0 20px rgba(245,196,81,0.2);
}

.gift-image-wrapper {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.gift-image {
  width: 80%;
  height: 80%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.gift-card:hover .gift-image {
  transform: scale(1.1);
}

.gift-type-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.1);
}

.gift-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gift-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gift-description {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gift-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.diamond-price {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  font-size: 18px;
  color: var(--gold);
}

.gift-id {
  font-size: 11px;
  color: var(--muted);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.empty-state .material-symbols-rounded {
  font-size: 80px;
  color: var(--muted);
  opacity: 0.5;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--text);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(600px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg2);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 16px;
  padding: 0;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  position: sticky;
  top: 0;
  background: var(--bg2);
  z-index: 10;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 700;
}

.btn-close {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.btn-close:hover {
  background: rgba(255,255,255,0.1);
}

.modal-content {
  padding: 20px;
}

.modal-content img {
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 auto 24px;
  display: block;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  padding: 20px;
}

.modal-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--card);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
}

.detail-label {
  font-weight: 600;
  color: var(--muted);
  font-size: 13px;
}

.detail-value {
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

code.copy {
  cursor: pointer;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 6px 12px;
  border-radius: 6px;
  user-select: none;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  transition: all 0.2s ease;
}

code.copy:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(245,196,81,0.3);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 12px;
  background: rgba(30, 30, 40, 0.95);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 10px 28px rgba(0,0,0,0.6);
  transform: translateY(100px);
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
  z-index: 1200;
  font-weight: 600;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.hidden {
  display: none;
}

/* Utility */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-title {
    font-size: 36px;
  }
  
  .gifts-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  
  .filter-buttons {
    flex-direction: column;
  }
  
  .filter-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 24px 16px;
  }
  
  .admin-title {
    font-size: 28px;
  }
  
  .gifts-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
