@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;700&display=swap');

body {
  font-family: 'Tajawal', sans-serif;
  background: linear-gradient(135deg, #6a11cb, #2575fc);
  background-image: url('logobbb.jpg');
  background-size: cover;
  background-attachment: fixed;
  text-align: center;
  direction: rtl;
  color: #ffffff;
  padding: 0;
  margin: 0;
}


/* لإضافة تأثير الزجاج على الكونتينر */
.container {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 25px;
  margin: 20px auto;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.2);
}


h1,
h2 {
  color: #FFD700;
  text-shadow: 2px 2px 10px rgba(255, 215, 0, 0.7);
}

.container {
  background: rgba(0, 0, 0, 0.8);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0px 4px 10px rgba(255, 215, 0, 0.3);
  width: 85%;
  margin: auto;
  animation: fadeIn 1.5s ease-in-out;
}

button {
  background-color: #8B008B;
  color: white;
  padding: 12px 25px;
  border: none;
  cursor: pointer;
  margin-top: 10px;
  font-size: 18px;
  border-radius: 8px;
  font-weight: bold;
  transition: transform 0.3s, box-shadow 0.3s;
}

button:hover {
  background-color: #FFD700;
  color: #8B008B;
  transform: scale(1.1);
  box-shadow: 0px 0px 15px rgba(255, 215, 0, 0.9);
}

input {
  display: block;
  margin: 10px auto;
  padding: 10px;
  width: 80%;
  border-radius: 8px;
  border: 2px solid #FFD700;
  font-size: 16px;
  text-align: center;
}

.animated-text {
  animation: glow 2s infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 0 0 10px #FFD700;
  }

  to {
    text-shadow: 0 0 20px #FFD700;
  }
}

.dynamic-btn {
  display: inline-block;
  background: linear-gradient(45deg, #FFD700, #8B008B);
  color: white;
  padding: 12px 25px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 18px;
  transition: all 0.3s ease-in-out;
}

.dynamic-btn:hover {
  transform: scale(1.1);
  box-shadow: 0px 0px 15px rgba(255, 215, 0, 0.9);
}

.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 90vh;
}

