/* =====================================
            Basic reset & base
===================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f9f9f9;
  color: #1a1a1a;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.main-content {
  flex: 1;
  max-width: 1100px;
  margin: 18px auto;
  padding: 0 16px 40px;
  width: 100%;
}

h2 {
  text-align: center;
}

/* ======================================
                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;
}

/* ======================================
            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;
}

/* =====================================
                Card
===================================== */
.card {
  background: white;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(15, 29, 55, 0.06);
}

/* =====================================
            Drag & drop
===================================== */
.drag-drop-area {
  border: 3px solid transparent;
  padding: 22px 18px;
  border-radius: 12px;
  background: linear-gradient(white, white) padding-box,
    linear-gradient(135deg, #1a3e5c, #42a5f5) border-box;
  cursor: pointer;
  max-width: 650px;
  margin: 0 auto;
  text-align: center;
  transition: 0.25s;
}

.drag-drop-area:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(25, 118, 210, 0.07);
}

.drag-drop-area.drag-over {
  background: linear-gradient(#eaf6ff, #eaf6ff) padding-box,
    linear-gradient(135deg, #1a3e5c, #42a5f5) border-box;
}

.drag-drop-area.disabled {
  opacity: 0.6;
  pointer-events: none;
  background: linear-gradient(#f7f7f7, #f7f7f7) padding-box,
    linear-gradient(135deg, #ccc, #ddd) border-box;
}

.drop-icon {
  font-size: 2.6rem;
  margin-bottom: 10px;
  opacity: 0.85;
}

/* =====================================
        File Input Container
===================================== */
.file-input-container {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#file-input {
  display: none;
}

.file-name {
  font-style: italic;
}

/* =====================================
            Select File Button
===================================== */
.browse-btn {
  display: inline-block;
  padding: 8px 18px;
  background: #1976d2;
  color: #fff;
  border-radius: 22px;
  font-weight: 400;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.3s ease;
}

.browse-btn:hover {
  background: #1565c0;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(25, 118, 210, 0.4);
  text-decoration: none;
}

/* =====================================
        Selectors / Filters
===================================== */
.selectors {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.filter-selectors {
  justify-content: center;
}

.modal-selectors {
  justify-content: flex-start;
  gap: 10px;
}

.filter-button-container {
  display: flex;
  align-items: end;
  gap: 8px;
}

.modal-filter-button {
  display: flex;
  align-items: end;
}

.modal-filter-button .btn {
  margin-left: 8px;
}

label {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 150px;
  font-weight: 600;
  color: #2d3748;
}

/* =====================================
            Dropdown Styles
===================================== */
select {
  margin-top: 8px;
  padding: 8px 10px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  font-size: 0.9rem;
  position: relative;
}

select:hover {
  border-color: #1976d2;
  background-color: #f8fbff;
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.15);
  transform: translateY(-1px);
}

select:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
  background-color: #ffffff;
}

/* =====================================
                Buttons
===================================== */
button {
  cursor: pointer;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
  border: 2px solid #e2e8f0;
  background: white;
  transition: all 0.3s ease;
  font-family: inherit;
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: #cbd5e0;
}

button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

button.primary {
  background: linear-gradient(135deg, #1976d2, #42a5f5);
  color: white;
  border: none;
}

button.primary:hover {
  background: linear-gradient(135deg, #1565c0, #1e88e5);
  box-shadow: 0 4px 15px rgba(25, 118, 210, 0.4);
  transform: translateY(-2px);
}

button.primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

.btn {
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  color: white;
  transition: all 0.3s ease;
  font-family: inherit;
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background: #1976d2;
}

.btn-primary:hover {
  background: #1565c0;
  box-shadow: 0 4px 15px rgba(25, 118, 210, 0.4);
}

.btn-secondary {
  background: #6c757d;
}

.btn-secondary:hover {
  background: #5a6268;
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

/* Special button styles */
.aiken-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: #ffecec;
  color: #c53030;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.aiken-remove:hover {
  background: #feb2b2;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(197, 48, 48, 0.3);
}

/* =====================================
            Main Panels
===================================== */
.main-panels-container {
  display: flex;
  gap: 20px;
  align-items: stretch;
}

.card.wide {
  max-width: 100%;
}

.questions-panel {
  flex: 3;
  min-width: 0;
}

.no-questions {
  text-align: center;
  padding: 16px;
}

.stats-panel {
  flex: 1;
  min-width: 260px;
}

.info-line {
  text-align: center;
  margin-bottom: 12px;
  font-size: 2rem;
  font-style: bold;
  font-weight: 600;
  color: #2c5c8a;
}

.questions-container {
  max-height: 65vh;
  overflow: auto;
  padding-right: 12px;
}

.stats-breakdown {
  margin-top: 10px;
  font-size: 0.95rem;
}

/* =====================================
        Questions Header
===================================== */
.questions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.info-line {
  flex: 1;
  text-align: left;
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #2c5c8a;
}

.bulk-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.bulk-btn {
  background-color: #0078d4; /* primary blue */
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bulk-btn:hover {
  background-color: #005fa3;
  transform: translateY(-1px);
}

.bulk-btn.outline {
  background-color: white;
  color: #0078d4;
  border: 1px solid #0078d4;
}

.bulk-btn.outline:hover {
  background-color: #e6f2fb;
}

/* =====================================
            Action Buttons
===================================== */
.action-buttons {
  margin-top: 12px;
}

.full-width {
  width: 100%;
  margin-bottom: 8px;
}

.selection-note {
  margin-top: 18px;
}

.selection-note p {
  font-size: 0.9rem;
}

/* =====================================
            Question List
===================================== */
.question-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.question-item {
  background: #f8fafc;
  border-radius: 10px;
  padding: 12px;
  border: 2px solid #e2e8f0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.03);
}

.question-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.question-stem {
  font-weight: 700;
  color: #10243b;
  margin-bottom: 8px;
}

.question-meta {
  font-size: 0.85rem;
  color: #718096;
  margin-bottom: 10px;
}

.question-options {
  margin-left: 18px;
}

.option-line {
  margin: 8px 0;
  padding: 8px 12px;
  background: white;
  border-radius: 8px;
  border: 1px solid #eef3f7;
}

.question-answer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e0;
  font-weight: 700;
  color: #1a3e5c;
}

/* =====================================
                Stats
===================================== */
#stats-breakdown h4 {
  color: #1a3e5c;
  margin: 8px 0 6px;
}

#stats-breakdown p {
  margin: 6px 0;
  color: #2d3748;
}

/* =====================================
        Total Selected Styling
===================================== */
.total-selected-container {
  background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
  border: 2px solid #e1f5fe;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
  text-align: center;
}

.total-label .info-loaded {
  display: block;
  font-size: 0.9rem;
  color: #546e7a;
  font-weight: 600;
  margin-bottom: 4px;
}

.total-count {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: #1976d2;
}

/* =====================================
            Preview Modal
===================================== */
.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;
}

.modal {
  background: white;
  border-radius: 12px;
  overflow: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.preview-modal {
  max-width: 1100px;
  width: 95%;
  max-height: 90vh;
  overflow: auto;
}

.confirm-modal {
  max-width: 500px;
}

.modal-header {
  background: linear-gradient(135deg, #1a3e5c, #2c5c8a);
  color: white;
  padding: 12px;
  border-radius: 12px 12px 0 0;
}

.modal-body {
  padding: 18px;
}

.modal-footer {
  padding: 12px;
  border-top: 1px solid #eef3f7;
}

.preview-modal-footer,
.confirm-modal-footer {
  padding: 16px;
  border-top: 1px solid #eef3f7;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.modal-list {
  margin-top: 18px;
  max-height: 60vh;
  overflow: auto;
  border-radius: 8px;
  padding-right: 8px;
}

/* ======================================
            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;
}

/* =====================================
        Aiken item in Preview Modal
===================================== */
.aiken-item {
  position: relative;
  padding: 14px 52px 14px 14px;
  border-bottom: 1px solid #f0f4f8;
  background: #fbfcff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  overflow: hidden;
}

.aiken-item pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  margin: 0;
  font-family: inherit;
  line-height: 1.4;
}

.aiken-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: #ffecec;
  color: #c53030;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.aiken-remove:hover {
  background: #feb2b2;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(197, 48, 48, 0.3);
}

/* =====================================
        Confirm Delete Modal
===================================== */
#confirm-modal {
  z-index: 12000;
}

/* =====================================
            Toast notifications
======================================== */
.toast {
  position: fixed;
  top: 12px;
  right: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  z-index: 14000;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: #fff;
  background: #1a3e5c;
}

.toast.info {
  background: #2196f3;
}

.toast.success {
  background: #4caf50;
}

.toast.warning {
  background: #ff9800;
  color: #000;
}

.toast.error {
  background: #f44336;
}

/* =====================================
            Utility Classes
===================================== */
.hidden {
  display: none !important;
}

.muted {
  opacity: 0.7;
}

/* =====================================
            Scrollbar Styles
===================================== */
html {
  scroll-behavior: smooth;
}

.filter-card-highlight {
  animation: highlight-pulse 2s ease-in-out;
}

@keyframes highlight-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(25, 118, 210, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(25, 118, 210, 0);
  }
  100% {
    box-shadow: 0 8px 24px rgba(15, 29, 55, 0.06);
  }
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 15000;
  color: white;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #1976d2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* =====================================
        Floating Action Button
===================================== */
.floating-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1976d2, #42a5f5);
  color: white;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(25, 118, 210, 0.4);
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-btn:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 30px rgba(25, 118, 210, 0.6);
  background: linear-gradient(135deg, #1565c0, #1e88e5);
}

.floating-btn:active {
  transform: scale(0.95) rotate(90deg);
}

/* Responsive adjustment */
@media (max-width: 600px) {
  .floating-btn {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* =====================================
            Responsive
===================================== */
@media (max-width: 900px) {
  .main-panels-container {
    flex-direction: column;
  }

  .modal {
    width: 96%;
    max-height: 85vh;
  }

  .selectors {
    justify-content: center;
  }

  .modal-selectors {
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .hero-section {
    padding: 20px;
  }

  .hero-content h1 {
    font-size: 1.5rem;
  }

  .drag-drop-area {
    padding: 18px 12px;
  }

  .selectors {
    flex-direction: column;
    align-items: center;
  }

  label {
    min-width: 200px;
  }
}
