﻿:root {
    --app-primary: #0f766e;
    --app-primary-dark: #115e59;
    --app-accent: #f59e0b;
    --app-bg: #f4f7f8;
    --app-text: #122029;
    --app-muted: #687684;
    --app-border: #d8e1e6;
    --app-main-margin-top: 30px;
    --bs-border-radius: 1rem;
    --bs-border-radius-lg: 1rem;
}

html {
    font-size: 15px;
    line-height: 1.15;
    scroll-behavior: smooth !important;
}

body {
    font-family: 'Vazirmatn', 'Noto Color Emoji', 'Motiff Emoji', 'Noto Sans', 'Noto Sans Symbols', 'Noto Sans Symbols 2', 'Noto Sans Math', 'Noto Sans JP', 'Noto Sans SC', 'Noto Sans HK', 'Noto Sans KR', 'Noto Sans Hebrew', 'Noto Sans Tamil', 'Noto Sans Thai', 'Noto Sans Tai Le', 'Noto Sans New Tai Lue', 'Noto Sans Tai Tham', 'Noto Sans Tai Viet', 'Noto Sans Lao', 'Noto Sans Khmer', 'Noto Sans Bengali', 'Noto Sans Gujarati', 'Noto Sans Telugu', 'Noto Sans Kannada', 'Noto Sans Malayalam', 'Noto Sans Javanese', 'Noto Sans Georgian', 'Noto Sans Devanagari', 'Noto Sans Arabic', sans-serif !important;
    width: 100%;
    margin: 0;
    background: radial-gradient(circle at top right, rgba(15, 118, 110, 0.12), transparent 32%), linear-gradient(180deg, #f9fbfb 0%, var(--app-bg) 100%);
    color: var(--app-text);

    font-size: 1rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.logo-icon {
    width: 36px;
    height: 36px;
    display: inline-block;
    flex-shrink: 0;
}

.main-content {
    flex: 1 0 auto;
    margin-top: var(--app-main-margin-top);
}

a {
  text-decoration: none;
}

::placeholder,
.select2-selection__placeholder {
    color: #c4c4c4 !important;
    opacity: 1;
}

.app-navbar {
    background: linear-gradient(135deg, var(--app-primary-dark), var(--app-primary));
    height: 60px;
}

.app-footer {
    border-top: 1px solid rgba(15, 118, 110, 0.12);
    background-color: rgba(255, 255, 255, 0.65);
    padding: 1rem;
    color: #e3e3e3;
    margin-top: auto;
    flex-shrink: 0;
}

.hero-section {
  background: linear-gradient(135deg, #0f766e 0%, #1f9f93 60%, #f0a11e 100%);
  color: #fff;
  box-shadow: 0 22px 50px rgba(15, 118, 110, 0.18);
}

.glass-card,
.stat-chip,
.mini-stat,
.randomizer-number-panel {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 1rem;
}

.stat-chip,
.mini-stat {
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-chip strong,
.mini-stat strong {
  font-size: 1.35rem;
}

.quick-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  color: var(--app-text);
  background-color: #f6fbfb;
  border: 1px solid var(--app-border);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.quick-link:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: 0 12px 25px rgba(15, 118, 110, 0.08);
}

.card {
  border-radius: 1.25rem;
}

.page-header h1,
.page-header .h3 {
  font-weight: 700;
}

.admin-tabs .nav-link {
    color: var(--app-text);
    border-radius: 999px;
    padding: 0.7rem 1.15rem;
    font-weight: 600;
    background-color: #f4f8f8;
}

.admin-tabs .nav-link:hover {
    background-color: #e7f2f1;
    color: var(--app-primary-dark);
}

.admin-tabs .nav-link.active {
    background-color: var(--app-primary);
    color: #fff;
}

.admin-subtabs {
  border-bottom: 1px solid rgba(15, 118, 110, 0.14);
}

.admin-subtabs .nav-link {
  color: var(--app-text);
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0.9rem 0.9rem 0 0;
  padding: 0.95rem 1.2rem;
  font-weight: 700;
  background-color: transparent;
}

.admin-subtabs .nav-link:hover {
  color: var(--app-primary-dark);
  background-color: rgba(15, 118, 110, 0.05);
}

.admin-subtabs .nav-link.active {
  color: var(--app-primary-dark);
  background-color: #f8fcfc;
  border-bottom-color: var(--app-primary);
}

.admin-subtabs-card .tab-pane {
  padding-top: 0.5rem;
}

.question-table th,
.question-table td,
table th,
table td {
  white-space: normal;
}

.quiz-card {
  overflow: hidden;
}

.quiz-timer {
  min-width: 140px;
  padding: 1rem;
  border-radius: 1rem;
  text-align: center;
  background: #f6fbfb;
  border: 1px solid var(--app-border);
}

.timer-value {
  font-size: 2rem;
  color: var(--app-primary-dark);
}

.option-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--app-border);
  background: #fff;
  border-radius: 1rem;
  cursor: pointer;
  height: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.option-card:hover {
  border-color: rgba(15, 118, 110, 0.45);
  transform: translateY(-1px);
}

.option-card input[type="radio"] {
  display: none;
}

.option-card:has(input[type="radio"]:checked) {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.12);
}

.option-card.static {
  cursor: default;
}

.option-index {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #eff6f6;
  color: var(--app-primary-dark);
  font-weight: 700;
}

.answer-correct {
  border-color: #198754;
  background-color: #edf9f2;
}

.answer-wrong {
  border-color: #dc3545;
  background-color: #fff2f3;
}

.answer-neutral {
  background-color: #fafafa;
}

.randomizer-number-panel {
  padding: 1.25rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(245, 158, 11, 0.12));
  border: 1px dashed rgba(15, 118, 110, 0.25);
  position: relative;
  overflow: hidden;
}

