/* ============================================================
   Çekiliş Yönetim Sistemi – Global Stylesheet
   Renk sistemi: Kırmızı (#e03131) / Koyu (#1a1a2e) / Beyaz
   ============================================================ */

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

:root {
  --red:        #e03131;
  --red-dark:   #c92a2a;
  --red-soft:   #fff5f5;
  --red-border: #ffc9c9;

  --dark:       #1a1a2e;
  --dark-2:     #16213e;
  --dark-3:     #0f3460;
  --sidebar-w:  260px;

  --gray-50:    #f8f9fa;
  --gray-100:   #f1f3f5;
  --gray-200:   #e9ecef;
  --gray-300:   #dee2e6;
  --gray-400:   #ced4da;
  --gray-500:   #adb5bd;
  --gray-600:   #6c757d;
  --gray-700:   #495057;
  --gray-800:   #343a40;
  --gray-900:   #212529;

  --success:    #2f9e44;
  --warning:    #f08c00;
  --info:       #1971c2;

  --radius-sm:  8px;
  --radius:     12px;
  --radius-lg:  18px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:     0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.15);
  --transition: .18s ease;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--gray-100);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ── Typography ───────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.3; }
.page-title { font-size: 1.4rem; font-weight: 700; color: var(--gray-900); }
.text-red { color: var(--red) !important; }

/* ── Button overrides ─────────────────────────────────────── */
.btn { border-radius: var(--radius-sm); font-weight: 500; font-size: 13px; transition: all var(--transition); }
.btn:focus { box-shadow: none; }
.btn-brand {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.btn-brand:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn-danger { background: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red-dark); border-color: var(--red-dark); }

/* ── Card ─────────────────────────────────────────────────── */
.card {
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: #fff;
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--gray-200);
  padding: 1rem 1.25rem;
  font-weight: 600;
}

/* ── Form controls ────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: var(--radius-sm);
  border-color: var(--gray-300);
  font-size: 13px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(224,49,49,.12);
}
.form-label { font-weight: 500; font-size: 13px; color: var(--gray-700); margin-bottom: .35rem; }

/* ── Badge ────────────────────────────────────────────────── */
.badge { border-radius: 6px; font-weight: 500; font-size: 11px; padding: .3em .65em; }

/* ── Table ────────────────────────────────────────────────── */
.table { font-size: 13px; }
.table thead th {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
  color: var(--gray-600);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  padding: .75rem 1rem;
}
.table td { padding: .75rem 1rem; vertical-align: middle; }
.table-hover tbody tr:hover { background: var(--gray-50); }

/* ── Alert ────────────────────────────────────────────────── */
.alert { border: 0; border-radius: var(--radius); font-size: 13px; font-weight: 500; }
.alert-success { background: #ebfbee; color: var(--success); }
.alert-danger  { background: var(--red-soft); color: var(--red-dark); }
.alert-warning { background: #fff9db; color: var(--warning); }


/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.admin-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform var(--transition);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--red);
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 18px; color: #fff;
  flex-shrink: 0;
}
.sidebar-logo .logo-text {
  font-size: 13px; font-weight: 700; color: #fff;
  line-height: 1.2;
}
.sidebar-logo .logo-text span { color: var(--red); }

.sidebar-nav { padding: 1rem .75rem; flex: 1; overflow-y: auto; }
.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,.35);
  padding: .75rem .5rem .35rem;
}
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.65);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
}
.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.sidebar-nav .nav-link.active { background: var(--red); color: #fff; }
.sidebar-nav .nav-link .nav-icon {
  width: 18px; text-align: center; font-size: 15px; flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem .75rem;
  border-top: 1px solid rgba(255,255,255,.07);
}
.sidebar-footer .nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.5);
  font-size: 13px; font-weight: 500;
  transition: all var(--transition);
}
.sidebar-footer .nav-link:hover { background: rgba(224,49,49,.15); color: var(--red); }

/* Main content */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 0 1.5rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 99;
  box-shadow: var(--shadow-sm);
}
.admin-topbar .topbar-title { font-weight: 600; font-size: 15px; color: var(--gray-900); }
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--gray-700);
}
.topbar-user .avatar {
  width: 32px; height: 32px;
  background: var(--red);
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px;
}

.admin-content { padding: 1.75rem; flex: 1; }

