/*
 * CIMA Practice Questions - Stylesheet
 * ====================================
 * 
 * This stylesheet contains all the styles for the CIMA practice questions page.
 * Organized into logical sections for better maintainability.
 * 
 * Table of Contents:
 * 1. Base Styles & Variables
 * 2. Navigation Styles
 * 3. Messages & Alerts
 * 4. Main Content Layout
 * 5. Filter Components
 * 6. Button Styles
 * 7. Question Sections
 * 8. Case Questions
 * 9. Footer Styles
 * 10. Responsive Design
 */

/* ========================================
   1. BASE STYLES & VARIABLES
   ======================================== */

body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #2d7cb7 0%, #1e5a8a 100%);
  min-height: 100vh;
  line-height: 1.6;
}

h1 {
  text-align: center;
  color: #ffffff;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

h2 {
  color: #ffffff;
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ========================================
   2. NAVIGATION STYLES
   ======================================== */

.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.nav-brand {
  flex: 0 0 auto;
}

.nav-brand h2 {
  margin: 0;
  color: #333;
  font-weight: 700;
  font-size: 1.5rem;
}

.nav-brand i {
  color: #2d7cb7;
  margin-right: 0.5rem;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

/* User Information Styles */
.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.welcome-text {
  color: #333;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.premium-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* Authentication Links */
.auth-links {
  display: flex;
  gap: 1rem;
}

.nav-link {
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.login-btn {
  color: #2d7cb7;
  border: 2px solid #2d7cb7;
}

.login-btn:hover {
  background: #1e40af;
  color: white;
}

.signup-btn {
  background: linear-gradient(135deg, #1e40af, #7c3aed);
  color: white;
  border: 2px solid transparent;
}

.signup-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(30, 64, 175, 0.3);
}

/* Logout Form Styles */
.logout-form {
  display: inline;
}

.logout-btn {
  background: none;
  border: 2px solid #ef4444;
  cursor: pointer;
  color: #ef4444;
  font: inherit;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logout-btn:hover {
  background: #ef4444;
  color: white;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
  margin-bottom: 2rem;
}

.back-link {
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
  font-weight: 500;
}

.back-link:hover {
  color: #ffd700;
}

/* ========================================
   3. MESSAGES & ALERTS
   ======================================== */

.messages-container {
  max-width: 1200px;
  margin: 1rem auto;
  padding: 0 2rem;
}

.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 500;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid #10b981;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid #ef4444;
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border-left: 4px solid #3b82f6;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.close-btn:hover {
  opacity: 1;
}

/* Error Messages */
.error-message {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.2);
  border: 2px solid #ef4444;
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 4px 6px rgba(239, 68, 68, 0.1);
}

/* ========================================
   4. MAIN CONTENT LAYOUT
   ======================================== */

.main-content {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.section-description {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  line-height: 1.6;
  text-align: center;
}

/* ========================================
   5. FILTER COMPONENTS
   ======================================== */

.filters,
.case-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-group {
  display: flex;
  flex-direction: column;
  min-width: 150px;
}

.filters label,
.case-filters label {
  color: white;
  font-weight: 500;
  margin-bottom: 0.5rem;
  display: block;
}

.filters select,
.case-filters select {
  padding: 0.5rem;
  border: none;
  border-radius: 5px;
  background: white;
  color: #333;
  font-size: 0.9rem;
  min-width: 150px;
  transition: box-shadow 0.3s ease;
}

.filters select:focus,
.case-filters select:focus {
  outline: none;
  box-shadow: 0 0 0 2px #ffd700;
}

/* Number Selection Buttons */
.number-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.question-limit {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  background: linear-gradient(135deg, #005555, #007777);
  color: white;
  border: none;
  border-radius: 5px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.question-limit:hover {
  background: linear-gradient(135deg, #007777, #009999);
  transform: translateY(-2px);
}

.question-limit.active {
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #333;
}

/* Timer Option */
.timer-option {
  display: flex;
  align-items: center;
  margin-top: 1rem;
}

.timer-option label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #ffffff;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 0;
}

.timer-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #ffd700;
}

/* ========================================
   6. BUTTON STYLES
   ======================================== */

.quiz-actions {
  margin: 2rem 0;
  text-align: center;
}

#start-quiz-btn,
.btn-primary {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

#start-quiz-btn:hover,
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

#start-quiz-btn:disabled,
.btn-primary:disabled {
  background: #6c757d;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ========================================
   7. QUESTION SECTIONS
   ======================================== */

.objective-questions-section {
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 1rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  backdrop-filter: blur(10px);
}

.objective-questions-section h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}

/* ========================================
   8. CASE QUESTIONS
   ======================================== */

.case-question-section {
  margin-top: 3rem;
  padding: 3rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.case-question-section h2 {
  text-align: center;
  margin-bottom: 1rem;
}

/* Case Questions Grid */
#case-questions-list.row {
  margin: 2rem -15px 0;
  padding: 0;
}

#case-questions-list.row > .col-12,
#case-questions-list.row > .col-lg-10,
#case-questions-list.row > .col-xl-8 {
  padding: 0 15px;
  margin-bottom: 2rem;
}

/* Case Question Cards */
.case-question-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  border: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  overflow: hidden;
  height: 100%;
}

.case-question-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 1);
}

.case-question-card .card-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.case-question-card .card-title {
  color: #1e40af;
  margin-bottom: 1rem;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.3;
}

.case-question-card .card-text {
  color: #4b5563;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
  flex-grow: 1;
}

.case-question-card .case-meta {
  margin-bottom: 1.5rem;
}

.case-question-card .case-meta .badge {
  font-size: 0.85rem;
  padding: 0.5rem 0.8rem;
  border-radius: 20px;
  font-weight: 500;
}

.case-question-card .file-tag {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  margin: 0.5rem 1rem;
}

.case-question-card .file-tag:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.case-question-card .card-footer {
  background: rgba(248, 250, 252, 0.8);
  border-top: 1px solid rgba(226, 232, 240, 0.5);
  padding: 1.5rem 2rem;
}

.case-question-card .open-case-btn,
.start-case-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  color: white;
  cursor: pointer;
  width: 100%;
}

.case-question-card .open-case-btn:hover,
.start-case-btn:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* Case Question Meta Information */
.case-question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.8rem;
}

.case-question-level {
  background: #3b82f6;
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.case-question-difficulty {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: bold;
}

.case-question-difficulty.easy {
  background: #10b981;
  color: white;
}

.case-question-difficulty.medium {
  background: #f59e0b;
  color: white;
}

.case-question-difficulty.hard {
  background: #ef4444;
  color: white;
}

/* ========================================
   9. FOOTER STYLES
   ======================================== */

.footer {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  margin-top: 4rem;
  padding: 3rem 0 1rem;
  border-top: 1px solid rgba(45, 124, 183, 0.1);
}

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

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: #2d7cb7;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.footer-section p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul li a {
  color: #666;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: #2d7cb7;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(45, 124, 183, 0.1);
  color: #666;
  font-size: 0.9rem;
}

/* ========================================
   10. RESPONSIVE DESIGN
   ======================================== */

/* Tablet Styles */
@media (max-width: 768px) {
  .main-content {
    padding: 0 1rem;
  }
  
  .messages-container {
    padding: 0 1rem;
  }
  
  .case-question-section {
    padding: 2rem 1.5rem;
    margin-top: 2rem;
  }
  
  .case-question-card .card-body {
    padding: 1.5rem;
  }
  
  .case-question-card .card-footer {
    padding: 1rem 1.5rem;
  }
  
  #case-questions-list.row > .col-12,
  #case-questions-list.row > .col-lg-10,
  #case-questions-list.row > .col-xl-8 {
    padding: 0 10px;
  }
  
  .case-question-card .file-tag {
    margin: 0.5rem 0.5rem;
    display: inline-block;
  }
  
  .case-question-card .case-files {
    padding: 0 0.5rem;
  }
  
  .footer {
    padding: 2rem 0 1rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }
  
  .footer-container {
    padding: 0 1rem;
  }
}

