@tailwind base;
@tailwind components;
@tailwind utilities;

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --color-bg: #070714;
  --color-card: #0E0E1F;
  --color-border: #1C1C38;
  --color-teal: #00C8DC;
  --color-red: #E84040;
  --color-text: #ffffff;
  --color-muted: #8888AA;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-teal);
}

/* Selection */
::selection {
  background: var(--color-teal);
  color: #000;
}

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 2px;
}

/* Input base styles */
.input-field {
  @apply w-full bg-dark-card border border-dark-border rounded-lg px-4 py-3 text-white placeholder-dark-muted
         focus:outline-none focus:border-teal focus:ring-1 focus:ring-teal transition-all duration-200
         text-sm;
}

.input-field:hover {
  border-color: #2A2A55;
}

/* Select field */
select.input-field {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%238888AA' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
}

/* Label */
.form-label {
  @apply block text-xs font-semibold text-slate-400 mb-1.5 uppercase tracking-wide;
}

/* Product card */
.product-card {
  @apply relative bg-dark-card border-2 border-dark-border rounded-2xl p-6 cursor-pointer
         transition-all duration-300 hover:border-teal/50 hover:shadow-lg;
}

.product-card.selected {
  @apply border-teal shadow-teal/20;
  box-shadow: 0 0 0 1px #00C8DC, 0 8px 32px rgba(0, 200, 220, 0.15);
}

/* Size button */
.size-btn {
  @apply px-3 py-2 rounded-lg border border-dark-border text-sm font-semibold
         transition-all duration-200 hover:border-teal/60 cursor-pointer text-slate-300;
  min-width: 52px;
  text-align: center;
}

.size-btn.selected {
  @apply bg-teal text-dark border-teal;
  color: #000;
}

.size-btn:hover:not(.selected) {
  @apply text-white;
}

/* Shipping card */
.shipping-card {
  @apply flex-1 bg-dark-card border-2 border-dark-border rounded-xl p-5 cursor-pointer
         transition-all duration-300 hover:border-teal/50;
}

.shipping-card.selected {
  @apply border-teal;
  box-shadow: 0 0 0 1px #00C8DC, 0 4px 24px rgba(0, 200, 220, 0.1);
}

/* Section title */
.section-title {
  @apply text-xs font-black tracking-[0.3em] uppercase text-teal mb-6;
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #00C8DC 0%, #00A8C0 50%, #E84040 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Pay button */
.btn-pay {
  @apply w-full py-4 px-8 rounded-xl font-black text-lg text-white tracking-wider uppercase
         transition-all duration-300 relative overflow-hidden;
  background: linear-gradient(135deg, #E84040 0%, #C82020 100%);
}

.btn-pay:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(232, 64, 64, 0.4);
}

.btn-pay:active:not(:disabled) {
  transform: translateY(0);
}

.btn-pay:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Countdown digits */
.countdown-digit {
  @apply bg-dark-card border border-dark-border rounded-xl flex flex-col items-center justify-center;
  min-width: 72px;
  padding: 12px 8px;
}

.countdown-digit .number {
  @apply text-4xl font-black text-white leading-none tabular-nums;
  font-variant-numeric: tabular-nums;
}

.countdown-digit .label {
  @apply text-xs text-slate-500 uppercase tracking-widest mt-1;
}

/* Pulse glow animation for teal elements */
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 200, 220, 0.3); }
  50% { box-shadow: 0 0 20px rgba(0, 200, 220, 0.6); }
}

.glow-pulse {
  animation: glowPulse 2s ease-in-out infinite;
}

/* Floating animation for product images */
@keyframes floatAnim {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-10px) rotate(0.5deg); }
  66% { transform: translateY(-5px) rotate(-0.5deg); }
}

.float-anim {
  animation: floatAnim 4s ease-in-out infinite;
}

/* Slide reveal on scroll */
@keyframes revealUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal-up {
  animation: revealUp 0.6s ease-out forwards;
}

/* Shimmer loading effect */
@keyframes shimmerAnim {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.shimmer {
  background: linear-gradient(90deg, #1C1C38 25%, #2A2A45 50%, #1C1C38 75%);
  background-size: 200% 100%;
  animation: shimmerAnim 1.5s infinite;
}

/* Badge */
.badge {
  @apply text-xs font-black uppercase tracking-widest px-3 py-1 rounded-full;
}

.badge-teal {
  @apply text-dark bg-teal;
  color: #000;
}

.badge-red {
  @apply text-white bg-cherry;
}

/* Trust badge card */
.trust-card {
  @apply flex flex-col items-center gap-3 p-5 bg-dark-card border border-dark-border rounded-xl text-center;
}

/* Section divider */
.section-divider {
  @apply border-t border-dark-border my-12;
}

/* Step indicator */
.step-dot {
  @apply w-6 h-6 rounded-full border-2 flex items-center justify-center text-xs font-black transition-all duration-300;
}

.step-dot.active {
  @apply bg-teal border-teal text-dark;
  color: #000;
}

.step-dot.done {
  @apply bg-teal/20 border-teal/50 text-teal;
}

.step-dot.pending {
  @apply bg-transparent border-dark-muted text-dark-muted;
}

/* Admin table */
.admin-table {
  @apply w-full text-sm;
}

.admin-table th {
  @apply text-left text-xs font-semibold text-slate-500 uppercase tracking-wider py-3 px-4 border-b border-dark-border;
}

.admin-table td {
  @apply py-3 px-4 border-b border-dark-border/50 text-slate-300;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Status badge */
.status-badge {
  @apply text-xs font-bold uppercase tracking-wider px-2.5 py-1 rounded-full;
}

.status-PENDING { @apply bg-yellow-500/15 text-yellow-400; }
.status-PAID { @apply bg-teal/15 text-teal; }
.status-PREPARING { @apply bg-blue-500/15 text-blue-400; }
.status-SHIPPED { @apply bg-purple-500/15 text-purple-400; }
.status-DELIVERED { @apply bg-green-500/15 text-green-400; }
.status-CANCELLED { @apply bg-red-500/15 text-red-400; }

/* Confetti animation for success page */
@keyframes confettiFall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.confetti-piece {
  position: fixed;
  width: 8px;
  height: 8px;
  top: -10px;
  animation: confettiFall linear forwards;
  border-radius: 2px;
}

/* Responsive */
@media (max-width: 640px) {
  .countdown-digit {
    min-width: 56px;
    padding: 10px 6px;
  }
  .countdown-digit .number {
    @apply text-3xl;
  }
}