.view-data-button {
  display: inline-block;
  padding: 10px 20px;
  margin-top: 20px;
  background-color: #8B008B;
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.view-data-button:hover {
  background-color: #FFD700;
}

.container {
  overflow-x: auto;
  margin: 20px auto;
  max-width: 95%;
}

/* ---------- جدول البيانات ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
  background: #fff;
}

thead {
  background: linear-gradient(to right, #15ff00, #ea00ff);
  color: #fff;
  text-align: center;
  font-size: 18px;
}

thead th {
  padding: 12px 20px;
}

tbody tr {
  transition: background-color 0.3s ease;
}

tbody tr:hover {
  background-color: #f1f1f1;
}

tbody td {
  padding: 12px 20px;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  background: #f1f1f1;
  color: #333;
}

tfoot td {
  padding: 12px 20px;
  background-color: #f5f5f5;
  font-weight: bold;
  font-size: 18px;
  text-align: center;
}

.print-button {
  display: inline-block;
  margin: 20px auto;
  padding: 12px 24px;
  background: linear-gradient(to right, #28a745, #218838);
  color: white;
  font-size: 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.print-button:hover {
  background: linear-gradient(to right, #218838, #1e7e34);
  transform: scale(1.05);
}

@media print {
  .print-button {
    display: none;
  }
}

/* ---------- NAVBAR ---------- */

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(90deg, #008b68, #008b74);
  padding: 15px 30px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-links {
  display: flex;
  gap: 25px;
}

.nav-links a {
  font-size: 18px;
  font-weight: bold;
  color: white;
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 8px 16px;
  border-radius: 5px;
}

.nav-links a:hover {
  background-color: #FFD700;
  color: #ffffff;
  transform: scale(1.05);
}

.menu-toggle {
  display: none;
  font-size: 30px;
  color: white;
  cursor: pointer;
}

/* ---------- RESPONSIVE NAV ---------- */

@media (max-width: 768px) {

  .menu-toggle {
    display: block;
  }

  .nav-links {
    background-color: #b600ad;
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    flex-direction: column;
    padding-top: 60px;
    text-align: center;
  }

}

/* ---------- لوجو دائري ---------- */

.logo img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

/* Dropdown container */
.dropdown {
  position: relative;
  display: inline-block;
}

/* Dropdown content */
.dropdown-content {
  display: none;
  position: absolute;
  background-color: #b600ad;
  min-width: 180px;
  box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  z-index: 1000;
  right: 0;
  /* لتناسب RTL */
}

/* Links inside the dropdown */
.dropdown-content a {
  color: white;
  padding: 10px 16px;
  text-decoration: none;
  display: block;
  text-align: right;
  font-weight: bold;
}

.dropdown-content a:hover {
  background-color: #FFD700;
  color: #000;
}

/* Show the dropdown on hover */
.dropdown:hover .dropdown-content {
  display: block;
}

/* ---------- TOOLBAR STYLES ---------- */
.toolbar {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 20px;
  margin: 20px auto;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  text-align: center;
  color: white;
}

.tool-group,
.login-group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.tool-input,
.tool-select {
  padding: 10px 15px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: bold;
  outline: none;
  transition: all 0.3s ease;
  width: auto !important;
  /* Override global input */
  margin: 0 !important;
  /* Override global margin */
  display: inline-block !important;
}

.tool-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.tool-input:focus,
.tool-select:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: #FFD700;
}

.tool-select option {
  background: #333;
  color: white;
}

.tool-file {
  padding: 5px;
  color: white;
  width: auto !important;
  margin: 0 !important;
  display: inline-block !important;
  border: none !important;
}

.tool-btn {
  padding: 10px 25px;
  background: linear-gradient(45deg, #FFD700, #ffca00);
  border: none;
  border-radius: 8px;
  color: #333;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  width: auto !important;
  margin: 0 !important;
}

.tool-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.upload-btn {
  background: linear-gradient(45deg, #00E676, #00C853);
  color: white;
}

.upload-btn:hover {
  box-shadow: 0 0 15px rgba(0, 230, 118, 0.5);
}

/* Dynamic Logo Styling - Professional Circular Design */
.dynamic-logo {
  height: 70px;
  /* Slightly larger for the app pages */
  width: 70px;
  object-fit: cover;
  border-radius: 50%;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
  border: 2px solid rgba(255, 215, 0, 0.4);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  vertical-align: middle;
}

.dynamic-logo:hover {
  transform: scale(1.1) rotate(360deg);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.7), 0 0 60px rgba(255, 215, 0, 0.4);
  border-color: #FFD700;
}

.dynamic-logo:active {
  transform: scale(0.95);
}

/* ---------- Game Mode / Practice Styles ---------- */
.view-toggle-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
}

.view-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 25px;
  border-radius: 30px;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-btn.active {
  background: #FFD700;
  color: #333;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.path-container {
  display: none;
  /* Hidden by default */
  flex-direction: column;
  align-items: center;
  padding: 50px 0;
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}

.level-node {
  width: 80px;
  height: 80px;
  background: #333;
  /* Locked color */
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
  position: relative;
  margin: 20px 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 2;
}

.level-node.unlocked {
  background: linear-gradient(135deg, #00C853, #00E676);
  color: white;
  cursor: pointer;
  box-shadow: 0 10px 0 #009624;
  /* 3D effect */
  border-color: white;
}

.level-node.current {
  transform: scale(1.2);
  box-shadow: 0 0 30px rgba(0, 230, 118, 0.6), 0 10px 0 #009624;
  animation: bounce 2s infinite;
}

.level-node.completed {
  background: linear-gradient(135deg, #FFD700, #FFCA28);
  box-shadow: 0 10px 0 #F57F17;
}

@keyframes bounce {

  0%,
  100% {
    transform: scale(1.2) translateY(0);
  }

  50% {
    transform: scale(1.2) translateY(-10px);
  }
}

.level-node:active {
  transform: translateY(5px);
  box-shadow: 0 5px 0 #009624;
}

/* Winding Path Effect */
.level-row {
  display: flex;
  width: 100%;
  justify-content: center;
  position: relative;
}

.level-row:nth-child(odd) {
  justify-content: flex-start;
  padding-left: 20%;
}

.level-row:nth-child(even) {
  justify-content: flex-end;
  padding-right: 20%;
}

/* Or simple zigzag using margins */
.level-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

.level-wrapper:nth-child(4n+1) .level-node {
  margin-left: 0;
}

.level-wrapper:nth-child(4n+2) .level-node {
  margin-left: 100px;
}

.level-wrapper:nth-child(4n+3) .level-node {
  margin-left: 0;
}

.level-wrapper:nth-child(4n+4) .level-node {
  margin-left: -100px;
}

/* Modal Styles */
.game-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  display: none;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(10px);
}

.game-card {
  background: #1e1e1e;
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  text-align: center;
  border: 2px solid #FFD700;
  color: white;
  max-height: 90vh;
  overflow-y: auto;
}

.option-btn {
  display: block;
  width: 100%;
  padding: 15px;
  margin: 10px 0;
  background: #333;
  border: 2px solid #555;
  border-radius: 15px;
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  transition: 0.3s;
  text-align: right;
}

.option-btn:hover {
  background: #444;
  border-color: #FFD700;
}

.option-btn.correct {
  background: #00C853;
  border-color: #00E676;
}

.option-btn.wrong {
  background: #D50000;
  border-color: #FF1744;
  animation: shake 0.5s;
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-10px);
  }

  75% {
    transform: translateX(10px);
  }
}

