/* Islamic Quiz & Learning Hub - 100% Mobile-Native Tamil Styling System (Zero Horizontal Scroll) */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Mukta+Malar:wght@300;400;500;600;700;800&family=Scheherazade+New:wght@400;700&display=swap');

:root {
  --primary-deep: #07261c;
  --primary-color: #0c3e30;
  --primary-light: #135743;
  --accent-gold: #d4af37;
  --accent-gold-light: #f9eab3;
  --accent-gold-dark: #a8841d;
  --accent-gold-soft: #fcf9f2;
  --bg-color: #f5f4ee;
  --bg-gradient: linear-gradient(180deg, #f7f6f0 0%, #eaf0ec 100%);
  --surface-card: #ffffff;
  --surface-card-subtle: #faf9f5;
  --text-main: #12211b;
  --text-muted: #50645c;
  --border-color: #e2dfd5;
  --border-gold: rgba(212, 175, 55, 0.35);
  --success-color: #198754;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --shadow-sm: 0 2px 8px rgba(7, 38, 28, 0.05);
  --shadow-md: 0 8px 24px rgba(7, 38, 28, 0.1);
  --shadow-gold: 0 4px 16px rgba(212, 175, 55, 0.25);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --font-tamil: 'Mukta Malar', system-ui, -apple-system, sans-serif;
  --font-arabic: 'Scheherazade New', 'Amiri', serif;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-tamil);
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  padding-bottom: 72px; /* Space for mobile bottom navbar */
}

/* Islamic Bismillah Header */
.bismillah-header {
  background: linear-gradient(135deg, #03140f, var(--primary-deep));
  color: var(--accent-gold);
  text-align: center;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
}

.bismillah-text {
  font-family: var(--font-arabic);
  font-size: 1.35rem;
  letter-spacing: 1px;
}

/* Header Component */
.site-header {
  background: linear-gradient(180deg, var(--primary-deep) 0%, #0a3a2d 100%);
  color: #ffffff;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.top-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  text-align: center;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--primary-deep);
  box-shadow: var(--shadow-gold);
  border: 2px solid #ffffff;
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.25;
}

.brand-text p {
  font-size: 0.78rem;
  color: var(--accent-gold-light);
  opacity: 0.95;
}

.admin-link-btn {
  background: rgba(212, 175, 55, 0.15);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold-light);
  padding: 6px 14px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Ticker Marquee (Zero Overflow) */
.news-ticker-container {
  background: #03120d;
  display: flex;
  align-items: center;
  overflow: hidden;
  height: 38px;
  border-bottom: 2px solid var(--accent-gold);
  width: 100%;
}

.ticker-label {
  background: var(--accent-gold);
  color: var(--primary-deep);
  font-weight: 800;
  padding: 0 10px;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.ticker-wrap {
  flex-grow: 1;
  overflow: hidden;
  position: relative;
}

.ticker-move {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  animation: tickerAnimation 25s linear infinite;
  color: #e5f2ee;
  font-size: 0.88rem;
}

@keyframes tickerAnimation {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

.ticker-item {
  display: inline-block;
  padding: 0 16px;
}

/* Mobile Fixed Bottom Navigation Bar */
.mobile-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #093327 0%, var(--primary-deep) 100%);
  border-top: 2px solid var(--accent-gold);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  padding: 4px 2px;
  width: 100%;
}

.mobile-nav-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.mobile-nav-item {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-tamil);
  cursor: pointer;
  border-radius: 12px;
  flex: 1;
  transition: all 0.2s ease;
}

.mobile-nav-item i {
  font-size: 1.25rem;
  margin-bottom: 2px;
}

.mobile-nav-item.active {
  color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.18);
}

/* Main Layout Wrapper */
.main-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 16px auto;
  padding: 0 12px;
  flex: 1;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Card Container */
.card {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 16px 14px;
  margin-bottom: 18px;
  width: 100%;
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--surface-card-subtle);
}

.card-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary-deep);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title i {
  color: var(--accent-gold);
}

/* Hero Section */
.hero-banner {
  background: linear-gradient(135deg, var(--primary-deep), var(--primary-color));
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 24px 16px;
  margin-bottom: 20px;
  border: 1px solid var(--border-gold);
  width: 100%;
}

.hero-content h2 {
  font-size: 1.45rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--accent-gold-light);
}

.hero-content p {
  font-size: 0.95rem;
  opacity: 0.95;
  margin-bottom: 18px;
}

.hero-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.hero-card-link {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.35);
  padding: 16px;
  border-radius: var(--radius-sm);
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
}

.hero-card-link h3 {
  font-size: 1.1rem;
  color: var(--accent-gold-light);
  margin-bottom: 4px;
  font-weight: 700;
}

.hero-card-link p {
  font-size: 0.88rem;
  opacity: 0.9;
}

/* Quran Reader Form & Verses */
.quran-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
  background: var(--surface-card-subtle);
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  width: 100%;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.form-group label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary-deep);
}

.form-select, .form-input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font-size: 16px; /* Prevents iOS auto-zoom */
  font-family: var(--font-tamil);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text-main);
  outline: none;
}

.quran-header-info {
  background: linear-gradient(135deg, var(--primary-deep), var(--primary-light));
  color: #ffffff;
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  width: 100%;
  border: 1px solid var(--border-gold);
}

.quran-header-info h3 {
  font-size: 1.15rem;
  color: var(--accent-gold-light);
  font-weight: 700;
}

.juz-arabic-title {
  font-family: var(--font-arabic);
  font-size: 1.4rem;
  color: var(--accent-gold);
  margin-top: 6px;
}

.verse-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 14px;
  width: 100%;
}