/* Mobile Styles */
@media (max-width: 600px) {
  h1 {
    font-size: 2rem;
  }
  
  .nav-container {
    padding: 0 1rem;
    flex-wrap: wrap;
  }
  
  .nav-brand {
    order: 1;
  }
  
  .nav-brand h2 {
    font-size: 1.2rem;
  }
  
  .nav-menu {
    order: 2;
  }
  
  .user-info {
    flex-direction: column;
    gap: 0.5rem;
    text-align: right;
  }
  
  .auth-links {
    gap: 0.5rem;
  }
  
  .nav-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }
  
  .filters,
  .case-filters {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .number-buttons {
    flex-wrap: wrap;
  }
  
  #start-quiz-btn {
    width: 100%;
  }
  
  .case-question-section {
    padding: 1rem;
    margin-top: 2rem;
  }
  
  .objective-questions-section {
    padding: 1rem;
  }
}

/* Large Desktop Styles */
@media (min-width: 1200px) {
  .case-question-section {
    padding: 4rem;
  }
  
  #case-questions-list.row {
    margin: 3rem -20px 0;
  }
  
  #case-questions-list.row > .col-12,
  #case-questions-list.row > .col-lg-10,
  #case-questions-list.row > .col-xl-8 {
    padding: 0 20px;
    margin-bottom: 3rem;
  }
}