/* Enhanced Styles for Quiz Page */

.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.subject-card, .test-card {
  background-color: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  cursor: pointer;
}

.test-card.available {
  background-color: #ffffff;
  border-color: #3b82f6;
}

.test-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
}

.test-day {
  margin: 0;
  color: #1f2937;
  font-size: 16px;
  font-weight: 600;
}

.test-status {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.test-status.completed {
  background-color: #dcfce7;
  color: #16a34a;
}

.test-status.available {
  background-color: #dbeafe;
  color: #3b82f6;
}

.test-status.locked {
  background-color: #f1f5f9;
  color: #6b7280;
}

.test-card-body {
  margin-bottom: 12px;
}

.test-name {
  margin: 0 0 8px 0;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
}

.test-meta {
  display: flex;
  gap: 12px;
  font-size: 14px;
  color: #6b7280;
}

.test-card-footer {
  text-align: center;
}

.subject-card:hover, .test-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.test-card.completed {
    background-color: #f0fdf4;
    border-color: #16a34a;
}

.test-card.locked {
    background-color: #f8fafc;
    border-color: #e5e7eb;
    opacity: 0.7;
    cursor: not-allowed;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #09f;
    animation: spin 1s ease infinite;
}

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

/* Quiz page card visual polish */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.subject-card {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(17,24,39,0.06);
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
  overflow: hidden;
}
.subject-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}
.subject-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(17,24,39,0.1);
}
.subject-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.subject-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  box-shadow: 0 6px 16px rgba(99,102,241,0.25);
}
.subject-name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}
.subject-meta {
  font-size: .9rem;
  color: var(--text-muted);
}
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.topic-card {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(17,24,39,0.06);
  transition: transform .2s ease;
  position: relative;
}
.topic-card:hover { transform: translateY(-4px); }
.tests-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(5, 1fr);
}
@media (max-width: 600px) {
  .tests-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 601px) and (max-width: 992px) {
  .tests-grid { grid-template-columns: repeat(3, 1fr); }
}
.test-card {
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(17,24,39,0.06);
  transition: transform .25s ease, box-shadow .25s ease;
}
.test-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(17,24,39,0.1);
}
.test-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.test-day {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-color);
}
.test-status {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: .8rem;
  font-weight: 700;
  border: 1px solid var(--card-border);
}
.test-status.available { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.test-status.completed { background: #dcfce7; color: #16a34a; border-color: #bbf7d0; }
.test-status.locked { background: #f1f5f9; color: #6b7280; border-color: #e5e7eb; }
.test-card-body { margin-bottom: 12px; }
.test-name {
  margin: 0 0 8px 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-color);
}
.test-meta {
  display: flex;
  gap: 12px;
  font-size: .9rem;
  color: var(--text-muted);
}
.test-card-footer {
  text-align: center;
  margin-top: 12px;
}
.test-card-footer .btn { width: 100%; }
.notice { word-break: break-word; overflow-wrap: anywhere; padding: 8px 12px; border-radius: 8px; }
@media (max-width: 768px) {
  .notice { font-size: 14px; }
  .data-table { display: block; overflow-x: auto; }
}
/* --- MOBILE RESPONSIVE FIXES --- */
@media screen and (max-width: 768px) {
    /* Main Container को स्क्रीन में फिट करें */
    .quiz-container, .container, .main-content {
        width: 95% !important;
        max-width: 100% !important;
        margin: 10px auto !important;
        padding: 15px !important;
        overflow-x: hidden; /* हॉरिजॉन्टल स्क्रॉल रोकें */
    }

    /* सवाल का टेक्स्ट साइज़ मोबाइल के लिए */
    .question-text, h2, h3 {
        font-size: 1.2rem !important;
        line-height: 1.5;
    }

    /* ऑप्शन्स (Buttons/Radio) को एक के नीचे एक दिखाएं */
    .options-list, .answers-grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .option-card, .btn {
        width: 100% !important;
        margin-bottom: 10px;
        padding: 12px !important;
        font-size: 1rem !important;
    }

    /* इमेज अगर कोई हो तो उसे स्क्रीन से बाहर न जाने दें */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* --- DARK MODE FIXES --- */
/* अगर body पर 'dark-mode' क्लास है, तो अंदर के एलिमेंट्स का रंग बदलें */
body.dark-mode .quiz-container,
body.dark-mode .card,
body.dark-mode .question-box {
    background-color: #1e1e1e !important; /* गहरा बैकग्राउंड */
    color: #ffffff !important; /* सफ़ेद टेक्स्ट */
    border-color: #333 !important;
    box-shadow: none !important;
}

body.dark-mode .question-text,
body.dark-mode h2, 
body.dark-mode h3, 
body.dark-mode p {
    color: #e0e0e0 !important;
}

body.dark-mode .option-card, 
body.dark-mode .btn-outline-primary {
    background-color: #2d2d2d !important;
    color: #fff !important;
    border: 1px solid #444 !important;
}

body.dark-mode .option-card:hover,
body.dark-mode .option-card.selected {
    background-color: #3d3d3d !important;
    border-color: #0d6efd !important;
}
