/**
 * ============================================================
 *  FamuraTopUp — Custom Styles (style.css)
 *  Overrides, animations, and custom components on top of Tailwind.
 * ============================================================
 */

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

/* ─── CSS Custom Properties (Design Tokens) ─────────────── */
:root {
  --bg-primary: #0F1119;
  --bg-secondary: #141722;
  --bg-card: #1A1D2E;
  --bg-card-hover: #242838;
  --bg-input: #141722;
  --border-color: #2A2E3F;
  --border-glow: #F9731640;
  --accent-orange: #F97316;
  --accent-orange-light: #FB923C;
  --accent-blue: #3B82F6;
  --accent-blue-light: #60A5FA;
  --accent-green: #22C55E;
  --accent-red: #EF4444;
  --accent-yellow: #EAB308;
  --text-primary: #F9FAFB;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-glow-orange: 0 0 20px rgba(249,115,22,0.3);
  --shadow-glow-blue: 0 0 20px rgba(59,130,246,0.3);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

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

/* ─── Animations (Keyframes) ────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes slideOutRight {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 5px var(--accent-orange), 0 0 10px transparent; }
  50% { box-shadow: 0 0 15px var(--accent-orange), 0 0 30px rgba(249,115,22,0.2); }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.3); opacity: 1; }
}

/* ─── Animation Utility Classes ──────────────────────────── */
.animate-fade-in-up { animation: fadeInUp 0.5s ease-out forwards; }
.animate-fade-in { animation: fadeIn 0.4s ease-out forwards; }
.animate-scale-in { animation: scaleIn 0.3s ease-out forwards; }
.animate-slide-in { animation: slideInRight 0.3s ease-out forwards; }
.animate-slide-out { animation: slideOutRight 0.3s ease-out forwards; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-pulse-glow { animation: pulseGlow 2s ease-in-out infinite; }

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
.stagger-7 { animation-delay: 0.35s; }
.stagger-8 { animation-delay: 0.4s; }

/* ─── Navbar ────────────────────────────────────────────── */
.navbar {
  background: rgba(15, 17, 25, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
  z-index: 1000;
}

.navbar.scrolled {
  background: rgba(15, 17, 25, 0.95);
  box-shadow: 0 4px 30px rgba(0,0,0,0.4);
}

.nav-link {
  position: relative;
  color: var(--text-secondary);
  transition: var(--transition);
  font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-orange);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-orange), var(--accent-orange-light));
  border-radius: 1px;
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Mobile Menu Overlay */
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* Mobile Drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.mobile-drawer.active {
  transform: translateX(0);
}

/* ─── Search Overlay ─────────────────────────────────────── */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 25, 0.95);
  backdrop-filter: blur(20px);
  z-index: 1100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 120px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.search-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ─── Banner Slider ──────────────────────────────────────── */
.slider-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.slider-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider-slide {
  min-width: 100%;
  position: relative;
}

.slider-slide img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

@media (min-width: 768px) {
  .slider-slide img {
    height: 320px;
  }
}

@media (min-width: 1024px) {
  .slider-slide img {
    height: 400px;
  }
}

.slider-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(15,17,25,0.8), transparent);
  border-radius: var(--radius-lg);
}

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-color);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  padding: 0;
}

.slider-dot.active {
  width: 24px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-orange), var(--accent-orange-light));
}

/* ─── Game Cards ─────────────────────────────────────────── */
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  gap: 10px;
  position: relative;
}

.game-card:hover {
  border-color: var(--accent-orange);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow-orange);
  background: var(--bg-card-hover);
}

.game-card-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .game-card-icon {
    width: 72px;
    height: 72px;
  }
}

.game-card-name {
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  color: var(--text-primary);
}

.game-card-dev {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
}

/* ─── Category Tabs ──────────────────────────────────────── */
.category-tab {
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.category-tab:hover {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

.category-tab.active {
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-orange-light));
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-glow-orange);
}

/* ─── Section Headers ────────────────────────────────────── */
.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Order Page — Step Sections ─────────────────────────── */
.step-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  transition: var(--transition);
}

.step-section:hover {
  border-color: rgba(249,115,22,0.2);
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-orange-light));
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.step-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ─── Form Inputs ────────────────────────────────────────── */
.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:focus {
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.15);
}

