/* Sunday School Kalolsavam Theme & Modern User-Friendly Components */
:root {
  --primary-fest: #0d3b66;
  --primary-light: #1d4e89;
  --primary-gradient: linear-gradient(135deg, #0d3b66 0%, #001f3f 100%);
  --gold-fest: #d4af37;
  --gold-badge: linear-gradient(135deg, #ffd700 0%, #ffae00 100%);
  --silver-badge: linear-gradient(135deg, #f0f0f0 0%, #bdbdbd 100%);
  --bronze-badge: linear-gradient(135deg, #e0a96d 0%, #cd7f32 100%);
  --accent-fest: #e63946;
  --bg-fest: #f8fafc;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --card-hover-shadow: 0 10px 30px rgba(13, 59, 102, 0.12);
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-fest);
  color: #1e293b;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, .brand-font {
  font-family: 'Outfit', sans-serif;
}

/* Sticky Festival Navbar */
.fest-navbar {
  background: var(--primary-gradient);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  z-index: 1030;
}

.fest-brand {
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff !important;
}

.nav-link {
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: #ffd700 !important;
  transform: translateY(-1px);
}

/* Hero Section */
.fest-hero {
  background: linear-gradient(135deg, rgba(13, 59, 102, 0.96), rgba(0, 31, 63, 0.98)), url('../img/pattern.svg');
  color: #fff;
  padding: 55px 0 45px;
  border-bottom: 4px solid var(--gold-fest);
  position: relative;
}

/* Hero Quick Search Input Box */
.hero-search-box {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  padding: 6px 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.hero-search-box:focus-within {
  background: #ffffff;
  border-color: #ffd700;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.hero-search-box input {
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 1.05rem;
  padding: 10px 20px;
  outline: none;
}

.hero-search-box:focus-within input {
  color: #0f172a;
}

.hero-search-box input::placeholder {
  color: rgba(255, 255, 255, 0.75);
}

.hero-search-box:focus-within input::placeholder {
  color: #94a3b8;
}

/* Category Filter Pills */
.filter-pills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.btn-filter-pill {
  border-radius: 30px;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-filter-pill:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-filter-pill.active {
  background: var(--primary-fest);
  color: #ffffff;
  border-color: var(--primary-fest);
  box-shadow: 0 4px 12px rgba(13, 59, 102, 0.3);
}

/* Ranking Badges */
.badge-rank-1 {
  background: var(--gold-badge);
  color: #4a2800;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(255, 174, 0, 0.45);
}

.badge-rank-2 {
  background: var(--silver-badge);
  color: #1e293b;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(189, 189, 189, 0.4);
}

.badge-rank-3 {
  background: var(--bronze-badge);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(205, 127, 50, 0.4);
}

.grade-pill-A {
  background-color: #d1e7dd;
  color: #0f5132;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50rem;
}

.grade-pill-B {
  background-color: #cff4fc;
  color: #055160;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50rem;
}

.grade-pill-C {
  background-color: #fff3cd;
  color: #664d03;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50rem;
}

/* Live Appeal Window Timer Badge */
.appeal-timer-badge {
  background: #fff8e1;
  border: 1px solid #ffe082;
  color: #b78103;
  padding: 6px 14px;
  border-radius: 25px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  box-shadow: 0 2px 6px rgba(255, 193, 7, 0.2);
}

.appeal-timer-badge.urgent {
  background: #ffebee;
  border-color: #ffcdd2;
  color: #c62828;
  animation: pulse-border 1.5s infinite;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  background-color: #dc3545;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.3); opacity: 1; }
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(220, 53, 69, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* Cards & Modern Elevators */
.card-fest {
  border: none;
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-fest:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-hover-shadow);
}

/* Quick Action Hub Tiles (Admin & Public) */
.action-hub-tile {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.action-hub-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(13, 59, 102, 0.12);
  border-color: #93c5fd;
  color: var(--primary-fest);
}

.action-hub-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

/* Visual Appeal Stepper */
.appeal-stepper {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 25px;
}

.appeal-stepper::before {
  content: '';
  position: absolute;
  top: 24px;
  left: 30px;
  right: 30px;
  height: 4px;
  background: #e2e8f0;
  z-index: 1;
}

.stepper-step {
  position: relative;
  z-index: 2;
  text-align: center;
  flex: 1;
}

.stepper-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #cbd5e1;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin: 0 auto 8px;
  font-weight: 700;
  transition: all 0.3s ease;
}

.stepper-step.active .stepper-circle {
  border-color: #0d6efd;
  background: #0d6efd;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(13, 110, 253, 0.35);
}

.stepper-step.completed .stepper-circle {
  border-color: #198754;
  background: #198754;
  color: #ffffff;
}

.stepper-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
}

.stepper-step.active .stepper-title {
  color: #0d6efd;
  font-weight: 700;
}

/* Tables & Cards */
.table-fest {
  vertical-align: middle;
}

.table-fest th {
  background-color: #f8fafc;
  color: #475569;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.6px;
  font-weight: 700;
  border-bottom: 2px solid #e2e8f0;
  padding: 12px 14px;
}

.table-fest td {
  padding: 12px 14px;
}

/* Coupon Slip Styling */
.coupon-slip {
  background: #ffffff;
  border: 2px dashed #0d3b66;
  border-radius: 12px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.coupon-slip::before {
  content: "₹200 OFFICIAL APPEAL SLIP";
  position: absolute;
  top: 15px;
  right: -50px;
  background: #28a745;
  color: #ffffff;
  padding: 4px 60px;
  font-size: 0.75rem;
  font-weight: bold;
  transform: rotate(45deg);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.coupon-code-box {
  background: #f8f9fa;
  border: 2px solid #ced4da;
  border-radius: 8px;
  padding: 12px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: #0d3b66;
  text-align: center;
}

/* Mark Sheet Modal & Viewer */
.marksheet-viewer {
  background: #1e293b;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  max-height: 80vh;
  overflow: auto;
}

.marksheet-viewer img,
.marksheet-viewer svg {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  background: #fff;
}

/* Sidebar for Admin */
.admin-sidebar {
  background: #0f172a;
  min-height: 100vh;
  color: #cbd5e1;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-sidebar a {
  color: #94a3b8;
  padding: 11px 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  font-size: 0.92rem;
  text-decoration: none;
  transition: all 0.2s;
  margin-bottom: 3px;
}

.admin-sidebar a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(3px);
}

.admin-sidebar a.active {
  background: #0d6efd;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(13, 110, 253, 0.4);
}

/* Mobile Header Bar for Admin */
.admin-mobile-topbar {
  background: #0f172a;
  color: #ffffff;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Floating Back to Top Button */
#backToTopBtn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary-fest);
  color: #ffffff;
  border: 2px solid #ffd700;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  z-index: 1000;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: all 0.25s ease;
}

#backToTopBtn:hover {
  background: #ffd700;
  color: #0d3b66;
  transform: translateY(-3px);
}

/* Mekala Interactive Box Card */
.mekala-card {
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.mekala-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(13, 59, 102, 0.16) !important;
  border-color: #2563eb !important;
}
.mekala-card:active {
  transform: scale(0.98);
}

/* Print Stylesheet */
@media print {
  .no-print,
  .btn,
  .admin-sidebar,
  .admin-mobile-topbar,
  .fest-navbar,
  footer,
  #backToTopBtn {
    display: none !important;
  }
  
  body, .container, .card {
    background: #fff !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .print-only {
    display: block !important;
  }

  .coupon-slip {
    border: 2px solid #000 !important;
    page-break-inside: avoid;
  }
}
