/* E-Testing System - Modern UI
 * This CSS provides a modern, responsive and visually appealing UI
 * for the E-Testing System with RTL support for Arabic language
 */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #60a5fa;
  --secondary: #10b981;
  --secondary-dark: #059669;
  --danger: #ef4444;
  --warning: #f59e0b;
  --dark: #1f2937;
  --light: #f9fafb;
  --gray: #6b7280;
  --border-radius: 0.75rem;
  --box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
  --font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Global Styles */
body {
  font-family: var(--font-family);
  background-color: #f5f7fa;
  color: var(--dark);
  line-height: 1.6;
  position: relative;
  min-height: 100vh;

}

@media (max-width: 768px) {
  body {
    padding-bottom: 450px;
  }
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

.container {

  width: 100%;
  padding: 0 15px;
  margin: 0 auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

/* Navbar */
.navbar {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  background: linear-gradient(to right, var(--primary-dark), var(--primary));
  padding: 0.75rem 1rem;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.4rem;
  color: white !important;
}

.nav-link {
  font-weight: 500;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  color: rgba(255, 255, 255, 0.9) !important;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.nav-link:hover,
.nav-link:focus,
.nav-link.active {
  color: white !important;
  background-color: rgba(255, 255, 255, 0.1);
}

.navbar-toggler {
  border: none;
  padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: none;
}

.navbar-dark .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.dropdown-menu {
  padding: 0.5rem 0;
  border: none;
  box-shadow: var(--box-shadow);
  border-radius: var(--border-radius);
}

.dropdown-item {
  padding: 0.5rem 1.5rem;
  font-weight: 500;
  transition: var(--transition);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: rgba(37, 99, 235, 0.1);
  color: var(--primary);
}

/* Cards */
.card {
  border: none;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  overflow: hidden;
  height: 100%;
  margin-bottom: 1.5rem;
  background-color: white;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-header {
  background-color: var(--primary);
  color: white;
  font-weight: 600;
  border-bottom: none;
  padding: 1rem 1.5rem;
}

.card-body {
  padding: 1.5rem;
}

.card-img-top {
  height: 200px;
  object-fit: cover;
}

.card-title {
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--dark);
}

.card-text {
  color: var(--gray);
  margin-bottom: 1.5rem;
}

/* Buttons */
.btn {
  padding: 0.6rem 1.5rem;
  font-weight: 600;
  border-radius: var(--border-radius);
  transition: var(--transition);
  border: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  font-size: 0.95rem;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background-color: var(--secondary);
  color: white;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: var(--secondary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-danger:hover,
.btn-danger:focus {
  background-color: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-outline-primary {
  color: var(--primary);
  border: 2px solid var(--primary);
  background-color: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--primary);
  color: white;
  transform: translateY(-2px);
}

/* Forms */
.form-control {
  padding: 0.75rem 1rem;
  border-radius: var(--border-radius);
  border: 1px solid #e2e8f0;
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.form-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.custom-form {
  background-color: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  margin-bottom: 2rem;
}

.auth-form {
  max-width: 500px;
  margin: 50px auto;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  background-color: white;
}

.auth-form .card-header {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  padding: 1.5rem;
}

/* Alerts */
.alert {
  border-radius: var(--border-radius);
  border: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.alert-info {
  background-color: #dbeafe;
  color: #1e40af;
}

.alert-success {
  background-color: #d1fae5;
  color: #065f46;
}

.alert-danger {
  background-color: #fee2e2;
  color: #b91c1c;
}

.alert-warning {
  background-color: #ffedd5;
  color: #9a3412;
}

/* System Messages */
.system-message {
  margin-bottom: 1.5rem;
  position: relative;
  background-color: #eff6ff;
  border-radius: var(--border-radius);
  padding: 1rem 1.5rem;
  border-right: 4px solid var(--primary);
  box-shadow: var(--box-shadow);
}

.system-message .btn-close {
  position: absolute;
  top: 1rem;
  left: 1rem;
  opacity: 0.8;
}

/* Exam Styles */
.exam-timer {
  font-size: 1.5rem;
  font-weight: bold;
  padding: 0.75rem 1.5rem;
  background-color: #fee2e2;
  color: #b91c1c;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  display: inline-block;
  margin-bottom: 1.5rem;
}

.question-card {
  margin-bottom: 2rem;
  border-right: 5px solid var(--primary);
  background-color: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.question-text {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.answer-option {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: var(--border-radius);
  border: 2px solid #e5e7eb;
  cursor: pointer;
  transition: var(--transition);
  background-color: white;
}

.answer-option:hover {
  border-color: var(--primary-light);
  background-color: #f8fafc;
}

.answer-option.selected {
  background-color: #eff6ff;
  border-color: var(--primary);
}

.answer-option.correct {
  background-color: #d1fae5;
  border-color: var(--secondary);
}

.answer-option.incorrect {
  background-color: #fee2e2;
  border-color: var(--danger);
}

.explanation-box {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background-color: #f0f9ff;
  border-radius: var(--border-radius);
  border-right: 4px solid #0ea5e9;
}

/* Dashboard Cards */
.dashboard-card {
  text-align: center;
  padding: 2rem 1.5rem;
  box-shadow: var(--box-shadow);
  background-color: white;
  border-radius: var(--border-radius);
  transition: var(--transition);
  height: 100%;
  margin-bottom: 1.5rem;
}

.dashboard-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.dashboard-card i {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
  background-color: #eff6ff;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem auto;
}

.dashboard-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--dark);
}

.dashboard-card .count {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--secondary);
  margin-bottom: 1rem;
}

/* Homepage Blocks */
.homepage-block {
  margin-bottom: 2rem;
}

.homepage-block img {
  width: 100%;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
}

.homepage-block img:hover {
  transform: scale(1.02);
}

.homepage-block h2 {
  font-size: 1.8rem;
  margin: 1.5rem 0 1rem;
  color: var(--dark);
}

.homepage-block p {
  color: var(--gray);
  margin-bottom: 1.5rem;
}

/* Profile Page */
.profile-image {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 2rem;
  display: block;
  border: 5px solid var(--primary);
  box-shadow: var(--box-shadow);
}

/* Footer */
footer {
  background: linear-gradient(to right, #1e293b, #0f172a);
  padding: 3rem 0;
  color: white;

  bottom: 0;
  width: 100%;
  margin-top: 10rem;

}

footer h5 {
  color: white;
  font-weight: 700;
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
}

footer a {
  color: rgba(255, 255, 255, 0.8);
  transition: var(--transition);
}

footer a:hover {
  color: white;
  text-decoration: none;
}

footer ul li {
  margin-bottom: 0.75rem;
}

footer .social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  transition: var(--transition);
  margin-right: 0.5rem;
}

footer .social-icons a:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

footer .copyright {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Results Page */
.result-summary {
  background-color: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: var(--box-shadow);
}

.result-summary h2 {
  margin-bottom: 1.5rem;
  color: var(--dark);
}

.result-summary .score {
  font-size: 3.5rem;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 1rem;
}

.result-summary .pass-fail {
  font-size: 1.5rem;
  margin-top: 1rem;
  font-weight: bold;
  padding: 0.5rem 2rem;
  border-radius: 30px;
  display: inline-block;
}

.pass-fail.pass {
  background-color: #d1fae5;
  color: #065f46;
}

.pass-fail.fail {
  background-color: #fee2e2;
  color: #b91c1c;
}

/* Report Button */
.report-btn {
  margin-top: 1rem;
  color: var(--gray);
  text-decoration: none;
  display: inline-block;
  transition: var(--transition);
}

.report-btn:hover {
  color: var(--danger);
}

/* Data Tables */
.table-responsive {
  border-radius: var(--border-radius);

  box-shadow: var(--box-shadow);
}

.table {
  margin-bottom: 0;
}

.table thead th {
  background-color: var(--primary);
  color: white;
  font-weight: 600;
  border: none;
  padding: 1rem;
}

.table tbody td {
  padding: 1rem;
  border-color: #f1f5f9;
  vertical-align: middle;
}

.table tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

.table tbody tr:hover {
  background-color: #f1f5f9;
}

/* Utilities */
.bg-primary-gradient {
  background: linear-gradient(to right, var(--primary-dark), var(--primary));
}

.text-primary {
  color: var(--primary) !important;
}

.text-secondary {
  color: var(--secondary) !important;
}

.rounded {
  border-radius: var(--border-radius) !important;
}

.shadow {
  box-shadow: var(--box-shadow) !important;
}

/* Media Queries */
@media (max-width: 992px) {
  .navbar-collapse {
    background-color: var(--primary-dark);
    padding: 1rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    margin-top: 0.5rem;
  }

  .dashboard-card {
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 768px) {
  .card-img-top {
    height: 160px;
  }

  .homepage-block h2 {
    font-size: 1.5rem;
  }

  .exam-timer {
    font-size: 1.2rem;
  }

  .result-summary .score {
    font-size: 2.5rem;
  }

  .question-text {
    font-size: 1.1rem;
  }

  .answer-option {
    padding: 0.75rem;
  }

  .navbar-brand {
    font-size: 1.2rem;
  }
}

@media (max-width: 576px) {
  body {
    font-size: 0.9rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .dashboard-card i {
    font-size: 2rem;
    width: 60px;
    height: 60px;
  }

  .dashboard-card .count {
    font-size: 2rem;
  }

  .dashboard-card h3 {
    font-size: 1.2rem;
  }

  .table thead th,
  .table tbody td {
    padding: 0.75rem;
  }

  footer {
    text-align: center;
  }

  footer .social-icons {
    margin-top: 1rem;
    justify-content: center;
  }

  .result-summary {
    padding: 1.5rem;
  }

  .question-card {
    padding: 1rem;
  }
}