/* Stat cards */
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); }
.stat-card .stat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-icon.red   { background: var(--red-soft);  color: var(--red); }
.stat-icon.green { background: #ebfbee; color: var(--success); }
.stat-icon.blue  { background: #e7f5ff; color: var(--info); }
.stat-icon.gold  { background: #fff9db; color: var(--warning); }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1; color: var(--gray-900); }
.stat-card .stat-label { font-size: 12px; color: var(--gray-500); font-weight: 500; margin-top: 3px; }

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.page-header .page-title { margin: 0; }

/* ============================================================
   FRONTEND LAYOUT
   ============================================================ */
.frontend-nav {
  background: var(--dark);
  padding: 0;
}
.frontend-nav .container {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.frontend-nav .brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-weight: 700; font-size: 16px;
}
.frontend-nav .brand-icon {
  width: 34px; height: 34px;
  background: var(--red);
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: 16px;
}

.event-card {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.event-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.event-card .event-poster-image {
  width: 100%;
  height: 260px;
  object-fit: cover;
  display: block;
}
.event-card .event-header {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-3) 100%);
  padding: 1.5rem;
  color: #fff;
}
.event-card .event-header h2 { font-size: 1rem; margin: 0 0 .4rem; }
.event-card .event-header .location {
  font-size: 12px; opacity: .7; display: flex; align-items: center; gap: 5px;
}
.event-card .event-body { padding: 1.25rem 1.5rem; }
.event-card .event-desc { font-size: 13px; color: var(--gray-600); margin-bottom: 1rem; min-height: 40px; }
.event-card .btn-join {
  display: block;
  background: var(--red);
  color: #fff;
  padding: .65rem 1rem;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  transition: background var(--transition);
}
.event-card .btn-join:hover { background: var(--red-dark); }

@media (max-width: 768px) {
  .event-card .event-poster-image {
    height: 220px;
  }
}

.hero-section {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-3) 100%);
  color: #fff;
  padding: 3.5rem 0 2.5rem;
}
.hero-section h1 { font-size: 2rem; font-weight: 800; }
.hero-section p { opacity: .75; font-size: 15px; }

/* ============================================================
   AUTH PAGE
   ============================================================ */
.auth-body {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-3) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.auth-card .auth-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}
.auth-card .auth-logo .icon {
  width: 56px; height: 56px;
  background: var(--red);
  border-radius: 16px;
  display: inline-grid; place-items: center;
  font-size: 26px; color: #fff;
  margin-bottom: .75rem;
}
.auth-card h1 { font-size: 1.25rem; font-weight: 700; margin-bottom: .25rem; }
.auth-card .subtitle { font-size: 13px; color: var(--gray-500); }

/* ============================================================
   DRAW SCREEN
   ============================================================ */
.draw-body {
  background: #070714;
  min-height: 100vh;
  color: #fff;
  font-family: 'Inter', sans-serif;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}
.draw-body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(224,49,49,.18) 0%, transparent 70%);
  pointer-events: none;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

.draw-container { position: relative; z-index: 1; }

.draw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.draw-header .event-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(255,255,255,.9);
}
.draw-header .participant-count {
  font-size: 13px;
  color: rgba(255,255,255,.45);
}

.draw-stage-sticky {
  position: sticky;
  top: 0;
  z-index: 25;
  background: #070714;
  transition: box-shadow .22s ease, border-color .22s ease;
}
.draw-stage-sticky.is-compact {
  box-shadow: 0 12px 28px rgba(0,0,0,.55);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.draw-stage {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  transition: padding .22s ease;
}
.draw-stage-sticky.is-compact .draw-stage {
  padding: .65rem 1rem .85rem;
}
.stage-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255,255,255,.35);
  margin-bottom: 1rem;
  transition: font-size .22s ease, margin-bottom .22s ease, letter-spacing .22s ease;
}
.draw-stage-sticky.is-compact .stage-label {
  font-size: 9px;
  margin-bottom: .35rem;
  letter-spacing: 1.2px;
}
#rollingName {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 800;
  color: var(--red);
  min-height: 1.3em;
  letter-spacing: -1px;
  transition: font-size .22s ease, min-height .22s ease, color .15s ease;
  text-shadow: 0 0 40px rgba(224,49,49,.5);
}
.draw-stage-sticky.is-compact #rollingName {
  font-size: clamp(1.15rem, 4.2vw, 1.85rem);
  min-height: 1.25em;
}
#rollingName.reveal {
  color: #fff;
  animation: revealPulse .6s ease;
  text-shadow: 0 0 60px rgba(255,255,255,.4);
}
@keyframes revealPulse {
  0%   { transform: scale(1.15); opacity: 0; }
  60%  { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.draw-action {
  display: flex;
  justify-content: center;
  padding: .5rem 0 1.5rem;
}
.btn-draw-start {
  background: linear-gradient(135deg, var(--red) 0%, #c92a2a 100%);
  color: #fff;
  border: 0;
  padding: 1rem 3.5rem;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .3px;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(224,49,49,.45);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.btn-draw-start::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.15) 0%, transparent 60%);
}
.btn-draw-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(224,49,49,.6);
}
.btn-draw-start:active { transform: translateY(0); }
.btn-draw-start:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.draw-already {
  text-align: center;
  padding: .5rem 0 1.5rem;
  font-size: 14px;
  color: rgba(255,255,255,.4);
}

.draw-results {
  padding: 0 1.5rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  max-width: 900px;
  margin: 0 auto;
}
@media (max-width: 640px) { .draw-results { grid-template-columns: 1fr; } }

