/* MCQ CONVERTER */

@import url("https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@300;400;600&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Merriweather:wght@300;600&display=swap");

*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --ink: #1a1a1a;
  --paper: #f5f0e8;
  --cream: #ede7d4;
  --accent: #c0392b;
  --green: #2c7a4b;
  --blue: #1a5276;
  --muted: #7a7165;
  --border: #c8bfa8;
  --green-bg: #eaf5ee;
  --yellow-bg: #fef9e7;
  --red-bg: #fdecea;
  --card-bg: #ffffff;
}

body {
  font-family: "Source Sans Pro", sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

html,
body {
  margin: 0;
  padding: 0;
}

/* Privacy Modal Styles */
.privacy-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(3px);
}

.privacy-banner {
  background: #fffbe6;
  border: 3px solid #e6a817;
  border-radius: 12px;
  padding: 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.75;
  color: #5a4a1a;
  max-width: 550px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  position: relative;
}

.privacy-banner .pb-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
  text-align: center;
}

.privacy-banner .pb-body {
  flex: 1;
}

.privacy-banner .pb-title {
  font-weight: 600;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #3d2e00;
  margin-bottom: 0.75rem;
  text-align: center;
}

.privacy-banner .pb-content {
  font-size: 0.9rem;
  text-align: left;
}

.privacy-banner a {
  color: #3d2e00;
  text-underline-offset: 2px;
}

.privacy-banner .pb-dismiss {
  background: #e6a817;
  border: none;
  color: #fff;
  font-family: "Source Sans Pro", sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.9rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.1em;
  transition: background 0.15s;
  width: 100%;
  text-transform: uppercase;
  margin-top: 0.5rem;
}

.privacy-banner .pb-dismiss:hover {
  background: #c98c0a;
}

/* Decorative Background */
.bg-decoration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.bg-circle {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(200, 191, 168, 0.1) 0%,
    rgba(200, 191, 168, 0.05) 100%
  );
  top: -150px;
  right: -150px;
}

.bg-circle-2 {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(44, 122, 75, 0.03) 0%,
    rgba(44, 122, 75, 0.01) 100%
  );
  bottom: -200px;
  left: -200px;
}

/* Header Styles */
header {
  background: linear-gradient(135deg, var(--ink) 0%, #2a2a2a 100%);
  color: var(--paper);
  padding: 1rem 3rem 1rem;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(232, 200, 154, 0.2);
}

header::before {
  content: "AssistLearnWorlds";
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: "Merriweather", serif;
  font-size: 9rem;
  font-weight: 600;
  color: rgba(232, 200, 154, 0.08);
  pointer-events: none;
  line-height: 1;
  white-space: nowrap;
}

header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e8c89a, transparent);
}

header h1 {
  font-family: "Merriweather", serif;
  font-weight: 300;
  font-size: 3.5rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  position: relative;
  display: inline-block;
}

header h1 span {
  font-style: normal;
  color: #e8c89a;
  position: relative;
}

header h1 span::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 0;
  right: 0;
  height: 2px;
  background: #e8c89a;
  opacity: 0.3;
}

header p {
  color: #999;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  position: relative;
  padding-left: 1.5rem;
}

header p::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #e8c89a;
}

.hero-tagline {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: #e8c89a;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-top: 1px solid rgba(232, 200, 154, 0.2);
  padding-top: 1rem;
}

.hero-tagline span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-tagline span::before {
  content: "▶";
  font-size: 0.6rem;
  color: #e8c89a;
  opacity: 0.6;
}

/* Main Layout */
.main-content {
  user-select: none;
  transition: filter 0.3s ease;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

.main-content.content-enabled {
  filter: blur(0);
  pointer-events: auto;
  user-select: auto;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--ink) 0%, #2a2a2a 100%);
  color: var(--paper);
  padding: 1rem 3rem 1rem;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(232, 200, 154, 0.2);
  margin-bottom: 0;
}

