:root {
  --primary: #024ea0;
  --accent: #ff6600;
  --bg: #fffdf5;
  --card: #ffffff;
  --text: #222222;
  --shadow: rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  scrollbar-gutter: stable;
  width: 100%;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* NAVIGATION BAR */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px; 
  background-color: var(--primary);
  z-index: 1000;
  padding: 0 20px;
  display: flex;
  line-height: 42px;
  align-items: center;
}

.navbar ul {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  justify-content: space-around; 
  align-items: center;
  list-style: none;
  width: 100%;
  box-sizing: border-box;
}

.navbar a {
  color: white;
  text-decoration: none;
  font-weight: 750;
  font-size: medium;
  display: block;
  padding: 10px 16px;
  transition: background-color 0.2s, color 0.2s;
}

.navbar ul li ul.dropdown li a:hover {
  color: var(--accent);
  background-color: rgba(255, 102, 0, 0.1);
}

.navbar ul li {
  position: relative;
}

.navbar ul li ul.dropdown li a:hover {
  background-color: rgba(255, 102, 0, 0.1);
  color: var(--accent);
}

.navbar ul li ul.dropdown {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  background-color: white;
  box-shadow: 0 3px 8px var(--shadow);
  min-width: 180px;
  padding: 0;
  gap: 0;
  z-index: 1000;
  transition: opacity 0.3s ease;
  display: block;  
  list-style: none;
  margin: 0;
}

.navbar ul li ul.dropdown li {
  width: 100%;
  list-style: none;
}

.navbar ul li ul.dropdown li a {
  color: var(--text);
  padding: 10px 10px !important;
  display: block;
  font-weight: 600;
  width: 100%;
  transition: background-color 0.2s ease;
  line-height: 1.7;
  white-space: normal;
}

.navbar ul li:hover > ul.dropdown,
.navbar ul li ul.dropdown:hover {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.navbar > nav > ul > li:hover > a {
  color: var(--accent);
  background-color: rgba(255, 102, 0, 0.08);
  border-bottom: 3px solid #cc5200;
  padding-bottom: 5px;
}

.navbar > nav > ul {
  display: flex;
  justify-content: space-around; 
  align-items: center;
  gap: 20px;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 10px;
  list-style: none;
  box-sizing: border-box;
}

.navbar > nav > ul > li {
  height: 100%;
  display: flex;
  align-items: center;
}

.navbar ul li::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 20px; 
}

.navbar > nav {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* HERO SECTION */
.hero {
  text-align: center;
  padding: 40px 20px 0;
}

.logo {
  display: block;
  max-width: 350px;
  width: 100%;
  height: auto;
  margin: 0 auto;
  margin-bottom: 50px;
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.logo-container a {
  display: contents;
  pointer-events: none;
}

.logo-container a img {
  pointer-events: auto;
}

header {
  text-align: center;
  padding: 40px 20px 20px;
  background-color: white;
  box-shadow: 0 1px 4px var(--shadow);
}

h1 {
  color: var(--primary);
  font-size: 2.5rem;
  margin: 0;
  text-align: center;
}

main {
  width: 90%;
  max-width: none;
  margin: 30px auto;
  padding: 0 20px;
  flex: 1 0 auto;
  padding-top: 60px;  
  padding-bottom: 60px; 
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
/* 
html {
  background:
    linear-gradient(to bottom,
      var(--primary) 0 60px,
      var(--bg) 60px calc(100% - 60px),
      var(--primary) calc(100% - 60px) 100%);
} */

.card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 50px;
}

/* WHY SECTION */
.why {
  padding: 10px 50px;
  text-align: center;
  max-width: 50%;
  margin: auto;
}

.why h2 {
  color: var(--primary);
  font-size: 33px;
  margin-bottom: 10px;
}

.why p {
  font-size: 17px;
}

/* FOOTER */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px; 
  background-color: var(--primary);
  z-index: 1000;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto;
  color: white;
  flex-wrap: wrap;
  width: 100%;
  padding: 0 20px;
}

.footer-left {
  flex: 1;
}

.footer-right {
  display: flex;
  gap: 20px;
}

.footer-right a {
  color: white;
  text-decoration: none;
  font-weight: 500;
}

/* */

.site-header {
  background-color: white;
  position: relative;
  padding: 50px 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  text-align: center;
}

form {
  max-width: 400px;
  margin: 30px auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: stretch;
}

label {
  font-weight: bold;
}

input {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
}

button {
  padding: 10px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
}

button:hover {
  background-color: #ff6600;
}

.button-row {
  display: flex;       
  gap: 10px;          
}

.button-row button {
  flex: 1;             
  min-width: 0;     
  font-size: 15px;    
}

.result-box {
  margin-top: 20px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: bold;
  margin: 0;
  padding: 0;
}

#result {
    white-space: pre-line;
    margin-bottom: 20px;
    text-align: center;
}

