/* ========================================
   GLOBAL STYLES & VARIABLES
   ======================================== */

/* Color Variables */
:root {
  --primary-bg: #0f172a;
  --secondary-bg: #1e293b;
  --primary-element: #3b82f6;
  --secondary-element: #04bfbf;
  --primary-text: #f8fafc;
  --secondary-text: #94a3b8;
  --accent: #f472b6;
  --success: #22c55e;
  --error: #f22283;
  --gradient-start: #3b82f6;
  --gradient-end: #f472b6;
}

/* Global Animations */
@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* Global Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  overflow-x: hidden;
  background-color: var(--primary-bg);
  color: var(--primary-text);
  font-family: "Tajawal", sans-serif;
  font-weight: 400;
  direction: rtl;
  text-align: right;
}

a {
  text-decoration: none;
  color: var(--primary-text);
  transition: color 0.2s ease;
}

a:hover {
  color: var(--secondary-element);
}

/* ========================================
   GLOBAL NAVIGATION
   ======================================== */

.nav {
  width: 100%;
  padding: 5px;
  height: 85px;
  display: flex;
  align-items: center;
  color: white;
  justify-content: space-between;
  background-color: var(--secondary-bg);
  box-shadow: 0 0.5px 5px rgba(4, 191, 191, 0.5);
  position: relative;
  z-index: 1000;
}

.nav > div:last-child {
  width: 160px;
}

.tabs {
  display: flex;
  justify-content: center;
  flex-direction: row-reverse;
  gap: 50px;
  font-size: 20px;
  flex: 1;
  margin: 0 32px;
  position: relative;
  z-index: 1001;
}

.tabs a {
  padding: 2px 10px;
  justify-content: center;
  text-align: center;
  border-radius: 20px;
  font-weight: 700;
  font-size: 20px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1002;
}

.tabs a:hover {
  transform: translateY(-2px);
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
  color: var(--secondary-element);
}

.active {
  color: var(--secondary-element);
  font-weight: 600;
  background-color: var(--primary-bg);
}

.logo {
  margin-right: 32px;
  width: 69px;
  height: 70px;
  cursor: pointer;
}

.game-center-logo {
  height: 50px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  cursor: pointer;
}

/* Mobile Navigation */
@media screen and (max-width: 768px) {
  .nav {
    padding: 15px;
    height: auto;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
  }

  .nav > div {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  .nav > div:last-child {
    width: 160px;
  }

  .tabs {
    flex-direction: row-reverse;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 0;
    padding: 0;
    width: 100%;
  }
  .tabs a {
    padding: 2px 5px;
  }

  .logo {
    margin: 0;
    display: flex;
    justify-content: center;
  }

  .game-center-logo {
    height: 40px;
    width: auto;
    display: flex;
    justify-content: center;
  }
}

/* ========================================
   HOME PAGE STYLES
   ======================================== */

/* Hero Section - Main landing area */
.hero-section {
  position: relative;
  min-height: calc(100vh - 85px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-bg), var(--secondary-bg));
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 600px;
  padding: 32px;
}

.hero-title {
  font-size: 56px;
  font-weight: 900;
  margin-bottom: 16px;
  background: linear-gradient(to left, var(--error), var(--secondary-element));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fadeInUp 0.8s ease-out;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 25px;
  font-weight: 300;
  color: var(--secondary-text);
  margin-bottom: 40px;
  animation: fadeInUp 0.8s ease-out 0.2s backwards;
  line-height: 1.4;
}

/* Name Input Form */
.name-input-container {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  padding: 32px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.name-input {
  font-family: "Tajawal", sans-serif;
}

.input-wrapper {
  display: flex;
  gap: 16px;
  max-width: 500px;
  margin: 0 auto;
}

.name-form input {
  flex: 1;
  padding: 19px 24px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  font-size: 20px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  color: var(--primary-text);
  transition: all 0.3s ease;
  text-align: right;
}

.name-form input::placeholder {
  color: var(--secondary-text);
  opacity: 0.8;
}

.name-form input:focus {
  outline: none;
  border-color: var(--secondary-element);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.submit-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 19px 28px;
  border: none;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 800;
  font-family: "Tajawal", sans-serif;
  color: white;
  background: linear-gradient(120deg, var(--secondary-element), var(--error));
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(131, 228, 255, 0.3);
}

.submit-btn svg {
  transform: scaleX(-1);
}

/* Floating Background Shapes */
.hero-decoration {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1;
}

.floating-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.15;
  animation: float 8s infinite ease-in-out;
}