.form-input.error {
  border-color: var(--accent-red);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239CA3AF' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ─── Nominal Cards ──────────────────────────────────────── */
.nominal-card {
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.nominal-card:hover {
  border-color: var(--accent-orange);
  background: var(--bg-card-hover);
}

.nominal-card.selected {
  border-color: var(--accent-orange);
  background: rgba(249, 115, 22, 0.08);
  box-shadow: var(--shadow-glow-orange);
}

.nominal-card .item-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.nominal-card .item-price {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-orange);
}

/* ─── Payment Method Cards ───────────────────────────────── */
.payment-group {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 8px;
}

.payment-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  transition: var(--transition);
}

.payment-group-header:hover {
  background: var(--bg-card-hover);
}

.payment-group-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.payment-group.open .payment-group-body {
  max-height: 500px;
}

.payment-group.open .chevron-icon {
  transform: rotate(180deg);
}

.chevron-icon {
  transition: transform 0.3s ease;
}

.payment-method {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition);
  border-top: 1px solid var(--border-color);
}

.payment-method:hover {
  background: var(--bg-card-hover);
}

.payment-method.selected {
  background: rgba(249, 115, 22, 0.08);
}

.payment-method.selected::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-orange);
}

/* ─── Sticky Bottom Bar ──────────────────────────────────── */
.sticky-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(26, 29, 46, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  padding: 12px 16px;
  z-index: 900;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.sticky-bottom.visible {
  transform: translateY(0);
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-orange-light));
  color: white;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow-orange);
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-secondary:hover {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

/* ─── Status Badges ──────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.success {
  background: rgba(34,197,94,0.15);
  color: var(--accent-green);
}

.status-badge.pending {
  background: rgba(234,179,8,0.15);
  color: var(--accent-yellow);
}

.status-badge.failed {
  background: rgba(239,68,68,0.15);
  color: var(--accent-red);
}

/* ─── Info Box ───────────────────────────────────────────── */
.info-box {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--accent-blue-light);
  line-height: 1.5;
}

/* ─── Badge ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-orange {
  background: rgba(249,115,22,0.15);
  color: var(--accent-orange);
}

.badge-green {
  background: rgba(34,197,94,0.15);
  color: var(--accent-green);
}

.badge-blue {
  background: rgba(59,130,246,0.15);
  color: var(--accent-blue-light);
}

/* ─── Feature Badges (Order Page Header) ─────────────────── */
.feature-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  backdrop-filter: blur(4px);
}

/* ─── Footer ─────────────────────────────────────────────── */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: var(--transition);
}

.footer-link:hover {
  color: var(--accent-orange);
}

/* ─── Glassmorphism ──────────────────────────────────────── */
.glass {
  background: rgba(26, 29, 46, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
}

/* ─── Gradient Text ──────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-orange-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-blue {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Gradient Border ────────────────────────────────────── */
.gradient-border {
  position: relative;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-blue));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ─── Loading Skeleton ───────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 2000px 100%;
  animation: shimmer 2s infinite;
  border-radius: var(--radius-sm);
}

/* ─── Modal / Dialog ─────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 420px;
  width: 100%;
  animation: scaleIn 0.3s ease-out;
}

/* ─── Toast Notification ─────────────────────────────────── */
.toast {
  position: fixed;
  top: 80px;
  right: 20px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 3000;
  animation: fadeInUp 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 350px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.toast.success {
  background: rgba(34,197,94,0.15);
  border: 1px solid rgba(34,197,94,0.3);
  color: var(--accent-green);
}

.toast.error {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--accent-red);
}

.toast.info {
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(59,130,246,0.3);
  color: var(--accent-blue-light);
}

/* ─── Transaction Table ──────────────────────────────────── */
.tx-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tx-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
}

.tx-table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.tx-table td {
  padding: 12px 14px;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(42,46,63,0.5);
  white-space: nowrap;
}

.tx-table tbody tr {
  transition: var(--transition);
}

.tx-table tbody tr:hover {
  background: var(--bg-card-hover);
}

/* ─── Responsive Utilities ───────────────────────────────── */
@media (max-width: 640px) {
  .section-title {
    font-size: 1.1rem;
  }

  .step-section {
    padding: 16px;
  }
}

/* Hide scrollbar for horizontal scroll containers */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