.admin-controls-fixed {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
}


#pathLevels {
  display: flex;
  flex-direction: column-reverse;
  /* Level 1 at the bottom */
  width: 100%;
  align-items: center;
  padding-bottom: 50px;
}

/* ---------- MOBILE RESPONSIVENESS (ADDED) ---------- */
@media (max-width: 768px) {

  /* Adjust Container Widths */
  .container,
  .tabs-container,
  .data-table-container,
  .toolbar {
    width: 95% !important;
    padding: 15px !important;
    margin: 10px auto !important;
  }

  /* Fix Header Navigation Buttons */
  .nav-header-buttons {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    width: 100%;
    gap: 15px !important;
  }

  .back-home {
    position: relative !important;
    display: block;
    width: 80%;
    text-align: center;
    margin-bottom: 5px;
    top: auto !important;
    left: auto !important;
  }

  /* Logo Adjustment */
  img.dynamic-logo[alt="Main Page"] {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    display: block;
    margin: 10px auto;
    height: 60px !important;
  }

  /* Ensure the link wrapping the logo is also static */
  a[href="index.html"] {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    display: block;
    text-align: center;
  }

  /* Header Text */
  .header-section {
    padding: 20px !important;
  }

  .header-section h1 {
    font-size: 1.8rem !important;
  }

  .header-section p {
    font-size: 1rem !important;
  }

  /* Admin Panel Form Elements */
  .tool-group {
    flex-direction: column;
    align-items: stretch;
  }

  .tool-group>div {
    width: 100%;
    min-width: unset !important;
  }

  .tool-input,
  .tool-select,
  .tool-file,
  #uploadBtn {
    width: 100% !important;
    margin: 5px 0 !important;
  }

  /* Filter Buttons */
  .semester-tabs {
    flex-wrap: wrap;
  }

  .filter-group {
    justify-content: center;
  }

  .filter-chip {
    font-size: 0.8rem;
    padding: 5px 10px;
  }

  /* Table Adjustments */
  th,
  td {
    padding: 10px 5px !important;
    font-size: 0.85rem !important;
  }

  .badge {
    padding: 3px 6px;
    font-size: 0.7rem;
  }

  .dynamic-btn {
    padding: 6px 10px !important;
    font-size: 0.8rem !important;
  }

  /* Path/Game Responsive */
  .path-container {
    padding: 20px 0;
  }

  .level-wrapper:nth-child(odd) .level-node {
    margin-right: 40px !important;
    /* Reduce zigzag */
  }

  .level-wrapper:nth-child(even) .level-node {
    margin-left: 40px !important;
    /* Reduce zigzag */
  }

  .level-node {
    width: 60px !important;
    height: 60px !important;
    font-size: 1.5rem !important;
  }

  /* Modals */
  .game-card {
    width: 95%;
    padding: 15px;
  }

  #certificateContent {
    transform: scale(0.35) !important;
    /* Scale down certificate preview on mobile */
    transform-origin: top center;
    margin-bottom: -500px !important;
    /* Compansate for scale space */
  }
}