.winners-box {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.winners-box-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.winners-box-header .wtype-badge {
  display: inline-flex; align-items: center;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  padding: .25em .7em; border-radius: 6px;
}
.winners-box-header .wtype-badge.reserve { background: rgba(255,255,255,.15); }
.winners-box-header .wtitle {
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,.75);
}
.winner-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: .8rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  animation: winnerSlide .35s ease both;
}
@keyframes winnerSlide {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.winner-item:last-child { border-bottom: 0; }
.winner-number {
  width: 26px; height: 26px;
  background: rgba(224,49,49,.2);
  border: 1px solid rgba(224,49,49,.35);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: var(--red);
  flex-shrink: 0;
}
.winner-name { font-size: 14px; font-weight: 600; color: rgba(255,255,255,.9); }
.winner-tc   { font-size: 11px; color: rgba(255,255,255,.35); margin-top: 1px; }

.btn-fullscreen {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.6);
  padding: .4rem .9rem;
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-fullscreen:hover { background: rgba(255,255,255,.14); color: #fff; }

/* progress bar during spin */
.spin-progress {
  height: 3px;
  background: rgba(255,255,255,.07);
  border-radius: 2px;
  margin: 0 2rem 1.5rem;
  overflow: hidden;
  transition: margin .22s ease;
}
.draw-stage-sticky.is-compact .spin-progress {
  margin: 0 1.25rem .65rem;
}
.spin-progress-bar {
  height: 100%;
  background: var(--red);
  border-radius: 2px;
  width: 0%;
  transition: width .1s linear;
}

/* Responsive sidebar */
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99;
  }
  .sidebar-overlay.show { display: block; }
}

/* =================================================================
   Multi-prize draw screen
   ================================================================= */

.prizes-stack {
  padding: 0 1.5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 1.1rem;
}

.prize-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), background var(--transition);
}
.prize-card.is-active {
  border-color: rgba(224,49,49,.45);
  background: rgba(224,49,49,.08);
}
.prize-card.is-done {
  border-color: rgba(47,158,68,.4);
  background: rgba(47,158,68,.06);
}
.prize-card.is-waiting { opacity: .65; }

.prize-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.prize-head-left {
  display: flex; align-items: center; gap: .75rem;
}
.prize-order {
  width: 34px; height: 34px;
  background: rgba(224,49,49,.18);
  border: 1px solid rgba(224,49,49,.35);
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
  color: var(--red);
}
.prize-card.is-done .prize-order {
  background: rgba(47,158,68,.18);
  border-color: rgba(47,158,68,.4);
  color: #51cf66;
}
.prize-name { font-size: 16px; font-weight: 700; color: rgba(255,255,255,.95); }
.prize-meta { font-size: 12px; color: rgba(255,255,255,.45); margin-top: 2px; }

.prize-head-right { display: flex; align-items: center; gap: .5rem; }

.prize-status-badge {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 600;
  padding: .45em .9em; border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.6);
}
.prize-status-badge.done {
  background: rgba(47,158,68,.15);
  color: #51cf66;
}
.prize-status-badge.waiting {
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.4);
}

.btn-draw-start.prize-draw-btn {
  font-size: 13px;
  padding: .55rem 1.1rem;
}

.prize-card-body { padding: 1rem 1.25rem 1.25rem; }

.winners-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 720px) {
  .winners-grid { grid-template-columns: 1fr; }
}

.winners-list {
  min-height: 60px;
}

.winner-item .winner-info { flex: 1; min-width: 0; }
.winner-item .winner-actions {
  display: flex; align-items: center;
  flex-shrink: 0;
}

.btn-skip-winner {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.7);
  font-size: 11px; font-weight: 600;
  padding: .35em .75em;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 4px;
}
.btn-skip-winner:hover {
  background: rgba(224,49,49,.18);
  border-color: rgba(224,49,49,.4);
  color: #ff8787;
}
.btn-skip-winner:disabled {
  opacity: .6; cursor: not-allowed;
}

.badge-unreachable {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(224,49,49,.15);
  color: #ff8787;
  font-size: 11px; font-weight: 600;
  padding: .3em .7em;
  border-radius: 6px;
}

.winner-item--unreachable {
  opacity: .45;
}
.winner-item--unreachable .winner-name {
  text-decoration: line-through;
  color: rgba(255,255,255,.55);
}
.winner-item--unreachable .winner-tc {
  text-decoration: line-through;
}
.winner-item--unreachable .winner-number {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.1);
  color: rgba(255,255,255,.4);
}

/* =================================================================
   Event form – prize repeater
   ================================================================= */

.prize-row {
  border: 1px solid var(--gray-200, #e9ecef);
  border-radius: var(--radius-md, 8px);
  background: #fff;
}
.prize-order-badge {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px;
  background: var(--red-soft, #ffe3e3);
  color: var(--red, #e03131);
  border-radius: 50%;
  font-weight: 700; font-size: 13px;
}