.tooltip-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.tooltip-icon {
  margin-left: 6px;
  cursor: help;
  position: relative;
  color: var(--primary);
  font-size: 20px;
}

.tooltip-icon:hover {
  color: var(--accent);
}

.tooltip-text {
  visibility: hidden;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.5px;
  font-family: sans-serif;
  width: 260px;
  background-color: #474747;
  color: #fff;
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  font-size: 0.85rem;
}

.tooltip-icon:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}


/* Tolerance Table */

#tableCapture {
  margin: 0 auto;
  width: 100%;
  padding: 0;
  max-width: 750px;
  margin-top: 10px;
  margin-bottom: 30px;
  display: inline-block;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 3px 8px var(--shadow);
  overflow-x: auto;
  position: relative;
}

.tolerance-note {
  font-size: 0.85rem;
  color: #333;
  margin-top: 12px;
  text-align: left;
  max-width: 100%;
  line-height: 1.4;
}

#resultSection {
  max-width: 600px;
  margin: 20px auto; 
  padding: 0 20px;
  text-align: center;
}

#resultsTable {
  width: 100%; 
  max-width: 700px;
  margin: 0 auto; 
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 1rem;
  text-align: center;
  margin: 0;
  border: 1px solid #000000;
  border-radius: 12px;
  overflow: hidden;
  background-color: white;
}

#resultsTable th,
#resultsTable td {
  padding: 10px 5px;
  border: 1px solid #ccc;
  max-width: 700px;
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
  white-space: normal;
}

#resultsTable th {
  background-color: #535353;
  color: white;
  font-weight: bold;
  white-space: normal;
  word-wrap: break-word;
  max-width: 120px;
}

#resultsTable tfoot td {
  white-space: normal;
  word-wrap: break-word;
  text-align: center;
  font-size: 0.85rem;
  padding: 10px;
  color: #353535;
}

#copyImageBtn {
  width: 100%;
  padding: 10px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-top: 15px;
}

#copyImageBtn:hover {
  background-color: var(--accent);
}

/* Toggles */

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input,
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-switch input:checked + .slider {
  background-color: var(--accent);
}

.toggle-switch input:checked + .slider::before {
  transform: translateX(22px);
}

.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  justify-content: center;
}

.toggle-label {
  font-weight: bold;
  color: var(--primary);
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.toggle-switch .slider,
.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 1px;
  left: 1px;
  right: 1px;
  bottom: 1px;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 12px;
}

.toggle-switch .slider::before,
.switch .slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

.toggle-switch input:checked + .slider,
.switch input:checked + .slider {
  background-color: var(--accent);
}

.toggle-switch input:checked + .slider::before,
.switch input:checked + .slider::before {
  transform: translateX(22px);
}
/* Contacts Categories */

.category-filter {
  margin-bottom: 1rem;
  display: flex;
  gap: 0.5rem;
}

.category-btn {
  padding: 10px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 40px;
  transition: background-color 0.2s ease;
}

.category-btn.active,
.category-btn:hover {
  background-color: var(--accent);
  color: white;
}

.contacts-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  box-sizing: border-box;
}