.randomizer-number-display {
  font-size: clamp(4rem, 8vw, 8rem);
  font-weight: 800;
  color: var(--app-primary-dark);
  line-height: 1;
  transition: transform 0.25s ease, text-shadow 0.25s ease, filter 0.25s ease;
}

.randomizer-number-display.rolling {
  animation: rollingPulse 0.18s linear infinite;
  text-shadow: 0 0 18px rgba(15, 118, 110, 0.3);
}

.randomizer-number-display.final-reveal {
  animation: revealPop 0.7s ease;
  text-shadow: 0 0 25px rgba(245, 158, 11, 0.45);
}

.randomizer-result-shell {
  position: relative;
  overflow: hidden;
}

.fireworks-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 3;
}

.firework-particle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  left: var(--x);
  top: var(--y);
  background: var(--color);
  box-shadow: 0 0 14px var(--color);
  animation: fireworkBurst 900ms ease-out forwards;
}

.firework-flash {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.2) 45%, transparent 70%);
  animation: flashPulse 650ms ease-out forwards;
  pointer-events: none;
  z-index: 2;
}

.history-badge {
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background-color: #eef8f7;
  color: var(--app-primary-dark);
  border: 1px solid rgba(15, 118, 110, 0.15);
  font-size: 1rem;
}

.difficulty-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.5rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  border: 1px solid transparent;
}

.difficulty-easy {
  color: #2f8f5b;
  background-color: #dcfce7;
  border-color: #bbf7d0;
}

.difficulty-medium {
  color: #b7791f;
  background-color: #fef3c7;
  border-color: #fde68a;
}

.difficulty-hard {
  color: #c2413b;
  background-color: #fee2e2;
  border-color: #fecaca;
}

.difficulty-default {
  color: #5b6673;
  background-color: #f2f4f7;
  border-color: #e4e7ec;
}

.btn-primary {
  background-color: var(--app-primary);
  border-color: var(--app-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--app-primary-dark);
  border-color: var(--app-primary-dark);
}

.form-control,
.form-select {
    border-radius: 0.9rem;
    border-color: var(--app-border);
    padding: .75rem .75rem;
}

.form-check-input {
  width: 1.15rem;
  height: 1.15rem;
}

.form-control:focus,
.form-select:focus,
.btn:focus,
.btn:active:focus {
  box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.12);
}

.field-validation-error,
.validation-summary-errors {
  color: #b42318;
}

.form-label {
    font-weight: bold;
}

.panel {
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(245, 158, 11, 0.12));
    border: 1px dashed rgba(15, 118, 110, 0.25);
    position: relative;
    overflow: hidden;
}

