/* Madrasa Arabic Placement Test - Custom Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-green: #7EC900;
  --turquoise: #0FC8D4;
  --light-blue: #B1D4E2;
  --text-dark: #333;
  --white: #ffffff;
}

body {
  font-family: 'Assistant', 'Heebo', -apple-system, BlinkMacSystemFont, sans-serif;
  direction: rtl;
  background: linear-gradient(180deg, var(--light-blue) 0%, var(--white) 100%);
  min-height: 100vh;
  color: var(--text-dark);
}

/* Typography */
h1, h2, h3 {
  color: var(--primary-green);
  font-weight: bold;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

p {
  line-height: 1.8;
  margin-bottom: 1rem;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Logo */
.logo {
  text-align: center;
  margin-bottom: 2rem;
}

.logo img {
  max-width: 250px;
  height: auto;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--white);
  background-color: var(--primary-green);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: center;
}

.btn:hover {
  background-color: #6BB000;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(126, 201, 0, 0.3);
}

.btn-secondary {
  background-color: var(--turquoise);
}

.btn-secondary:hover {
  background-color: #0DB0BC;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: 16px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--turquoise);
}

.card h3 {
  margin-bottom: 1rem;
}

/* Progress Bar */
.progress-container {
  background: var(--white);
  border-radius: 50px;
  padding: 0.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-bar-wrapper {
  flex: 1;
  margin: 0 1rem;
  background: #e0e0e0;
  border-radius: 50px;
  height: 12px;
  overflow: hidden;
}

.progress-bar {
  background: var(--primary-green);
  height: 100%;
  border-radius: 50px;
  transition: width 0.3s ease;
}

.progress-text {
  font-weight: bold;
  color: var(--text-dark);
  white-space: nowrap;
  padding: 0 1rem;
}

/* Question Card */
.question-card {
  background: var(--white);
  border-radius: 16px;
  padding: 3rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--turquoise);
  max-width: 800px;
  margin: 0 auto;
}

.encouragement {
  color: var(--turquoise);
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  text-align: center;
}

.question-text {
  font-size: 1.5rem;
  color: var(--text-dark);
  margin-bottom: 2rem;
  text-align: right;
  line-height: 1.8;
}

/* Answer Options */
.options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.option {
  background: #f5f5f5;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.5rem;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: right;
}

.option:hover {
  background: #e8f5e9;
  border-color: var(--primary-green);
  transform: translateX(-5px);
}

.option.selected {
  background: #e8f5e9;
  border-color: var(--primary-green);
  font-weight: bold;
}

/* Open Answer */
.open-answer {
  width: 100%;
  min-height: 150px;
  padding: 1rem;
  font-size: 1.125rem;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  direction: rtl;
  text-align: right;
  font-family: inherit;
  resize: vertical;
}

.open-answer:focus {
  outline: none;
  border-color: var(--primary-green);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 3rem 0;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.5rem;
  color: var(--text-dark);
  margin-bottom: 2rem;
}

.hero-image {
  max-width: 400px;
  height: auto;
  margin: 2rem auto;
  display: block;
  border-radius: 16px;
}

/* Info Sections */
.info-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 3rem 0;
}

/* Admin Login */
.admin-link {
  text-align: center;
  margin-top: 4rem;
  padding: 2rem 0;
}

.admin-link a {
  color: #999;
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.3s ease;
}

.admin-link a:hover {
  color: var(--turquoise);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--white);
  border-radius: 16px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  text-align: center;
}

.modal-content h2 {
  margin-bottom: 1.5rem;
}

.modal-content input {
  width: 100%;
  padding: 1rem;
  font-size: 1.125rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 1rem;
  direction: ltr;
  text-align: left;
}

.modal-content input:focus {
  outline: none;
  border-color: var(--primary-green);
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

/* Result Page */
.result-container {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  padding: 3rem 2rem;
}

.result-icon {
  font-size: 4rem;
  margin-bottom: 2rem;
}

.result-message {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  line-height: 1.8;
}

/* Admin Dashboard */
.admin-header {
  background: var(--white);
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.admin-nav {
  display: flex;
  gap: 1rem;
}

.admin-nav button {
  padding: 0.75rem 1.5rem;
  background: #f5f5f5;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.admin-nav button.active {
  background: var(--primary-green);
  color: var(--white);
}

.admin-table {
  width: 100%;
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.admin-table table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 1rem;
  text-align: right;
  border-bottom: 1px solid #e0e0e0;
}

.admin-table th {
  background: var(--light-blue);
  font-weight: bold;
}

.admin-table tr:hover {
  background: #f5f5f5;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 1.75rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .logo img {
    max-width: 90px;
  }

  .question-card {
    padding: 2rem;
  }

  .question-text {
    font-size: 1.25rem;
  }

  .option {
    padding: 1rem;
    font-size: 1.125rem;
  }

  .progress-text {
    font-size: 0.875rem;
  }

  .info-section {
    grid-template-columns: 1fr;
  }
}

/* Extra small devices (phones, less than 576px) */
@media (max-width: 576px) {
  .container {
    padding: 0.5rem;
  }

  .logo img {
    max-width: 80px !important;
  }

  .hero h1 {
    font-size: 1.35rem !important;
    margin-bottom: 0.4rem !important;
  }

  .hero p {
    font-size: 0.95rem !important;
    margin-bottom: 1rem !important;
  }

  .btn {
    padding: 0.75rem 1.75rem !important;
    font-size: 0.95rem !important;
  }

  /* Hide side images on mobile, show only center */
  .hero div[style*="grid-template-columns"] > div:first-child,
  .hero div[style*="grid-template-columns"] > div:last-child {
    display: none;
  }

  .hero div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    max-width: 320px !important;
  }
}

/* Loading Spinner */
.loading {
  text-align: center;
  padding: 3rem;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--primary-green);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Accessibility */
button:focus,
.option:focus,
input:focus,
textarea:focus {
  outline: 2px solid var(--primary-green);
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .btn, .admin-nav, .logo {
    display: none;
  }
}