.contact-card {
  background-color: var(--card);
  padding: 20px;
  width: 100%;
  flex: 0 1 300px;
  border-radius: 12px;
  box-shadow: 0 3px 8px var(--shadow);
  border: 1px solid #ddd;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.contact-card h3 {
  color: var(--primary);
  margin-top: 0;
  text-align: center;
}

.contact-card p strong {
  white-space: nowrap;
  margin-right: 6px;
  flex-shrink: 0;
}

.contact-card p {
  color: #555;
  margin: 6px 0;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  align-items: center;
}

.contact-card:hover {
  background-color: rgba(200, 200, 200, 0.15);
  box-shadow: 0 8px 16px rgba(255, 102, 0, 0.2);
}

.contact-card:hover > *:not(.copy-overlay) {
  opacity: 0.1;
}

#copyBtn {
  margin-top: 20px;
  align-items: center;
}

#searchInput {
  width: 100%;
  padding: 12px;
  margin-bottom: 20px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box;
}

.contact-card:hover .copy-icon {
  opacity: 0.2;
}

.contact-card.copied {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}

.copy-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.6);
  color: var(--accent);
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  font-size: 1.4em;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.contact-card:hover .copy-overlay {
  opacity: 1;
}

.contact-card:hover {
  transform: scale(1.05);
}

.copy-confirmation {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--accent);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1rem;
  box-shadow: 0 3px 8px var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
}

.copy-confirmation.show {
  opacity: 1;
}

/* Suggest a contact */

.suggest-btn {
  display: inline-block;
  background-color: var(--primary);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.2s ease;
}

.suggest-btn:hover {
  background-color: var(--accent);
}

.back-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 15px;
  display: inline-block;
  transition: background-color 0.2s ease;
}

.back-btn:hover {
  background-color: var(--accent);
}

/* EQL Calculator */

#eql-form {
  max-width: 400px;
  margin: 30px auto 50px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: stretch;
}

#eql-form label {
  font-weight: bold;
  color: var(--text);
}

#eql-form input,
#eql-form select,
#eql-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  resize: vertical;
}

#eql-form textarea {
  min-height: 70px;
}

#eql-form button[type="submit"] {
  padding: 12px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background-color 0.3s ease;
}

#eql-form button[type="submit"]:hover {
  background-color: var(--accent);
}

#output {
  max-width: 400px;
  margin: 0 auto 60px;
  background: var(--card);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 3px 8px var(--shadow);
  font-size: 1rem;
  color: var(--text);
  display: none; 
}

#output h2 {
  color: var(--primary);
  margin-bottom: 15px;
  font-size: 1.6rem;
}

#output p {
  margin: 6px 0;
}

#eqlTableCapture {
  margin: 0 auto;
  width: 100%;
  max-width: 550px;
  padding: 0;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 3px 8px var(--shadow);
  overflow-x: auto;
  position: relative;
}

/* The table itself */
#eqlResultsTable {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 1rem;
  text-align: center;  
  background-color: white;
  border: 1px solid #000000;
  border-radius: 12px;
  overflow: hidden;
}

/* Shared cell styling */
#eqlResultsTable th,
#eqlResultsTable td {
  padding: 10px 5px;
  border: 1px solid #ccc;
  max-width: 700px;
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
  white-space: normal;
  vertical-align: middle;
}

#eqlResultsTable th:first-child,
#eqlResultsTable td:first-child {
  background-color: #8a8a8a; 
  text-align: left;
}

/* Header cells */
#eqlResultsTable th {
  background-color: #535353; 
  color: white;
  font-weight: bold;
  white-space: normal;
  word-wrap: break-word;
  max-width: 120px;
}

/* Table title row */
#eqlResultsTable thead tr th.title {
  text-align: center;
  font-size: 1.4rem;
  padding: 10px;
  background-color: #6b6b6b;
  color: #fff;
}

#eql-output {
  display: none;
}

