/* MCQ CONVERTER */

*,
*::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;
  --gold: #e8c89a;
}

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;
}

/* Privacy Modal */
.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 */
header {
  background: linear-gradient(135deg, var(--ink) 0%, #2a2a2a 100%);
  color: var(--paper);
  padding: 1.2rem 3rem 1rem;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(232, 200, 154, 0.2);
}

header::before {
  content: "KolektifAssist";
  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.06);
  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: 3rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
  position: relative;
  display: inline-block;
}

header h1 span {
  color: var(--gold);
  position: relative;
}

header h1 span::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
  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: var(--gold);
}

.hero-tagline {
  display: flex;
  gap: 2rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--gold);
  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: var(--gold);
  opacity: 0.6;
}

/* Guide card */
.hero-content {
  position: relative;
  z-index: 1;
}

.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;
}

.guide-card a:hover {
  background: rgba(232, 200, 154, 0.2);
  transform: translateY(-2px);
}

.guide-card .icon {
  font-size: 1.2rem;
}

/* Main layout */
.main-content {
  filter: blur(4px);
  pointer-events: none;
  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;
}

/* Converter section — acts as the container */
.converter-section {
  max-width: 860px;
  width: 95%;
  margin: 0 auto;
  padding: 2rem 2rem 8rem;
  flex: 1 0 auto;
}

/* Step cards */
.intro-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.step-card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(200, 191, 168, 0.3);
  border-radius: 16px;
  padding: 1.2rem 1rem;
  text-align: center;
  transition: transform 0.2s;
}

.step-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.8);
}

.step-card .step-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 0.4rem;
}

.step-card .step-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* Drop area */
.drop-area {
  border: 2px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(135deg, var(--cream) 0%, var(--paper) 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;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.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: 2.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

.drop-area:hover {
  box-shadow: 0 8px 16px -2px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.drop-area p {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0.2rem 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.drop-area .muted {
  opacity: 0.7;
  font-size: 0.78rem;
}

.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.78rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all 0.3s;
  margin: 0.75rem 0 0.5rem;
  border: none;
  font-family: "Source Sans Pro", sans-serif;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.file-label:hover {
  transform: scale(1.02);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
}

.file-name {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--blue);
  font-weight: 600;
}

.file-name.has-file {
  background: var(--green-bg);
  padding: 0.3rem 1rem;
  border-radius: 20px;
  display: inline-block;
}

.file-label,
.file-name {
  margin-top: 6px;
}

/* Results table */
#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-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: 25%;
  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 {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  border: none;
  padding: 0.6rem 1.8rem;
  border-radius: 40px;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: "Source Sans Pro", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.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.15);
}

.export-btn:hover::before {
  left: 100%;
}

/* Action buttons */
.action-buttons {
  text-align: center;
  margin-top: 2rem;
}

/* Export tips */
.export-tips {
  margin-top: 12px;
  font-size: 1rem;
  color: var(--muted);
  background: var(--yellow-bg);
  padding: 0.75rem 1.2rem;
  border-left: 3px solid #e6a817;
  text-align: left;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

/* Utility */
.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;
}

/* Footer */
footer {
  background: linear-gradient(135deg, var(--ink) 0%, #2a2a2a 100%);
  color: var(--paper);
  padding: 1rem 3rem 1rem;

  width: 100%;
  margin-top: auto;
  position: relative;
  overflow: hidden;
  border-top: 1px solid rgba(232, 200, 154, 0.2);
}

footer::after {
  content: "MCQ";
  position: absolute;
  left: 2rem;
  bottom: 0.5rem;
  font-family: "Merriweather", serif;
  font-size: 4rem;
  font-weight: 600;
  color: rgba(232, 200, 154, 0.04);
  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: var(--gold);
}

/* 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;
  border: 1px solid rgba(232, 200, 154, 0.15);
}

.home-btn::before {
  content: "←";
  color: var(--gold);
  font-size: 0.8rem;
}

.home-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

/* Refresh Button */
.refresh-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;
}

.refresh-btn::before {
  content: "⟳";
  color: var(--gold);
  font-size: 0.9rem;
}

.refresh-btn:hover {
  transform: rotate(180deg) scale(1.1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}

@media (max-width: 768px) {
  header {
    padding: 1rem 1.5rem;
  }

  header h1 {
    font-size: 1.8rem;
  }

  header::before {
    font-size: 4rem;
  }

  .hero-tagline {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .intro-steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .converter-section {
    padding: 1.5rem 1rem 6rem;
  }

  #previewContainer {
    font-size: 0.75rem;
  }

  #previewTable th,
  #previewTable td {
    padding: 0.75rem;
  }
}
