/* ======================================
   Reset & Base Styles
====================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  background: #f9f9f9;
  color: #1a1a1a;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ======================================
   Utility Classes
====================================== */
.hidden {
  display: none !important;
}

.muted {
  color: #666;
  opacity: 0.8;
}

/* ======================================
   Header
====================================== */
.main-header {
  background: linear-gradient(135deg, #1a3e5c 0%, #2c5c8a 100%);
  color: white;
  padding: 20px;
  text-align: center;
}

.header-content h1 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.header-subtitle {
  font-size: 0.9rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* ======================================
   Main Content
====================================== */
.main-content {
  flex: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
}

/* ======================================
   Hero Section
====================================== */
.hero-section {
  background: linear-gradient(135deg, #eef3f9 0%, #ffffff 100%);
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.hero-content h1 {
  font-size: 2rem;
  color: #1a3e5c;
  margin-bottom: 10px;
  font-weight: 700;
}

.hero-content p {
  color: #666;
  font-size: 1.1rem;
}

/* ======================================
   Cards & Sections
====================================== */
.card {
  background: white;
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.card.wide {
  max-width: 100%;
}

.card h2 {
  font-size: 1.3rem;
  color: #1a3e5c;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 600;
}

/* --------------------- Guide Card --------------------- */
.guide-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: white;
  padding: 10px 20px;
  border-radius: 25px;
  margin-top: 10px;
  margin-bottom: 20px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.guide-card:hover {
  background: #eef3fb;
  transform: translateY(-2px);
  border-color: #d0d8e3;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.guide-card a {
  text-decoration: none;
  color: #1a3e5c;
  font-weight: 600;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* ======================================
   Upload Area & Drag & Drop
====================================== */
.upload-area {
  text-align: center;
}

.drag-drop-area {
  border: 3px solid transparent;
  padding: 40px 30px;
  border-radius: 15px;
  background: linear-gradient(white, white) padding-box,
    linear-gradient(135deg, #1a3e5c, #42a5f5) border-box;
  cursor: pointer;
  margin: 0 auto;
  transition: all 0.3s ease;
  max-width: 500px;
  text-align: center;
}

.drag-drop-area:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(25, 118, 210, 0.1);
}

.drag-drop-area.drag-over {
  background: linear-gradient(#eaf6ff, #eaf6ff) padding-box,
    linear-gradient(135deg, #1a3e5c, #42a5f5) border-box;
}

.drag-drop-area i {
  font-size: 3rem;
  color: #1a3e5c;
  margin-bottom: 20px;
  opacity: 0.7;
}

.drag-drop-area p {
  margin: 10px 0;
  color: #666;
  font-size: 1.1rem;
}

.drop-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  opacity: 0.7;
}

#file-input {
  display: none;
}

.file-name {
  display: block;
  margin-top: 10px;
  color: #666;
  font-style: italic;
  font-size: 0.9rem;
}

.file-name.has-file {
  display: block;
  margin-top: 10px;
  color: #666;
  font-style: italic;
  font-size: 0.9rem;
}

.browse-btn {
  display: inline-block;
  padding: 12px 30px;
  background: #1976d2;
  color: white;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  margin-top: 15px;
}

.browse-btn:hover {
  background: #115293;
  transform: translateY(-2px);
}

.upload-area.disabled {
  opacity: 0.6;
  pointer-events: none;
}

.upload-area.disabled .drag-drop-area {
  background: linear-gradient(#f7f7f7, #f7f7f7) padding-box,
    linear-gradient(135deg, #ccc, #ddd) border-box;
  cursor: not-allowed;
}

.upload-area.disabled .drag-drop-area:hover {
  transform: none;
}

/* ======================================
   Question Display
====================================== */
.question-display {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 25px;
  margin: 20px 0;
  text-align: left;
}

.question-stem {
  font-weight: 600;
  margin-bottom: 20px;
  color: #1a202c;
  line-height: 1.5;
  font-size: 1.1rem;
}

.question-options {
  margin: 20px 0;
}

.option-line {
  margin: 12px 0;
  padding: 8px 12px;
  background: white;
  border-radius: 8px;
}

.question-answer {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px dashed #cbd5e0;
  font-weight: 600;
  color: #1a3e5c;
  font-size: 1.1rem;
}

/* ======================================
   Selectors & Dropdowns
====================================== */
.selectors {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 25px 0;
  justify-content: center;
}

label {
  font-size: 0.95rem;
  color: #2d3748;
  display: flex;
  flex-direction: column;
  font-weight: 600;
  text-align: center;
  min-width: 180px;
}

select {
  margin-top: 8px;
  padding: 10px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  background: white;
  transition: border-color 0.3s ease;
}

select:focus {
  border-color: #1976d2;
  outline: none;
}

.selectors select:required {
  border-color: #d21944;
}

.selectors select:valid {
  border-color: #28a745;
}

/* ======================================
   Buttons & Actions
====================================== */
button {
  cursor: pointer;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.3s ease;
  text-align: center;
}

button:hover {
  background: #f7fafc;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

button:active {
  transform: translateY(0);
}

button.primary {
  background: linear-gradient(135deg, #1976d2, #42a5f5);
  color: white;
  border: none;
}

button.primary:hover {
  background: linear-gradient(135deg, #115293, #1976d2);
  box-shadow: 0 6px 20px rgba(25, 118, 210, 0.3);
}

button.danger {
  background: linear-gradient(135deg, #dc3545, #e74c3c);
  color: white;
  border: none;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 25px;
  justify-content: center;
}

/* ======================================
   Approved Questions List
====================================== */
.bank-list {
  margin-top: 20px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  background: white;
  overflow-y: auto;
  max-height: 400px;
  text-align: left;
}

.bank-item {
  padding: 15px 20px;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s ease;
}

.bank-item:hover {
  background: #f8fafc;
}

.bank-item:last-child {
  border-bottom: none;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.remove-btn {
  background: #fed7d7;
  color: #c53030;
  border: none;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.remove-btn:hover {
  background: #feb2b2;
  transform: scale(1.1);
}

.question-preview {
  margin: 8px 0;
  line-height: 1.4;
  color: #2d3748;
}

.question-details {
  margin-top: 8px;
}

.question-details small {
  color: #718096;
  font-size: 0.85rem;
}

/* ======================================
   Progress & Status
====================================== */
#review-progress {
  font-weight: 600;
  color: #1a3e5c;
  margin: 15px 0;
  text-align: center;
  font-size: 1rem;
}

/* =========================
    Toast Notification
===========================*/
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  pointer-events: none;
}

.toast {
  background: #1a3e5c;
  color: white;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  margin-bottom: 10px;
  max-width: 300px;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: auto;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.success {
  background: #28a745;
  color: white;
}

.toast.error {
  background: #dc3545;
  color: white;
}

.toast.warning {
  background: #ffc107;
  color: #000;
}

.toast.info {
  background: #17a2b8;
  color: white;
}

/* ======================================
            Modal Overlay
  =======================================*/
#modal-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  pointer-events: none;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: all;
}

.modal-overlay.show {
  opacity: 1;
}

.modal {
  background: white;
  border-radius: 12px;
  padding: 0;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.show .modal {
  transform: scale(1);
}

.modal-header {
  background: linear-gradient(135deg, #1a3e5c, #2c5c8a);
  color: white;
  padding: 20px;
  border-radius: 12px 12px 0 0;
}

.modal-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.modal-body {
  padding: 25px;
  line-height: 1.5;
}

.modal-message {
  margin-bottom: 20px;
  color: #2d3748;
}

.modal-list {
  list-style: none;
  padding: 0;
  margin: 15px 0;
}

.modal-list li {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.modal-list li:last-child {
  border-bottom: none;
}

.modal-list strong {
  color: #1a3e5c;
}

.modal-input-group {
  margin-top: 20px;
}

.modal-input-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2d3748;
}

.modal-footer {
  padding: 20px 25px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.modal-input {
  width: 100%;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  margin-top: 10px;
}

.modal-input:focus {
  border-color: #1976d2;
  outline: none;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #1976d2;
  color: white;
}

.btn-primary:hover {
  background: #115293;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #545b62;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover {
  background: #c82333;
}

/* ======================================
   Floating Refresh Button
====================================== */
.floating-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  background: linear-gradient(135deg, #1976d2, #42a5f5);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(25, 118, 210, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-weight: bold;
}

.floating-btn:hover {
  background: linear-gradient(135deg, #dc3545, #e74c3c);
  transform: scale(1.1);
  box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
}

.floating-btn.hidden {
  display: none;
}

/* Tooltip warning */
.floating-btn::before {
  content: "⚠️ All progress will be lost!";
  position: absolute;
  bottom: 70px;
  right: 0;
  background: #dc3545;
  color: white;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.floating-btn::after {
  content: "";
  position: absolute;
  bottom: 60px;
  right: 25px;
  border: 6px solid transparent;
  border-top-color: #dc3545;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.floating-btn:hover::before,
.floating-btn:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* ======================================
   Security Section
====================================== */
.security-section {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 20px;
  text-align: center;
  margin-top: 20px;
}

.warning-box {
  background: #fff3cd;
  border: 1px solid #ffeeba;
  border-radius: 10px;
  padding: 20px;
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  text-align: left;
}

.warning-icon {
  font-size: 1.5rem;
  margin-top: 2px;
}

.warning-content strong {
  color: #856404;
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
}

.warning-content p {
  color: #856404;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ======================================
   Footer
====================================== */
footer {
  background: linear-gradient(135deg, #1a3e5c 0%, #2c5c8a 100%);
  color: white;
  text-align: center;
  padding: 25px 20px;
  margin-top: auto;
}

.footer-content {
  max-width: 1000px;
  margin: 0 auto;
}

.footer-main {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 1rem;
}

.footer-sub {
  opacity: 0.8;
  font-size: 0.9rem;
}

/* ======================================
   Enhanced Styles
====================================== */

/* Enhanced Button States */
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

button:disabled:hover {
  background: white;
  box-shadow: none;
}

/* Improved Select States */
select:invalid {
  border-color: #dc3545;
}

select:valid {
  border-color: #28a745;
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in {
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Question Display Content */
.question-display-content {
  animation: fadeIn 0.3s ease;
}

/* Example Container */
.example-container {
  margin-bottom: 30px;
}

.example-container h3 {
  color: #1a3e5c;
  margin-bottom: 15px;
  font-size: 1.3rem;
  text-align: center;
}

.example {
  background: #1a3e5c;
  color: #e0f7ff;
  padding: 25px;
  border-radius: 10px;
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-x: auto;
  border: 1px solid #2c5c8a;
  margin: 0 auto;
  max-width: 800px;
}

/* Notes Section */
.notes {
  background: #fff3cd;
  border: 1px solid #ffeeba;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 30px;
}

.notes h3 {
  color: #856404;
  margin-bottom: 10px;
  font-size: 1.3rem;
}

.note-item {
  padding: 4px 0;
  border-bottom: 1px solid #ffeeba;
}

.note-item:last-child {
  border-bottom: none;
}

.note-item strong {
  color: #856404;
}

/* ===== FORMAT GUIDE SPECIFIC STYLES ===== */

/* Guide Section */
.guide-section {
  background: white;
  border-radius: 15px;
  padding: 40px;
  margin-bottom: 40px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  text-align: left;
}

.guide-intro {
  text-align: center;
  margin-bottom: 30px;
  font-size: 1.1rem;
  color: #666;
}

.guide-intro code {
  background: #f0f4f8;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  color: #1a3e5c;
}

/* Format Rules */
.format-rules {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 10px;
  margin-bottom: 30px;
  border-left: 4px solid #1a3e5c;
  border-right: 4px solid #1a3e5c;
}

.format-rules h3 {
  color: #1a3e5c;
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.format-rules ul {
  list-style: none;
  padding: 0;
}

.format-rules li {
  padding: 8px 0;
  padding-left: 25px;
  position: relative;
  line-height: 1;
}

.format-rules li:before {
  content: "•";
  color: #1976d2;
  font-weight: bold;
  position: absolute;
  left: 0;
}

.format-rules em {
  color: #666;
  font-style: italic;
}

/* --------------------- Action Buttons --------------------- */
.action-buttons {
  text-align: center;
  margin-top: 30px;
  width: 100%;
}

/* Back Button */
.back-btn {
  display: inline-block;
  padding: 12px 30px;
  background: linear-gradient(135deg, #6c757d, #868e96);
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(108, 117, 125, 0.3);
}

.back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(108, 117, 125, 0.4);
  color: white;
  text-decoration: none;
}

/* ======================================
   Responsive Design
====================================== */
@media (max-width: 768px) {
  .main-header {
    padding: 20px 15px;
  }

  .header-content h1 {
    font-size: 1.5rem;
  }

  .hero-section {
    padding: 20px;
  }

  .card {
    padding: 20px;
  }

  .drag-drop-area {
    padding: 30px 20px;
  }

  .selectors {
    gap: 15px;
  }

  label {
    min-width: 100%;
  }

  .action-row {
    gap: 8px;
  }

  .action-row button {
    flex: 1;
    min-width: 120px;
  }

  .floating-btn {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .modal {
    width: 95%;
    margin: 20px;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
  }

  #toast-container {
    left: 10px;
    right: 10px;
    top: 10px;
  }

  .toast {
    max-width: none;
    width: 100%;
  }
}
