/* =====================
   RipaHub - Global Styles
   ===================== */

:root {
  --primary: #e63946;
  --primary-dark: #c1121f;
  --secondary: #ff6b35;
  --accent: #ffd60a;
  --dark: #1a1a2e;
  --dark-2: #16213e;
  --card-bg: #0f3460;
  --text: #f0f0f0;
  --text-muted: #a0a0b0;
  --success: #2ec4b6;
  --border: rgba(255,255,255,0.1);
  --shadow: 0 8px 32px rgba(0,0,0,0.3);
  --radius: 16px;
  --radius-sm: 10px;
}

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

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--dark);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ---- NAV ---- */
nav {
  background: rgba(26,26,46,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

.nav-logo span { color: var(--accent); -webkit-text-fill-color: var(--accent); }

.nav-links { display: flex; gap: 8px; align-items: center; }

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.nav-links a:hover { color: var(--text); background: var(--border); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(230,57,70,0.4); }

.btn-secondary {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-secondary:hover { background: var(--primary); color: white; }

.btn-success {
  background: linear-gradient(135deg, var(--success), #06d6a0);
  color: var(--dark);
}

.btn-success:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(46,196,182,0.4); }

.btn-full { width: 100%; justify-content: center; padding: 16px; font-size: 1.1rem; }

.btn-lg { padding: 16px 36px; font-size: 1.1rem; }

/* ---- HERO ---- */
.hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 50%, #1a0a2e 100%);
  padding: 80px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(230,57,70,0.15) 0%, transparent 70%);
  top: -200px; left: 50%; transform: translateX(-50%);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  background: rgba(230,57,70,0.15);
  border: 1px solid rgba(230,57,70,0.4);
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: 1px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto 32px;
}

.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---- STATS BAR ---- */
.stats-bar {
  background: var(--dark-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 24px;
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}

.stat { text-align: center; }
.stat-number { font-size: 1.8rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* ---- SECTION ---- */
.section { padding: 60px 24px; max-width: 1200px; margin: 0 auto; }

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

.section-title { font-size: 1.6rem; font-weight: 800; }
.section-title span { color: var(--primary); }

/* ---- RAFFLE GRID ---- */
.raffle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.raffle-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.raffle-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(230,57,70,0.4);
}

.raffle-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--dark-2), var(--card-bg));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

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

.raffle-body { padding: 20px; }

.raffle-category {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.raffle-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}

.raffle-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.raffle-price {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
}

.raffle-price span { font-size: 0.8rem; font-weight: 400; color: var(--text-muted); }

.raffle-entries {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: right;
}

.raffle-entries strong { color: var(--text); }

/* Progress bar */
.progress-wrap { margin-bottom: 16px; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.progress-bar {
  background: rgba(255,255,255,0.1);
  border-radius: 50px;
  height: 8px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 50px;
  transition: width 0.5s;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-live { background: rgba(230,57,70,0.2); color: var(--primary); border: 1px solid rgba(230,57,70,0.4); }
.badge-live::before { content: '● '; }
.badge-ending { background: rgba(255,214,10,0.2); color: var(--accent); border: 1px solid rgba(255,214,10,0.4); }
.badge-done { background: rgba(46,196,182,0.2); color: var(--success); }

/* ---- TIMER ---- */
.timer {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 16px 0;
}

.timer-unit {
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  padding: 8px 12px;
  text-align: center;
  min-width: 52px;
}

.timer-num { font-size: 1.4rem; font-weight: 800; color: var(--primary); line-height: 1; }
.timer-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-label span { color: var(--primary); }

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 0.95rem;
  transition: border 0.2s;
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  background: rgba(230,57,70,0.05);
}

.form-textarea { min-height: 100px; resize: vertical; }
.form-select option { background: var(--dark); }

.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; }

/* ---- CARDS ---- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.card-sm { padding: 20px; border-radius: var(--radius-sm); }

/* ---- ALERTS ---- */
.alert {
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-info { background: rgba(46,196,182,0.1); border: 1px solid rgba(46,196,182,0.3); color: var(--success); }
.alert-warning { background: rgba(255,214,10,0.1); border: 1px solid rgba(255,214,10,0.3); color: var(--accent); }
.alert-error { background: rgba(230,57,70,0.1); border: 1px solid rgba(230,57,70,0.3); color: var(--primary); }
.alert-success { background: rgba(46,196,182,0.15); border: 1px solid rgba(46,196,182,0.4); color: #2ec4b6; }

/* ---- HOW IT WORKS ---- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }

.step {
  text-align: center;
  padding: 28px 20px;
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  position: relative;
}

.step-num {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0 auto 16px;
}

.step h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.step p { font-size: 0.85rem; color: var(--text-muted); }

/* ---- FOOTER ---- */
footer {
  background: var(--dark-2);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer .footer-logo {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

footer a { color: var(--text-muted); text-decoration: none; }
footer a:hover { color: var(--primary); }

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

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

.modal {
  background: var(--dark-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  transform: scale(0.9);
  transition: transform 0.3s;
}

.modal-overlay.active .modal { transform: scale(1); }

.modal-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; }
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none; border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ---- UTILITY ---- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.fw-700 { font-weight: 700; }

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--dark-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
  max-width: 320px;
  font-size: 0.9rem;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(46,196,182,0.5); }
.toast.error { border-color: rgba(230,57,70,0.5); }

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
  nav { padding: 0 16px; }
  .hero { padding: 60px 16px; }
  .section { padding: 40px 16px; }
  .stats-bar { gap: 24px; }
  .hero-cta { flex-direction: column; align-items: center; }
  .btn-lg { width: 100%; justify-content: center; }
}
