/* ========== GLOBAL LAYOUT, THEME, HEADER, NAV ========== */

body {
  font-family: Arial, sans-serif;
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

/* Theme toggle button */
#toggleStyleBtn {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 999;

  width: 36px;
  height: 36px;
  padding: 0;

  border-radius: 50%;
  border: none;
  cursor: pointer;

  background: none;
  color: #fff;

  /* hide existing text like "Toggle Style" */
  font-size: 0;
  line-height: 0;
  overflow: hidden;
  white-space: nowrap;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: background 0.2s ease, transform 0.15s ease;
}

#toggleStyleBtn:hover {
  background: none;
  transform: scale(1.05);
}

/* Icon (shows CURRENT mode) */
#toggleStyleBtn::before {
  font-size: 18px;
  line-height: 1;
  content: "🌙"; /* default = light mode */
}

/* When dark mode is active, show moon */
body.dark-mode #toggleStyleBtn::before {
  content: "☀️";
}

/* Header */
header {
  padding: 20px;
  text-align: center;
  border-bottom: 4px solid #f39c12;
  position: relative;
}
header img {
  position: absolute;
  left: 20px;
  top: 20px;
  height: 45px;
}
header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: bold;
}
header p {
  margin: 5px 0 0;
  font-size: 14px;
}

/* Navigation */

nav {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 15px 0;
  border-bottom: 1px solid;
  font-size: 16px;
  font-weight: bold;
  flex-wrap: wrap;     /* ✅ prevents overflow */
  row-gap: 10px;       /* ✅ spacing between wrapped rows */
}

nav div {
  cursor: pointer;
  padding-bottom: 6px;
  white-space: nowrap; /* ✅ keeps items from breaking into 2 lines */
}

nav .active {
  border-bottom: 3px solid #f39c12;
}

/* Pages */
.page {
  display: none;
  padding: 30px;
  max-width: 1100px;
  margin: auto;
}
.page.active {
  display: block;
}

/* Landing page */
.landing h2,
#home h2 {
  font-size: 26px;
  margin-bottom: 10px;
}
.landing p,
#home p {
  font-size: 17px;
  line-height: 1.6;
  max-width: 800px;
}

/* Generic textareas and outputs */
textarea,
.output {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  border-radius: 4px;
  overflow-y: auto;
  white-space: pre-wrap;
  display: block;
  border: 1px solid;
}

