/* ========================================
   DROPZONE — Dark Glassmorphism UI
   Palette: #0D0D0F base | #7C3AED violet | #06B6D4 cyan | #F472B6 pink
   ======================================== */

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

:root {
  --bg:        #0D0D0F;
  --bg2:       #141418;
  --bg3:       #1C1C24;
  --glass:     rgba(255,255,255,0.05);
  --glass2:    rgba(255,255,255,0.08);
  --border:    rgba(255,255,255,0.10);
  --violet:    #7C3AED;
  --violet-l:  #A855F7;
  --cyan:      #06B6D4;
  --pink:      #F472B6;
  --green:     #22D3EE;
  --text:      #F1F0F5;
  --text-sub:  #8B8A9A;
  --radius:    16px;
  --radius-lg: 24px;
  --shadow:    0 8px 32px rgba(0,0,0,0.6);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- BACKGROUND AMBIENT ---- */
body::before {
  content: '';
  position: fixed;
  top: -200px; left: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(124,58,237,0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(6,182,212,0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ---- NAVBAR ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 32px;
  background: rgba(13,13,15,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-icon { font-size: 24px; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.logo-text {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(90deg, var(--violet-l), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-tabs {
  display: flex;
  gap: 8px;
  flex: 1;
  justify-content: center;
}
.tab-btn {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.tab-btn:hover { background: var(--glass2); color: var(--text); }
.tab-btn.active {
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  border-color: transparent;
  color: #fff;
}
.admin-tab { border-color: rgba(244,114,182,0.3); color: var(--pink); }
.admin-tab:hover { background: rgba(244,114,182,0.1); color: var(--pink); }

/* ---- RANDOM SOUND BTN ---- */
.random-sound-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #F472B6, #7C3AED);
  border: none;
  border-radius: 999px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 0 20px rgba(244,114,182,0.4);
}
.random-sound-btn:hover { transform: scale(1.05); box-shadow: 0 0 30px rgba(244,114,182,0.6); }
.random-sound-btn:active { transform: scale(0.97); }
.btn-icon { font-size: 18px; }

/* ---- HERO / DROP ZONE ---- */
.hero { padding: 48px 32px 24px; position: relative; z-index: 1; }

.drop-area {
  max-width: 680px;
  margin: 0 auto;
  border: 2px dashed rgba(124,58,237,0.5);
  border-radius: var(--radius-lg);
  background: var(--glass);
  backdrop-filter: blur(12px);
  transition: all 0.3s;
  cursor: pointer;
}
.drop-area.drag-over {
  border-color: var(--cyan);
  background: rgba(6,182,212,0.08);
  transform: scale(1.01);
}

.drop-inner {
  padding: 48px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

/* RADAR ANIMATION */
.drop-icon-anim {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.radar-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--violet-l);
  animation: radar 2.5s ease-out infinite;
}
.ring1 { width: 40px; height: 40px; animation-delay: 0s; }
.ring2 { width: 70px; height: 70px; animation-delay: 0.5s; }
.ring3 { width: 100px; height: 100px; animation-delay: 1s; }
@keyframes radar {
  0%   { opacity: 0.8; transform: scale(0.8); }
  100% { opacity: 0; transform: scale(1.2); }
}
.drop-center-icon { font-size: 36px; z-index: 2; position: relative; }

.drop-title {
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(90deg, #fff, var(--violet-l));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.drop-subtitle { font-size: 15px; color: var(--text-sub); }
.highlight { color: var(--cyan); font-weight: 700; -webkit-text-fill-color: var(--cyan); }

.upload-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.upload-btn {
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.upload-btn.primary {
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #fff;
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
}
.upload-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(124,58,237,0.6); }
.upload-btn.secondary {
  background: var(--glass2);
  color: var(--text);
  border: 1px solid var(--border);
}
.upload-btn.secondary:hover { background: rgba(255,255,255,0.12); }

.drag-hint { font-size: 12px; color: var(--text-sub); opacity: 0.6; }

/* ---- MAIN TABS ---- */
main { padding: 0 32px 64px; position: relative; z-index: 1; }

.tab-content { display: none; }
.tab-content.active { display: block; }

.section-header { padding: 32px 0 20px; }
.section-header h2 { font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.section-sub { font-size: 13px; color: var(--text-sub); margin-top: 4px; }

/* LIVE DOT */
.live-dot {
  display: inline-block;
  width: 10px; height: 10px;
  background: #22C55E;
  border-radius: 50%;
  animation: pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.6); }
  50% { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
}

/* ---- IMAGE GRID ---- */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* ---- IMAGE CARD ---- */
.image-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  transition: transform 0.25s, box-shadow 0.25s;
  animation: cardIn 0.4s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.image-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5), 0 0 0 1px rgba(124,58,237,0.3);
}

.card-img-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--bg2);
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}
.image-card:hover .card-img-wrap img { transform: scale(1.04); }

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
}

.card-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-sub);
}
.timer-icon { font-size: 14px; }
.timer-urgent { color: #F87171 !important; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0.4; } }

.like-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.like-btn:hover { background: rgba(244,114,182,0.15); border-color: var(--pink); color: var(--pink); }
.like-btn.liked { background: rgba(244,114,182,0.2); border-color: var(--pink); color: var(--pink); }
.like-btn .heart { font-size: 16px; transition: transform 0.2s; }
.like-btn:active .heart { transform: scale(1.4); }

/* EXPIRY BAR */
.expiry-bar {
  position: absolute;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  transition: width 1s linear;
  border-radius: 0 2px 0 0;
}

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 64px 32px;
  color: var(--text-sub);
  display: none;
}
.empty-state.show { display: block; }
.empty-icon { font-size: 56px; margin-bottom: 16px; }
.empty-state p { font-size: 15px; line-height: 1.6; }

/* ---- MEME OVERLAY ---- */
.meme-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  animation: fadeIn 0.2s;
}
.meme-overlay.open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.meme-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 500px;
  width: 90%;
  position: relative;
  text-align: center;
  animation: popIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.meme-card img { max-width: 100%; border-radius: 12px; margin-bottom: 16px; }
.meme-card video { max-width: 100%; border-radius: 12px; margin-bottom: 16px; }
.meme-caption { font-size: 20px; font-weight: 800; margin-top: 12px; }
.meme-close {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--glass2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
}

/* ---- MODAL ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 500;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}
.modal-overlay.open { display: flex; }

.modal-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 440px;
  width: 90%;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: popIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.modal-card.wide { max-width: 860px; }
.modal-card h2 { font-size: 22px; font-weight: 800; }
.modal-card p { font-size: 14px; color: var(--text-sub); }
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--glass2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
}

.admin-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.admin-input:focus { border-color: var(--violet-l); }
.admin-error { color: #F87171; font-size: 13px; min-height: 18px; }

/* ADMIN GRID */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  max-height: 60vh;
  overflow-y: auto;
}
.admin-img-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border);
}
.admin-img-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.admin-img-meta {
  padding: 8px 10px;
  font-size: 11px;
  color: var(--text-sub);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-delete-btn {
  width: 100%;
  padding: 6px;
  background: rgba(239,68,68,0.2);
  border: 1px solid rgba(239,68,68,0.4);
  color: #F87171;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
}
.admin-delete-btn:hover { background: rgba(239,68,68,0.4); }

/* ---- LIGHTBOX ---- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 900;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 20px; right: 20px;
  background: var(--glass2);
  border: 1px solid var(--border);
  color: #fff;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
}

/* ---- TOAST ---- */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s;
  opacity: 0;
  backdrop-filter: blur(12px);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ---- UPLOAD PROGRESS ---- */
.upload-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: -8px;
}
.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  border-radius: 2px;
  animation: progress 1.2s ease forwards;
}
@keyframes progress { from { width: 0; } to { width: 100%; } }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .navbar { flex-wrap: wrap; padding: 12px 16px; gap: 10px; }
  .nav-tabs { order: 3; width: 100%; justify-content: center; }
  .random-sound-btn { font-size: 12px; padding: 8px 14px; }
  .hero { padding: 24px 16px 16px; }
  .drop-inner { padding: 32px 16px; }
  main { padding: 0 16px 48px; }
  .image-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.5); border-radius: 3px; }

/* ---- TOP BADGE ---- */
.top-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
  color: #000;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  z-index: 2;
}
