/* ========== 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: 15px;
  right: 20px;
  z-index: 999;
  background: #2ecc71;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
#toggleStyleBtn:hover {
  background: #27ae60;
}

/* 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;
}
nav div {
  cursor: pointer;
  padding-bottom: 6px;
}
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: #0b1d3a;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05) 0px,
    rgba(255, 255, 255, 0.05) 10px,
    transparent 10px,
    transparent 20px
  );
  color: #e0e6ed;
}
body.dark-mode header {
  background: #1e3a8a;
  color: #fff;
}
body.dark-mode header p {
  color: #2ecc71;
}
body.dark-mode nav {
  border-color: #2ecc71;
  color: #e0e6ed;
}
body.dark-mode nav .active {
  color: #f39c12;
}
body.dark-mode .upload-section,
body.dark-mode textarea,
body.dark-mode .output {
  background: #112647;
  border-color: #2ecc71;
  color: #fff;
}
body.dark-mode select {
  background: #0b1d3a;
  color: #e0e6ed;
  border-color: #2ecc71;
}
body.dark-mode footer {
  background: #1e3a8a;
  color: #e0e6ed;
}

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

body.light-mode {
  background-color: #f3f4f6;
  color: #1a1f24;
}
body.light-mode header {
  background: #ffffff;
  color: #1e3a8a;
}
body.light-mode header p {
  color: #27ae60;
}
body.light-mode nav {
  border-color: #c7d3df;
  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;
}