/* Buttons */
.buttons {
  margin: 10px 0;
}
button {
  background: #2ecc71;
  color: #fff;
  border: none;
  padding: 8px 12px;
  margin-right: 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
button:hover {
  background: #27ae60;
}

/* Selects */
select {
  border-radius: 4px;
  padding: 8px;
  min-width: 220px;
  border: 1px solid;
}

/* Upload sections (common pattern) */
.upload-row {
  display: flex;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.upload-section {
  flex: 1;
  border-radius: 6px;
  padding: 14px;
  border: 1px solid;
  min-width: 260px;
}
.upload-title {
  font-weight: bold;
  margin-bottom: 6px;
}
.upload-desc {
  font-size: 13px;
  margin-bottom: 10px;
}
.upload-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

/* Footer */
footer {
  text-align: center;
  padding: 15px;
  font-size: 13px;
  border-top: 4px solid #f39c12;
  margin-top: auto;
}

/* ========== THEME: DARK MODE ========== */

body.dark-mode {
  background-color: #101a27; /* uniform blue-gray */
  background-image: none;    /* remove diagonal lines */
  color: #e0e6ed;
  background: linear-gradient(180deg, #101a27 0%, #0d1622 100%);
}

body.dark-mode header {
  background: #223247; /* blueish gray */
  color: #fff;
}
body.dark-mode header p {
  color: #2ecc71; /* keep original */
}
body.dark-mode nav {
  border-color: #2ecc71; /* keep original */
  color: #e0e6ed;
}
body.dark-mode nav .active {
  color: #f39c12; /* original orange */
}
body.dark-mode .upload-section,
body.dark-mode textarea,
body.dark-mode .output {
  background: #18263a; /* blueish gray */
  border-color: #2ecc71; /* keep original */
  color: #fff;
}
body.dark-mode select {
  background: #101a27; /* blueish gray */
  color: #e0e6ed;
  border-color: #2ecc71; /* keep original */
}
body.dark-mode footer {
  background: #223247; /* blueish gray */
  color: #e0e6ed;
}

/* ========== THEME: LIGHT MODE ========== */

body.light-mode {
  background-color: #eef2f6; /* blueish gray tint */
  color: #1a1f24;
}
body.light-mode header {
  background: #ffffff;
  color: #1e3a8a; /* original */
}
body.light-mode header p {
  color: #27ae60; /* original */
}
body.light-mode nav {
  border-color: #c7d3df; /* original */
  color: #1a1f24;
}
body.light-mode nav .active {
  color: #1e3a8a;
  border-bottom-color: #1e3a8a;
}
body.light-mode .upload-section,
body.light-mode textarea,
body.light-mode .output {
  background: #ffffff;
  border-color: #c7d3df;
  color: #111;
}
body.light-mode select {
  background: #ffffff;
  color: #1a1f24;
  border-color: #c7d3df;
}
body.light-mode footer {
  background: #ffffff;
  color: #1e3a8a;
}

/*                   */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* Fix Chrome collapsing the landing page */
.tools-landing {
  display: block;
  position: relative;
  z-index: 1;
  padding-bottom: 40px; /* ensures real height */
}

/* Ensure the grid sits above any collapsed parent */
.tool-grid {
  position: relative;
  z-index: 2;
}

/* ---Landing page spacing--- */
.tools-landing h2 {
  margin-top: 0;
}

.tools-landing {
  margin-top: 20px;
}

/* ============================
   LANDING PAGE POLISH
   ============================ */

.tools-landing {
  text-align: center;
  margin-top: 20px;
}

.tools-landing h2 {
  font-size: 32px;
  margin-bottom: 10px;
  font-weight: 700;
}

.tools-landing p {
  font-size: 18px;
  opacity: 0.85;
  margin-bottom: 40px;
}

/* Tool Grid */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px;
  padding: 10px;
}

/* Tool Cards */
.tool-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 25px;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
  backdrop-filter: blur(4px);
}

.tool-card h3 {
  margin-top: 0;
  font-size: 22px;
  margin-bottom: 10px;
}

.tool-card p {
  font-size: 15px;
  opacity: 0.85;
}

/* Hover effect */
.tool-card:hover {
  transform: translateY(-6px);
  border-color: #f39c12; /* restore orange accent */
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

/* Dark Mode */
body.dark-mode .tool-card {
  background: rgba(24, 38, 58, 0.6); /* blueish gray */
  color: #e0e6ed;
}

body.dark-mode .tool-card:hover {
  background: rgba(24, 38, 58, 0.9); /* blueish gray */
}

/* Light Mode */
body.light-mode .tool-card {
  background: #ffffff;
  border-color: #c7d3df;
  color: #1a1f24;
}

body.light-mode .tool-card:hover {
  background: #f9fafb;
  border-color: #1e3a8a;
}

/* Subtle animation on load */
.tool-card {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUp 0.5s ease forwards;
}

.tool-card:nth-child(2) { animation-delay: 0.1s; }
.tool-card:nth-child(3) { animation-delay: 0.2s; }

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================
   Shared Button Variants
   (suite-wide standardization)
   ========================= */

/* Base button */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

/* Green primary — use for Parse / Build / Convert actions */
.btn-green {
  background: #2ecc71;
  color: #fff;
}
.btn-green:hover { background: #27ae60; }

/* Outline green — use for Clear / Clear All */
.btn-outline-green {
  background: transparent;
  color: #2ecc71;
  border: 1px solid #2ecc71;
}
.btn-outline-green:hover {
  background: rgba(46, 204, 113, 0.12);
}

/* Blue — use for Copy */
.btn-blue {
  background: #1e3a8a;
  color: #fff;
}
.btn-blue:hover { background: #15316c; }

/* Gray — use for Download */
.btn-gray {
  background: #6b7280;      /* neutral slate gray */
  color: #fff;
}
.btn-gray:hover { background: #4b5563; }

/* Disabled (optional) */
.btn:disabled,
.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Group spacing utility */
.btn-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Light mode subtle tweak for outline contrast */
body.light-mode .btn-outline-green {
  color: #27ae60;
  border-color: #27ae60;
}

/* =========================
   MOBILE RESPONSIVENESS FIXES
   ========================= */
@media (max-width: 480px) {
  header h1 { font-size: 22px; }
  header img { height: 36px; }
  nav { gap: 16px; font-size: 14px; }
  .page { padding: 16px; }
}

@media (max-width: 640px) {
  .tool-grid {
    grid-template-columns: 1fr; /* Force single column on small screens */
  }
}

@media (max-width: 980px) {
  .tool-grid {
    grid-template-columns: 1fr; /* ✅ prevents horizontal scroll */
  }
}