.shape1 {
  width: 300px;
  height: 300px;
  background: #077373;
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.shape2 {
  width: 200px;
  height: 200px;
  background: var(--gradient-end);
  top: 60%;
  right: 10%;
  animation-delay: -2s;
}

.shape3 {
  width: 150px;
  height: 150px;
  background: var(--accent);
  bottom: 20%;
  left: 30%;
  animation-delay: -4s;
}

/* Mobile Responsiveness for Home Page */
@media screen and (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .input-wrapper {
    flex-direction: column;
  }

  .submit-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================
   RESULTS PAGE STYLES
   ======================================== */

/* Results Page Hero Section */
.results-hero {
  min-height: calc(100vh - 85px);
  display: block;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary-bg), var(--secondary-bg));
}

.results-title {
  margin: 30px 0px;
  text-align: center;
  font-size: 42px;
  font-weight: 800;
  color: white;
  z-index: 2;
  animation: fadeInUp 0.8s ease-out;
  line-height: 1.5;
}

/* Results Table */
.results-table-container {
  width: 90%;
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 2;
  animation: fadeInUp 0.8s ease-out;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

.results-table th {
  padding: 16px;
  color: var(--primary-text);
  font-weight: 700;
  font-size: 22px;
  text-align: center;
}

.results-table td {
  padding: 12px 16px;
  color: var(--primary-text);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 20px;
  transition: all 0.3s ease;
}

.results-table tr:not(:first-child):hover {
  background: rgba(255, 255, 255, 0.05);
  transform: scale(1.01);
}

.results-table tr:first-child td {
  border-top: none;
}

.results-table tr:last-child td {
  border-bottom: none;
}

.results-table td:first-child {
  font-weight: 500;
  color: white;
  font-size: 22px;
}

.results-table td:nth-child(2) {
  color: var(--secondary-element);
  font-size: 22px;
}

.results-table td:nth-child(3) {
  color: var(--error);
  font-size: 22px;
}

.results-table td:last-child {
  color: var(--secondary-text);
  font-size: 18px;
}

/* Action Buttons */
.buttons-container {
  margin-top: 24px;
  display: flex;
  gap: 16px;
  justify-content: center;
}

.play-again-btn,
.delete-btn {
  padding: 12px 24px;
  border: 2px solid;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  font-family: "Tajawal", sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent;
  position: relative;
  overflow: hidden;
  z-index: 10;
  margin: 20px 0px;
  animation: fadeInUp 0.8s ease-out;
}

.play-again-btn {
  cursor: pointer;
  border-color: var(--secondary-element);
  color: var(--secondary-element);
}

.delete-btn {
  border-color: var(--error);
  color: var(--error);
}

.play-again-btn:hover {
  background: var(--secondary-element);
  color: white;
}

.delete-btn:hover {
  background: var(--error);
  color: white;
}

/* Mobile Responsiveness for Results Page */
@media screen and (max-width: 768px) {
  .results-hero {
    height: calc(100vh - 120px);
    padding: 16px;
  }

  .results-title {
    top: 20px;
    font-size: 32px;
  }

  .results-table-container {
    width: 95%;
    padding: 16px;
  }

  .results-table th,
  .results-table td {
    padding: 10px;
    font-size: 18px;
  }

  .results-table td:first-child,
  .results-table td:nth-child(2),
  .results-table td:nth-child(3) {
    font-size: 20px;
  }

  .results-table td:last-child {
    font-size: 16px;
  }
}

/* ========================================
   ABOUT PAGE STYLES
   ======================================== */

/* About Page Hero Section */
.about-hero {
  height: calc(100vh - 85px);
  display: block;
  padding: 40px 20px;
  background: linear-gradient(135deg, var(--primary-bg), var(--secondary-bg));
}

.about-title {
  text-align: center;
  font-size: 42px;
  font-weight: 800;
  color: white;
  margin: 20px 0;
  z-index: 3;
  animation: fadeInUp 0.8s ease-out;
  line-height: 1.5;
}

.about-container {
  width: 40%;
  margin: 0 auto;
  padding: 25px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 2;
  animation: fadeInUp 0.8s ease-out;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
}

.section-header {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.supervision,
.students {
  margin-bottom: 1.5rem;
  text-align: center;
}

.section-divider {
  height: 2px;
  margin-bottom: 15px;
  background: linear-gradient(
    to right,
    transparent,
    var(--secondary-element),
    transparent
  );
  opacity: 0.7;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.supervision h2,
.students h2 {
  color: #04bfbf;
  font-size: 24px;
  font-weight: 700;
}

.section-content {
  padding: 0 1rem;
}

.supervision p:hover,
.students li:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(-5px);
}

.students ul {
  list-style: none;
}

.students li,
.section-content p {
  font-size: 20px;
  color: var(--primary-text);
  padding: 0.5rem 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border-radius: 8px;
  text-align: center;
  width: fit-content;
  margin: 0.6rem auto;
}

.students li:hover,
.section-content p:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(-5px);
}

/* GitHub Button */
.about-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.github-btn-icon:last-child {
  display: flex;
  align-items: center;
  z-index: 10;
  animation: fadeInUp 0.8s ease-out;
}

.github-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  margin-top: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.github-btn:last-child {
  margin-top: 2px;
}

.github-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  border-color: var(--secondary-element);
}