@keyframes rollingPulse {
  0% { transform: scale(1) rotate(0deg); filter: brightness(1); }
  50% { transform: scale(1.08) rotate(-2deg); filter: brightness(1.1); }
  100% { transform: scale(1) rotate(0deg); filter: brightness(1); }
}

@keyframes revealPop {
  0% { transform: scale(0.75); opacity: 0.2; }
  55% { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fireworkBurst {
  0% {
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1);
    opacity: 0;
  }
}

@keyframes flashPulse {
  0% { opacity: 0.95; transform: translate(-50%, -50%) scale(0.2); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.8); }
}

@media (max-width: 767.98px) {
    body {
        font-size: 0.98rem;
    }

    .hero-section {
        border-radius: 1.2rem !important;
    }

    .admin-subtabs .nav-link {
        padding: 0.8rem 0.9rem;
        font-size: 0.95rem;
    }
}

.quiz-page-title,
.quiz-competition-title {
  font-weight: 800;
  color: #0a6a63;
}

.quiz-page-title {
  font-size: clamp(1.9rem, 3vw, 2.6rem);
}

.quiz-competition-title {
  font-size: clamp(1.35rem, 2.1vw, 1.95rem);
}

.score-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1.4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(15, 118, 110, 0.08));
  color: #075f59;
  font-weight: 800;
  font-size: 1.1rem;
}

.score-chip i {
  font-size: 1.2rem;
}

.quiz-category-badge {
  background-color: #efe3bf;
  color: #946200;
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  font-size: 0.95rem;
}

.quiz-question-panel {
  padding: 2.25rem;
  border-radius: 1.8rem;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 118, 110, 0.08);
}

.quiz-question-text {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  line-height: 1.7;
  font-weight: 800;
  text-align: center;
}

.quiz-option-card {
  min-height: 108px;
  font-size: 1.1rem;
  justify-content: right;
}

.competition-settings-card .settings-input,
.competition-settings-card .settings-addon {
  background-color: #f1f4f7;
  border-color: transparent;
  min-height: 74px;
  font-size: 1.15rem;
  font-weight: 700;
}

.competition-settings-card .settings-addon {
  color: #90a4bb;
}

.competition-settings-card hr {
  border-color: rgba(15, 118, 110, 0.1);
}

.settings-switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.settings-switch .form-check-input {
  float: none;
  margin: 0;
  width: 3rem;
  height: 1.5rem;
}

.settings-switch .form-check-label {
  margin: 0;
  font-weight: 700;
}

.quiz-timer.quiz-timer-pulse {
  border-color: rgba(220, 53, 69, 0.35);
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.08);
  animation: timerHeartbeat 0.9s ease-in-out infinite;
}

@keyframes timerHeartbeat {
  0% { transform: scale(1); }
  18% { transform: scale(1.04); }
  32% { transform: scale(0.99); }
  48% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.quiz-timer.quiz-timer-pulse-fast {
  animation: timerHeartbeatFast 0.55s ease-in-out infinite;
}

@keyframes timerHeartbeatFast {
  0% { transform: scale(1); }
  20% { transform: scale(1.06); }
  34% { transform: scale(0.98); }
  52% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.quiz-timer.quiz-timer-pulse {
  background: linear-gradient(135deg, #fff7db, #ffe7a3);
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.12), 0 14px 28px rgba(245, 158, 11, 0.12);
}

.quiz-timer.quiz-timer-pulse .timer-value {
  color: #9a6700;
}

.quiz-timer.quiz-timer-pulse-fast {
  background: linear-gradient(135deg, #ffe0e0, #ffb8b8);
  border-color: rgba(220, 53, 69, 0.5);
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.12), 0 16px 30px rgba(220, 53, 69, 0.14);
}

.quiz-timer.quiz-timer-pulse-fast .timer-value {
  color: #b42318;
}

.form-select-lg ~ .select2-container--bootstrap-5 .select2-selection,
.select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field,
.select2-container--bootstrap-5 .select2--large.select2-dropdown {
    border-radius: var(--bs-border-radius-lg);
}

.select2-container--bootstrap-5 .select2--large.select2-dropdown {
    padding-top:5px;
}