/* Modern Premium CSS for Ticket Check Feature */

:root {
  --bg-main: #0b0f19;
  --bg-card: #151c2c;
  --bg-card-hover: #1e2638;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.08);
  
  --primary: #6366f1; /* Indigo */
  --primary-hover: #4f46e5;
  --secondary: #334155; /* Slate */
  --secondary-hover: #475569;
  
  --success: #10b981; /* Emerald */
  --error: #ef4444; /* Rose */
  --warning: #f59e0b; /* Amber */
  --info: #06b6d4; /* Cyan */
  
  --glow-primary: rgba(99, 102, 241, 0.15);
  --glow-success: rgba(16, 185, 129, 0.2);
  --glass-bg: rgba(21, 28, 44, 0.7);
  --glass-border: rgba(255, 255, 255, 0.06);
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Inter', 'Outfit', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.ticket-check-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ----------------- Common Layout components ----------------- */

.view-stage {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.view-stage.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.page-title, .section-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 2.2rem;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
  text-align: center;
}

.section-title {
  font-size: 1.8rem;
}

.start-desc, .crop-desc {
  color: var(--text-muted);
  text-align: center;
  font-size: 1rem;
  margin-bottom: 24px;
}

.info-box, .warning-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.info-box {
  background: rgba(99, 102, 241, 0.03);
  border-color: rgba(99, 102, 241, 0.15);
  position: relative;
  overflow: hidden;
}

.info-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.info-box p {
  color: #cbd5e1;
  font-size: 0.95rem;
}

.warning-box {
  border-color: rgba(245, 158, 11, 0.15);
  background: rgba(245, 158, 11, 0.02);
}

.caution-text {
  color: #e2e8f0;
  font-size: 0.85rem;
  text-align: justify;
}

/* ----------------- Buttons ----------------- */

.action-buttons {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  flex: 1;
  max-width: 240px;
}

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

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--glow-primary);
}

.btn-primary:not(:disabled):hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
}

.btn-secondary {
  background-color: var(--secondary);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-secondary:not(:disabled):hover {
  background-color: var(--secondary-hover);
  transform: translateY(-2px);
}

/* ----------------- Cropper Wrapper ----------------- */

.crop-wrapper {
  background: #07090e;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  overflow: hidden;
  max-height: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.crop-wrapper img {
  max-width: 100%;
  max-height: 480px;
  display: block;
}

/* ----------------- Ads Banner ----------------- */

.ad-banner {
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 24px 0;
}

.ad-placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ----------------- Result View ----------------- */

.result-summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.result-status-badge {
  align-self: flex-start;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.08);
}

.result-status-badge.won {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.result-status-badge.lost {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.result-status-badge.error-badge {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.result-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-row .label {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-row .val {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

/* ----------------- Draw & User Balls ----------------- */

.draw-comparison-area {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 28px;
}

.winning-numbers-box, .user-tickets-box {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 20px;
}

.winning-numbers-box h4, .user-tickets-box h4 {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.numbers-display {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ball {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #334155;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: inset 0 -3px 8px rgba(0, 0, 0, 0.5);
  user-select: none;
}

/* Dynamic color scheme based on ball numbers (optional decoration) */
.ball.matched {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  box-shadow: 0 0 12px var(--glow-success), inset 0 -3px 8px rgba(0,0,0,0.3);
}

.ball.bonus-ball {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 2px solid #38bdf8;
}

.ball.special-ball {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  border: 2px solid #fb923c;
}

/* User Ticket Rows */
.ticket-rows-display {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ticket-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ticket-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ticket-index {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.ticket-result-badge {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
}

.ticket-result-badge.won {
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.ticket-result-badge.lost {
  color: var(--text-muted);
}

/* ----------------- Modals (Glassmorphism Overlay) ----------------- */

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 7, 18, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.text-center {
  text-align: center;
}

.modal-content h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  margin-bottom: 12px;
  color: #ffffff;
}

.modal-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

/* Loading Spinner */
.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 20px auto;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.timer-countdown {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.modal-actions .btn {
  max-width: none;
  padding: 10px 20px;
  font-size: 0.9rem;
}

/* Keyframes */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ----------------- Responsive adjustments ----------------- */

@media (max-width: 480px) {
  .ticket-check-container {
    padding: 20px 12px;
  }
  
  .page-title {
    font-size: 1.8rem;
  }
  
  .action-buttons {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  
  .btn {
    width: 100%;
    max-width: none;
  }
  
  .result-details {
    grid-template-columns: 1fr 1fr;
  }
  
  .ball {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }
}

/* ----------------- Ad slots and policy adjustments ----------------- */

.ad-slot {
  width: 100%;
  max-width: 720px;
  margin: 20px auto;
  text-align: center;
  overflow: hidden;
}

.ad-slot-start {
  min-height: 250px;
}

.ad-slot-scan {
  min-height: 90px;
}

.ad-slot-result {
  min-height: 250px;
}

.ad-notice {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #8892b0;
  margin: 16px 0 8px;
  text-align: center;
}