header::before {
  content: "AssistLearnWorlds";
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: "Merriweather", serif;
  font-size: 9rem;
  font-weight: 600;
  color: rgba(232, 200, 154, 0.08);
  pointer-events: none;
  line-height: 1;
  white-space: nowrap;
}

.hero-section::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e8c89a, transparent);
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-section h1 {
  font-family: "Merriweather", serif;
  font-weight: 300;
  font-size: 3.5rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  position: relative;
  display: inline-block;
}

.hero-section h1 span {
  font-style: normal;
  color: #e8c89a;
  position: relative;
}

.hero-section h1 span::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 0;
  right: 0;
  height: 2px;
  background: #e8c89a;
  opacity: 0.3;
}

.guide-card {
  text-align: center;
}

.guide-card a {
  display: inline-flex;
  align-items: center;
  margin-top: 2rem;
  gap: 0.8rem;
  background: rgba(233, 232, 232, 0.946);
  border: 1px solid rgba(232, 200, 154, 0.3);
  padding: 0.8rem 1.5rem;
  border-radius: 40px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1rem;
  transition: all 0.3s;
  backdrop-filter: blur(5px);
}

.guide-card a:hover {
  background: rgba(232, 200, 154, 0.2);
  transform: translateY(-2px);
}

.guide-card .icon {
  font-size: 1.2rem;
}

/* Offline Warning */
.offline-warning {
  background: var(--yellow-bg);
  border: 2px solid #e6a817;
  border-radius: 16px;
  padding: 1.2rem 2rem;
  margin-bottom: 2rem;
  position: relative;
}

.offline-warning p {
  color: #5a4a1a;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Converter Section */
.converter-section {
  width: 90%;
  align-self: center;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Intro Steps */
.intro-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.step-card {
  background: var(--cream);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.step-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.step-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

/* Drop Area - Matching upload card from first project */
.drop-area {
  border: 2px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(135deg, var(--cream) 0%, #f5f0e8 100%);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  margin-bottom: 2rem;
}

.drop-area.highlight {
  border-color: var(--green);
  background: var(--green-bg);
  transform: scale(1.02);
}

.drop-area.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.drop-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  display: block;
  filter: drop-shadow(0 4px 2px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s;
}

.drop-area:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.drop-area:hover .drop-icon {
  transform: scale(1.1) rotate(5deg);
}

.drop-area p {
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.drop-area .muted {
  font-size: 0.8rem;
  color: var(--border);
}

.drop-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.file-label {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1.8rem;
  border-radius: 40px;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.3s;
  margin: 1rem 0 0.5rem;
  border: none;
  font-family: "Source Sans Pro", sans-serif;
}

.file-label:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

.file-name {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--green);
  font-weight: 500;
}

.file-name.has-file {
  background: var(--green-bg);
  padding: 0.3rem 1rem;
  border-radius: 20px;
  display: inline-block;
}

/* Results Table - Matching first project's question cards */
#resultsContainer {
  margin: 2rem 0;
}

#previewTitle {
  font-family: "Merriweather", serif;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--accent);
}

#previewContainer {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--border);
}

#previewTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

#previewTable th {
  background: var(--ink);
  color: var(--paper);
  padding: 1rem;
  font-weight: 500;
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#previewTable td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

#previewTable tr:hover {
  background: var(--cream);
}

#previewTable .correct {
  color: var(--green);
  font-weight: 500;
}

#previewTable .flag-absent {
  color: var(--accent);
}

#previewTable .flag-present {
  color: var(--green);
}

.validation-issue {
  color: var(--accent);
  font-size: 0.8rem;
  margin-bottom: 0.3rem;
}

/* Group Input */
#groupContainer {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--cream);
  border-radius: 16px;
  border-left: 4px solid var(--green);
}

#groupContainer label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.tooltip {
  position: relative;
  display: inline-block;
  margin-left: 0.5rem;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: var(--muted);
  color: var(--paper);
  border-radius: 50%;
  font-size: 0.6rem;
  font-style: normal;
  cursor: help;
}

