/* --------------------- 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;
  font-style: bold;
  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 h1 {
  font-size: 2.2rem;
  color: #1a3e5c;
  margin-bottom: 20px;
  font-weight: 700;
}

/* --------------------- 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);
}

/* --------------------- Drop Area --------------------- */
.drop-area {
  border: 3px solid transparent;
  padding: 20px 30px;
  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-area.disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: linear-gradient(white, white) padding-box,
    linear-gradient(135deg, #ccc, #ddd) border-box;
}

.drop-area.disabled:hover {
  transform: none;
  cursor: not-allowed;
}

.drop-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  opacity: 0.7;
}

.drop-area p {
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: #666;
}

.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 {
  background: #ccc;
  cursor: not-allowed;
}

.file-label.disabled:hover {
  background: #ccc;
  transform: none;
  cursor: not-allowed;
}

.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);
}

/* --------------------- 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;
}

/* --------------------- 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%;
}

#message.success {
  color: #28a745;
  font-weight: 600;
}

#message.error {
  color: #dc3545;
  font-weight: 600;
}

#message.warning {
  color: #856404;
  font-weight: 600;
}

/* --------------------- Table styles --------------------- */
#previewTitle {
  color: #1a3e5c;
  margin: 40px 0 20px 0;
  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 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;
}

#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;
}

/* --------------------- 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;
  }
}