.verse-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.verse-badge {
  background: var(--accent-gold-soft);
  color: var(--primary-deep);
  border: 1px solid var(--accent-gold);
  padding: 3px 10px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.8rem;
}

.arabic-text {
  font-family: var(--font-arabic);
  font-size: 1.5rem;
  line-height: 2.1;
  text-align: right;
  direction: rtl;
  color: var(--primary-deep);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-color);
}

.tamil-text {
  font-size: 0.98rem;
  color: var(--text-main);
  line-height: 1.7;
}

/* ========================================================
   MOBILE-NATIVE PRAYER CARDS (Replaces Horizontal Tables)
   ======================================================== */
.prayer-card-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.prayer-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.prayer-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 2px solid var(--surface-card-subtle);
}

.prayer-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary-deep);
}

.prayer-total-badge {
  background: var(--primary-deep);
  color: var(--accent-gold-light);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
}

.prayer-rakat-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.rakat-item {
  background: var(--surface-card-subtle);
  padding: 8px 12px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
}

.rakat-label {
  color: var(--text-muted);
  font-weight: 600;
}

.rakat-count {
  font-weight: 800;
}

/* ========================================================
   MOBILE-NATIVE LEADERBOARD LIST (Replaces Horizontal Tables)
   ======================================================== */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.leaderboard-card-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.rank-pill {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #ffffff;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.rank-1 { background: #ffd700; color: #000; }
.rank-2 { background: #c0c0c0; color: #000; }
.rank-3 { background: #cd7f32; color: #fff; }
.rank-other { background: var(--primary-light); }

.leaderboard-user-info {
  flex: 1;
  min-width: 0;
}

.leaderboard-user-name {
  font-weight: 700;
  color: var(--primary-deep);
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-time {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.leaderboard-score-badge {
  background: var(--accent-gold-soft);
  border: 1px solid var(--accent-gold);
  color: var(--primary-deep);
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.88rem;
  flex-shrink: 0;
}

/* Quiz Box Styling */
.quiz-name-box {
  background: linear-gradient(135deg, #fffdf8, #f8f4ea);
  border: 2px dashed var(--accent-gold);
  border-radius: var(--radius-md);
  padding: 24px 14px;
  text-align: center;
  width: 100%;
}

.quiz-name-box h3 {
  font-size: 1.25rem;
  color: var(--primary-deep);
  margin-bottom: 8px;
  font-weight: 800;
}

.question-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
  width: 100%;
}

.question-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--primary-deep);
  margin-bottom: 12px;
}

.fill-blank-input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  font-size: 16px;
  font-family: var(--font-tamil);
  border: 2px solid var(--accent-gold);
  border-radius: var(--radius-sm);
  background: var(--accent-gold-soft);
  outline: none;
}

.btn {
  min-height: 48px;
  padding: 12px 20px;
  font-size: 0.98rem;
  font-weight: 700;
  font-family: var(--font-tamil);
  border: none;
  border-radius: 30px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-deep));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(7, 38, 28, 0.25);
}

.btn-gold {
  background: linear-gradient(135deg, var(--accent-gold), #c49925);
  color: var(--primary-deep);
  font-weight: 800;
}

.btn-danger {
  background: var(--danger-color);
  color: #ffffff;
}

.btn-sm {
  min-height: 38px;
  padding: 6px 12px;
  font-size: 0.85rem;
  width: auto;
}

.result-card-banner {
  background: linear-gradient(135deg, var(--primary-deep), var(--primary-color));
  color: #ffffff;
  padding: 22px 14px;
  border-radius: var(--radius-sm);
  text-align: center;
  margin-bottom: 20px;
}

.result-score-badge {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent-gold);
  margin: 8px 0;
}

.answer-key-box {
  background: var(--surface-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 12px;
}

.correct-ans { color: var(--success-color); font-weight: 700; }
.user-ans { color: var(--primary-deep); font-weight: 700; }

.status-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 0.82rem;
}

.status-active { background: #e8f5e9; color: var(--success-color); border: 1px solid #a5d6a7; }
.status-ended { background: #ffebee; color: var(--danger-color); border: 1px solid #ef9a9a; }

/* Admin Mobile Card Lists */
.admin-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.admin-card-item {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.site-footer {
  background: var(--primary-deep);
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  padding: 22px 14px;
  margin-top: auto;
  border-top: 3px solid var(--accent-gold);
  font-size: 0.88rem;
  width: 100%;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.powered-by-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 6px;
}

.powered-by-container span {
  font-size: 0.75rem;
  color: var(--accent-gold-light);
  opacity: 0.9;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.footer-logo {
  height: 16px;
  width: auto;
  opacity: 0.95;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Bayan Poster Modal */
.poster-modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.poster-modal-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  background: transparent;
}
.poster-modal-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  display: block;
}
.poster-close-btn {
  position: absolute;
  top: -15px;
  right: -15px;
  background: var(--accent-gold);
  color: var(--primary-deep);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ========================================================
   EXAM LOCKED MODE STYLES
   ======================================================== */

body.exam-locked {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

body.exam-locked .site-header,
body.exam-locked .mobile-nav-bar,
body.exam-locked .site-footer {
  display: none !important;
}

body.exam-locked .main-wrapper {
  padding-bottom: 20px;
  margin-top: 10px;
}

/* Violation Modal */
.violation-modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(220, 53, 69, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.violation-modal-content {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 30px 20px;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border: 4px solid var(--primary-deep);
}

.violation-modal-content i {
  font-size: 3.5rem;
  color: var(--danger-color);
  margin-bottom: 15px;
}

.violation-modal-content h3 {
  font-size: 1.4rem;
  color: var(--primary-deep);
  margin-bottom: 10px;
  font-weight: 800;
}

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