.github-icon {
  width: 28px;
  height: 28px;
  transition: transform 0.3s ease;
}

.github-btn:hover .github-icon {
  transform: scale(1.1);
}

.student-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  color: var(--primary-text);
  padding: 0.5rem 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border-radius: 8px;
  text-align: center;
  width: fit-content;
  margin: 0.6rem auto;
}

.student-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(-5px);
}

/* Mobile Responsiveness for About Page */
@media screen and (max-width: 768px) {
  .about-hero {
    height: calc(100vh - 120px);
    padding: 20px 16px;
  }

  .about-title {
    font-size: 32px;
    margin-bottom: 40px;
  }

  .about-container {
    width: 90%;
    padding: 20px;
  }

  .section-icon {
    font-size: 24px;
  }

  .supervision h2,
  .students h2 {
    font-size: 22px;
  }

  .supervision p {
    font-size: 18px;
  }

  .students li {
    font-size: 18px;
    padding: 0.4rem 0.8rem;
  }

  .github-btn {
    margin-top: 0px;
    margin-bottom: 20px;
  }
  .github-btn:last-child {
    margin-top: 10px;
  }
}

/* ========================================
   QUIZ COMPONENTS STYLES
   ======================================== */

/* Question Container */
.question-container {
  width: 100%;
  max-width: 600px;
  position: relative;
  z-index: 2;
  display: none;
}

.question-box {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  padding: 25px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 0.8s ease-out;
}

/* Timer */
.timer-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-bottom: 10px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.timer-icon {
  width: 24px;
  height: 24px;
  margin-left: 8px;
  vertical-align: middle;
}

.timer-label {
  color: var(--secondary-text);
  font-size: 18px;
}

.timer-value {
  color: var(--secondary-element);
  font-size: 24px;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
}

.timer-value.warning {
  color: var(--error);
  animation: pulse 1s infinite;
}

/* Question Content */
.question-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-text);
  margin-bottom: 24px;
  text-align: center;
}

.answers-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.answer-option {
  display: flex;
  align-items: center;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.answer-option:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(-5px);
}

.answer-option input[type="radio"] {
  display: none;
}

.answer-text {
  font-size: 18px;
  color: var(--primary-text);
  margin-right: 12px;
  transition: all 0.3s ease;
}

.answer-option input[type="radio"]:checked + .answer-text {
  color: var(--secondary-element);
  font-weight: 600;
  transform: scale(1.05);
}

.answer-option input[type="radio"]:checked {
  background: var(--secondary-element);
}

.answer-option:has(input[type="radio"]:checked) {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--secondary-element);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
  transform: translateX(-5px);
}

.answer-option:has(input[type="radio"]:checked)::before {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: var(--error);
  border-radius: 2px;
}

.answer-option:has(input[type="radio"]:checked)::after {
  content: "✓";
  position: absolute;
  left: 16px;
  color: var(--secondary-element);
  font-weight: bold;
  font-size: 18px;
  animation: fadeIn 0.3s ease;
}

/* Navigation Buttons */
.navigation-buttons {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.nav-btn {
  flex: 1;
  padding: 10px 24px;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  font-family: "Tajawal", sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
}

.prev-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--primary-text);
}

.next-btn {
  background: linear-gradient(135deg, var(--secondary-element));
  color: white;
}

.prev-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: var(--secondary-bg);
  border-color: var(--secondary-text);
  color: var(--secondary-text);
  transform: none;
  box-shadow: none;
}

.nav-btn:disabled:hover {
  transform: none;
  box-shadow: none;
  background-color: var(--secondary-bg);
  border-color: var(--secondary-text);
  color: var(--secondary-text);
}

/* Stats Container */
.stats-container {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.stat-label {
  color: var(--secondary-text);
  font-size: 16px;
}

.stat-value {
  color: var(--secondary-element);
  font-size: 24px;
  font-weight: 700;
}

/* Mobile Responsiveness for Quiz Components */
@media screen and (max-width: 768px) {
  .question-container {
    padding: 0 16px;
  }

  .question-box {
    padding: 24px;
  }

  .question-title {
    font-size: 20px;
  }

  .answer-text {
    font-size: 16px;
  }

  .nav-btn {
    padding: 12px 20px;
    font-size: 16px;
  }

  .stats-container {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }

  .stat-item {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }

  .stat-label {
    font-size: 14px;
  }

  .stat-value {
    font-size: 20px;
  }
}