/* EQL Copy Button */
#copyEqlImageBtn {
  display: block;
  margin: 15px auto 0 auto;
  max-width: 400px;
  width: 100%;
  padding: 12px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#copyEqlImageBtn:hover {
  background-color: var(--accent);
}

/* VMS Board */

.vmsboard-container strong p {
  text-align: center;
  padding: 40px;
}

/* Cross Section */

.cross-section-container strong p {
  text-align: center;
  padding: 40px;
}

/* TGS Amendment Request */

.TGSAmend-container strong p {
  text-align: center;
  padding: 40px;
}

/* ---------------- MOBILE RESPONSIVENESS ---------------- */
@media (max-width: 600px) {
  .tagline,
  .site-title .tagline {
    font-size: 0.95rem;
  }

  main {
    padding: 0 10px;
  }

  .category-filter {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }

  .category-btn,
  .suggest-btn,
  .back-btn,
  button {
    width: 100%;
    padding: 10px 20px;
    font-size: 1rem;
    box-sizing: border-box;
  }

  .dropdown-wrapper {
    position: static;
    text-align: center;
    margin-bottom: 20px;
  }

  form,
  #searchInput {
    width: 100%;
    margin: 0 auto;
  }

  .button-row {
    flex-direction: column;
  }

  .card-container {
    grid-template-columns: 1fr;
  }

  .contacts-container {
    flex-direction: column;
    align-items: center;
  }

  .site-logo {
    height: 80px;
  }

  .site-title h1 {
    font-size: 1.5rem;
  }

  .navbar ul {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .navbar ul li ul.dropdown {
    position: static;
    transform: none;
    background-color: transparent;
    box-shadow: none;
    padding: 0;
  }
  
  .navbar ul li ul.dropdown li a {
    padding-left: 20px;
    background-color: var(--bg);
  }

  .navbar a {
    font-size: 1rem;
  }

  .tool-card {
    width: 90%;
    max-width: 95%;
  }

  .button-left,
  .button-right {
    left: 20px;
    right: 20px;
  }

  #eql-form,
  #output {
    width: 95%;
    margin-left: auto;
    margin-right: auto;
  }

  #eql-form button[type="submit"] {
    font-size: 1rem;
  }
}

@media (min-width: 1400px) {
  .navbar ul {
    gap: 130px;
  }
}

@media (max-width: 1024px) {
  .navbar ul {
    gap: 20px;
  }
}

/* --- CAROUSEL CONTAINER --- */
.carousel-container {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  overflow: hidden;
}

.carousel-cards {
  display: flex;
  transition: transform 0.5s ease-in-out;
  will-change: transform;
}

.carousel-dots {
  text-align: center;
  margin-top: 20px;
}

.dot {
  height: 12px;
  width: 12px;
  margin: 0 6px;
  background-color: #bbb;
  border-radius: 50%;
  display: inline-block;
  cursor: pointer;
}

.dot.active {
  background-color: var(--accent);
}

.dot:hover {
  background-color: var(--accent);
}

.tool-card {
  flex: 0 0 100%;
  opacity: 0.4;
  transform: scale(0.95);
  transition: all 0.4s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  align-items: center;
  justify-content: center;
  padding: 40px;
  box-sizing: border-box;
  background: var(--card);
  box-shadow: 0 3px 8px var(--shadow);
  border-radius: 20px;
}

.tool-card.active {
  transform: scale(1);
  opacity: 1;
}

.tool-content {
  text-align: center;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}

.tool-icon {
  font-size: 100px;
  text-align: center;
  color: var(--primary);
}

.tool-content h2 {
  text-align: center;
  width: 100%;
  max-width: 280px;
  color: var(--text);
}

.tool-content p {
  color: #555;
  font-size: 16px;
}

.button-left, .button-right {
  position: absolute;
  top: 50%;
  transform: translateY(-90%);
  font-size: 30px;
  color: #333;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 2;
}

.button-left {
  left: 10px;
}

.button-right {
  right: 10px;
}

.button-left:hover, .button-right:hover {
  background: none;
  color: var(--accent);
}