/* --------------------- Reset & Base --------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f9f9f9;
  color: #1a1a1a;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------- Hidden utility --------------------- */
.hidden {
  display: none !important;
}

.fade-out {
  opacity: 0;
  transition: opacity 0.6s ease;
}

/* --------------------- Header --------------------- */
.main-header {
  background: linear-gradient(135deg, #1a3e5c 0%, #2c5c8a 100%);
  color: white;
  padding: 10px 20px;
  text-align: center;
}

.header-content h1 {
  font-size: 1rem;
  font-weight: 300;
  margin-bottom: 10px;
}

.header-subtitle {
  font-size: 0.8rem;
  opacity: 0.9;
  max-width: 800px;
  margin: 0 auto;
}

/* --------------------- Main Content --------------------- */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px;
}

/* --------------------- Hero Section --------------------- */
.hero-section {
  background: linear-gradient(135deg, #eef3f9 0%, #ffffff 100%);
  border-radius: 15px;
  padding: 10px 20px;
  text-align: center;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.hero-content h2 {
  font-size: 2.2rem;
  color: #1a3e5c;
  margin-bottom: 20px;
  font-weight: 600;
}

.hero-content p {
  font-size: 1rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto 30px;
}

/* --------------------- Converter Section --------------------- */
.converter-section {
  background: white;
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

/* --------------------- 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;
}

/* --------------------- Drop Area --------------------- */
.drop-area {
  border: 3px solid transparent;
  padding: 20px 30px; /* Reduced from 40px to 20px vertically */
  border-radius: 15px;
  background: linear-gradient(white, white) padding-box,
    linear-gradient(135deg, #1a3e5c, #42a5f5) border-box;
  cursor: pointer;
  margin: 0 auto 20px auto;
  transition: all 0.3s ease;
  max-width: 600px;
  text-align: center;
  position: relative;
}

.drop-area.highlight {
  background-color: #eaf6ff;
  border-color: #1976d2;
  box-shadow: 0 10px 30px rgba(25, 118, 210, 0.1);
}

.drop-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  opacity: 0.7;
}

.drop-area p {
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: #666;
}

.drop-area.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  border-color: #ccc;
  background-color: #f5f5f5;
}

.drop-area.disabled:hover {
  transform: none;
  border-color: #ccc;
  background-color: #f5f5f5;
}

.file-label {
  display: inline-block;
  padding: 12px 30px;
  background: #1976d2;
  color: white;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.file-label:hover {
  background: #115293;
  transform: translateY(-2px);
}

.file-label.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #ccc;
}

.file-label.disabled:hover {
  background-color: #ccc;
  transform: none;
}

.file-name {
  display: block;
  margin-top: 10px;
  color: #666;
  font-style: italic;
}

#fileInput {
  display: none;
}

/* --------------------- Action Buttons --------------------- */
.action-buttons {
  text-align: center;
  margin-top: 30px;
  width: 100%;
}

/* --------------------- Download Button --------------------- */
#downloadBtn {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  border: none;
  padding: 15px 40px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
  display: inline-block;
  margin: 0 auto;
}

#downloadBtn:hover {
  background: linear-gradient(135deg, #218838, #1e9e8a);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

#downloadBtn:active {
  transform: translateY(-1px);
}

/* Ensure it's visible when not hidden */
#downloadBtn:not(.hidden) {
  display: inline-block;
}

/* --------------------- Security Section --------------------- */
.security-section {
  background: #f8f9fa;
  border-radius: 15px;
  padding: 10px;
  text-align: center;
}

.warning-box {
  background: #fff3cd;
  border: 1px solid #ffeeba;
  border-radius: 10px;
  padding: 25px;
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 15px;
  text-align: left;
}

.warning-icon {
  font-size: 2rem;
  margin-top: 2px;
}

.warning-content strong {
  color: #856404;
  display: block;
  margin-bottom: 8px;
}

.warning-content p {
  color: #856404;
  margin: 0;
}

/* --------------------- Info icon (tooltip trigger) --------------------- */
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #007bff;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 6px;
  line-height: 1;
  transition: background-color 0.18s ease;
}

