/* =========================
   Base Reset & Typography
   ========================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Segoe UI', sans-serif;
  background-color: #121212;
  color: #e0e0e0;
  line-height: 1.6;
}

/* =========================
   Container Layout
   ========================= */
.container {
  display: flex;
  max-width: 1200px;   /* fixed desktop width */
  margin: 0 auto;
  padding: 40px 20px;
  gap: 40px;
}

/* Main content area */
.main {
  flex: 2;             /* proportional width */
  min-width: 0;
  background-color: #1e1e1e;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(0,0,0,0.3);
}

/* Sidebar */
.sidebar {
  flex: 1;
  min-width: 0;
  background-color: #1a1a1a;
  padding: 30px 20px;
  border-radius: 10px;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
}
.sidebar h2 { font-size: 1.1em; color: #90caf9; margin-bottom: 10px; }
.sidebar a { color: #64b5f6; text-decoration: none; font-size: 1em; padding: 6px 0; transition: color 0.2s; display: block; }
.sidebar a:hover { color: #fff; text-decoration: underline; }

/* Footer */
.footer {
  background-color: #1a1a1a;
  color: #888;
  text-align: center;
  padding: 20px;
  font-size: 0.9em;
}
.footer a { color: #64b5f6; text-decoration: none; transition: color 0.2s; }
.footer a:hover { color: #fff; }

/* =========================
   Headings
   ========================= */
h1#pageTitle {
  font-size: 2em;
  color: #eee;
  margin: 0.5em 0;
  line-height: 1.2;
  word-wrap: break-word;
}
h3 {
  margin-top: 10px;
  font-size: 1.4em;
  color: #e0e0e0;
  margin-bottom: 20px;
}

/* =========================
   Converter Form
   ========================= */
#convertForm {
  background-color: #1e1e1e;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(0,0,0,0.4);
  max-width: 600px;
  margin-top: 20px;
}
#convertForm label {
  display: block;
  margin-top: 10px;
  font-weight: 600;
  color: #fcd486;
  font-size: 1em;
}
#convertForm select,
#convertForm input[type="text"] {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border: 1px solid #444;
  border-radius: 8px;
  font-size: 1em;
  background-color: #2c2c2c;
  color: #e0e0e0;
  transition: border-color 0.2s;
}
#convertForm select:focus,
#convertForm input[type="text"]:focus {
  outline: none;
  border-color: #90caf9;
}
#convertForm button {
  margin-top: 10px;
  padding: 10px 20px;
  background-color: #4b7c11;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.2s;
}
#convertForm button:hover { background-color: #3a5c0d; }
#convertForm #copyStatus { margin-left: 10px; color: #00e676; font-weight: bold; }

/* =========================
   Breadcrumbs
   ========================= */
.breadcrumb-container {
  font-size: 0.85em;
  color: #ccc;
  margin-bottom: 0.75em;
  white-space: nowrap;
  overflow-x: auto;
}
.breadcrumb-container a {
  color: #9ecfff;
  text-decoration: none;
}
.breadcrumb-container a:hover {
  text-decoration: underline;
  color: #cce6ff;
}
.breadcrumb-container .separator {
  margin: 0 0.25em;
  color: #666;
}

/* =========================
   Popular Conversions
   ========================= */
.popular {
  background-color: #1e1e1e;
  color: #f0f0f0;
  padding: 20px;
  margin-top: 20px;
  border-radius: 8px;
  border: 1px solid #333;
}
.popular h3 {
  margin-bottom: 15px;
  font-size: 1.4em;
  color: #fff;
}
.popular ul {
  list-style: none;
  padding: 0;
  columns: 2;
}
.popular li { margin-bottom: 6px; }
.popular a {
  color: #4fc3f7;
  text-decoration: none;
}
.popular a:hover { text-decoration: underline; }

/* =========================
   Conversion Grids
   ========================= */
.conversion-grid,
.latest-conversion {
  background-color: #1e1e1e;
  color: #f0f0f0;
  padding: 20px;
  margin-top: 30px;
  border-radius: 8px;
  border: 1px solid #333;
}
.conversion-grid h3,
.latest-conversion h3 {
  margin-bottom: 15px;
  font-size: 1.4em;
  color: #fff;
}
.conversion-links,
.latest-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 20px;
}
.conversion-links a,
.latest-links a {
  color: #80c0ff;
  text-decoration: none;
  padding: 8px;
  background-color: #2a2a2a;
  border-radius: 4px;
  border: 1px solid #444;
  transition: background-color 0.2s ease, color 0.2s ease;
  font-size: 1em;
}
.conversion-links a:hover,
.latest-links a:hover {
  background-color: #333;
  color: #cce6ff;
}

/* =========================
   Cookie Banner
   ========================= */
.cookie-banner {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #1e1e1e;
  color: #f0f0f0;
  padding: 20px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fadeInUp 0.5s ease-out;
}
.cookie-banner button {
  margin-top: 12px;
  background: #3a3a3a;
  color: #f0f0f0;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}
.cookie-banner button:hover { background: #555; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translate(-50%, -60%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

/* =========================
   Contact Form
   ========================= */
.contact-form form {
  background-color: #1e1e1e;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(0,0,0,0.4);
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.contact-form label {
  font-weight: 600;
  color: #fcd486;
  font-size: 0.95em;
  margin-bottom: 4px;
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="number"],
.contact-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #444;
  border-radius: 8px;
  font-size: 1em;
  background-color: #2c2c2c;
  color: #e0e0e0;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #90caf9;
}
.contact-form button {
  padding: 12px 20px;
  background-color: #4b7c11;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.2s;
}
.contact-form button:hover { background-color: #3a5c0d; }

/* =========================
   Responsive Media Queries
   ========================= */

/* Tablet screens */
@media (max-width: 992px) {
  .container {
    flex-direction: column;
    gap: 20px;
    padding: 20px 10px;
  }
  .main, .sidebar {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* Small phones */
@media (max-width: 600px) {
  body {
    font-size: 0.9em;
  }
  h1#pageTitle {
    font-size: 1.5em;
  }
  .conversion-links,
  .latest-links {
    grid-template-columns: 1fr; /* stack links */
  }
  #convertForm button {
    width: 100%; /* buttons full width on mobile */
  }
  .cookie-banner {
    width: 90%;
    font-size: 0.85em;
    padding: 12px;
  }
  .contact-form form {
    padding: 12px;
  }
}

/* Example additions to converter-dark.css */
#unitSearchBox {
    margin-top: 30px;
    padding: 20px;
    background-color: #222; /* dark background */
    border: 1px solid #444;
    border-radius: 6px;
    color: #ddd;
}

#unitSearchBox h3 {
    margin-top: 0;
    color: #fff;
}

#searchForm input[type="text"] {
    background-color: #333;
    border: 1px solid #555;
    color: #eee;
    padding: 6px;
}

#searchForm button {
    background-color: #555;
    color: #fff;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
}

#searchForm button:hover {
    background-color: #777;
}

.search-results {
    margin-top: 15px;
    color: #ccc;
}