.tooltiptext {
  visibility: hidden;
  width: 250px;
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  padding: 0.8rem;
  border-radius: 8px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -125px;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.8rem;
  font-weight: normal;
  pointer-events: none;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

#groupInput {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--paper);
  font-family: "Source Sans Pro", sans-serif;
  font-size: 0.9rem;
  transition: all 0.3s;
}

#groupInput:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

#groupWarning {
  color: var(--accent);
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

/* Message */
#message {
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

.success-message {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green);
}

.error-message {
  background: var(--red-bg);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.warning-message {
  background: var(--yellow-bg);
  color: #5a4a1a;
  border: 1px solid #e6a817;
}

/* Export Button */
.export-btn {
  background: linear-gradient(135deg, var(--green) 0%, #1e5a38 100%);
  color: var(--paper);
  border: none;
  padding: 1.2rem 2.5rem;
  font-family: "Source Sans Pro", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 40px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  display: block;
}

.export-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.export-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.export-btn:hover::before {
  left: 100%;
}

/* Security Section */
.security-section {
  margin-top: 2rem;
}

.warning-box {
  background: var(--red-bg);
  border: 2px solid var(--accent);
  border-radius: 16px;
  padding: 1.5rem;
  opacity: 0.9;
}

.warning-content p {
  color: var(--accent);
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 0;
}

/* Action Buttons */
.action-buttons {
  text-align: center;
  margin-top: 2rem;
}

/* Floating Buttons */
.floating-btn {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--ink) 0%, #333 100%);
  color: var(--paper);
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-btn:hover {
  transform: rotate(180deg) scale(1.1);
  background: var(--accent);
}

.floating-mn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: linear-gradient(135deg, var(--ink) 0%, #333 100%);
  color: var(--paper);
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 40px;
  font-family: "Source Sans Pro", sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s;
  opacity: 0.9;
}

.floating-mn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  opacity: 1;
  background: var(--green);
}

/* Footer */
footer {
  background: linear-gradient(135deg, var(--ink) 0%, #2a2a2a 100%);
  color: var(--paper);
  padding: 2.5rem 3rem 2rem;
  width: 100%;
  margin-top: auto;
  position: relative;
  overflow: hidden;
  border-top: 1px solid rgba(232, 200, 154, 0.2);
}

footer::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
  background: var(--paper);
  clip-path: polygon(0 0, 100% 0, 50% 100%, 0 100%);
}

footer::after {
  content: "MCQ";
  position: absolute;
  left: 2rem;
  bottom: 1rem;
  font-family: "Merriweather", serif;
  font-size: 4rem;
  font-weight: 600;
  color: rgba(232, 200, 154, 0.03);
  pointer-events: none;
  line-height: 1;
}

footer p {
  color: #999;
  font-size: 0.8rem;
  text-align: center;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

footer p:first-child {
  margin-bottom: 0.5rem;
  color: #e8c89a;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

.fade-out {
  opacity: 0;
  transition: opacity 0.6s;
}

/* Toast Container */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

/* ─────────────────────────────────────────
   FLOATING HOME BUTTON
───────────────────────────────────────── */
.home-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
  background: linear-gradient(135deg, var(--ink) 0%, #2d2d2d 100%);
  color: var(--paper);
  text-decoration: none;
  font-family: "Source Sans Pro", sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.75rem 1.2rem;
  border-radius: 40px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    background 0.2s;
  border: 1px solid rgba(232, 200, 154, 0.15);
}
.home-btn::before {
  content: "←";
  color: #e8c89a;
  font-size: 0.8rem;
}
.home-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
}
.home-btn:active {
  transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-section {
    padding: 1.5rem;
  }

  .hero-section::before {
    font-size: 3rem;
  }

  .hero-section h1 {
    font-size: 1.8rem;
    max-width: 100%;
  }

  .intro-steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .converter-section {
    padding: 1.5rem;
  }

  .floating-btn {
    bottom: 1rem;
    left: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .floating-mn {
    bottom: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.6rem;
  }

  #previewContainer {
    font-size: 0.75rem;
  }

  #previewTable th,
  #previewTable td {
    padding: 0.75rem;
  }
}