.info-icon:hover {
  background-color: #0056b3;
}

/* --------------------- Floating 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;
}

.floating-btn:hover {
  transform: rotate(20deg) scale(1.1);
  box-shadow: 0 8px 25px rgba(25, 118, 210, 0.4);
}

/* --------------------- Message --------------------- */
#message {
  font-weight: 500;
  margin-top: 10px;
  padding: 8px 0;
  min-height: 20px;
  text-align: center;
  width: 100%;
}

/* --------------------- Group Container --------------------- */
#groupContainer {
  text-align: center;
  margin: 30px auto;
  max-width: 600px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
}

#groupContainer label {
  display: block;
  margin-bottom: 15px;
  font-weight: 600;
  color: #1a3e5c;
  font-size: 1.1rem;
  text-align: center;
}

#groupContainer:not(.hidden) {
  opacity: 1;
  transform: translateY(0);
}

#groupInput {
  display: block;
  margin: 0 auto 15px auto;
  padding: 12px 20px;
  border: 2px solid #e2e6ea;
  border-radius: 8px;
  font-size: 1rem;
  width: 100%;
  max-width: 400px;
  transition: border-color 0.3s ease;
}

#groupInput:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

#groupWarning {
  text-align: center;
  margin: 10px 0;
}

/* --------------------- Footer --------------------- */
footer {
  background: linear-gradient(135deg, #1a3e5c 0%, #2c5c8a 100%);
  color: white;
  text-align: center;
  padding: 30px 20px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-main {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 1rem;
}

.footer-sub {
  opacity: 0.8;
  font-size: 0.9rem;
}

/* --------------------- Responsive Design --------------------- */
@media (max-width: 768px) {
  .main-header {
    padding: 30px 15px;
  }

  .header-content h1 {
    font-size: 2rem;
  }

  .hero-section {
    padding: 20px 20px;
  }

  .converter-section {
    padding: 20px 20px;
  }

  .drop-area {
    padding: 20px 20px;
  }

  .floating-btn {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }
}

/* --------------------- Table styles --------------------- */
#previewTitle {
  color: #1a3e5c;
  margin: 40px 0 20px 0; /* 40px top, 20px bottom */
  font-size: 1.8rem;
  font-weight: 600;
  text-align: center;
  width: 100%;
}

#previewTable {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
  font-family: "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: #1a1a1a;
}
#previewTable th,
#previewTable td {
  border: 1px solid #d0d7dd;
  padding: 8px 10px;
  vertical-align: top;
}
#previewTable th {
  background-color: #1976d2;
  color: #fff;
  font-weight: 600;
}
#previewTable tr:nth-child(even) {
  background-color: #f7fbff;
}
#previewTable td pre {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.4;
  padding: 4px 6px;
  background-color: #f4f7fa;
  border-radius: 4px;
  font-family: "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
}
#previewTable td pre span.correct {
  color: #155724;
  font-weight: 600;
}

#previewTable th:nth-child(3),
#previewTable td:nth-child(3) {
  width: 25%;
}
#previewTable th:nth-child(4),
#previewTable td:nth-child(4) {
  width: 5%;
  text-align: center;
}

#previewTable th:nth-child(5),
#previewTable td:nth-child(5) {
  width: 15%;
  text-align: center;
}

#previewTable th:nth-child(6),
#previewTable td:nth-child(6) {
  width: 25%;
  text-align: center;
}

/* Tooltip styles */
.tooltip {
  position: relative;
  display: inline-block;
}
.tooltip .tooltiptext {
  visibility: hidden;
  width: 260px;
  background-color: #333;
  color: #fff;
  text-align: left;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  font-size: 0.85em;
  line-height: 1.3em;
}
.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* ===== 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;
}

/* 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;
}

/* 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 for Format Guide */
@media (max-width: 768px) {
  .guide-section {
    padding: 25px 20px;
  }

  .format-rules,
  .notes {
    padding: 20px;
  }

  .example {
    padding: 20px;
    font-size: 13px;
  }

  #homeBtn.floating-btn {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }
}

