/* ====== Main Theme Vars ====== */
:root {
  --primary-color: #007bff;
  --secondary-color: #6c757d;
  --light-bg: #f8f9fa;
  --border-color: #dee2e6;
  --text-color: #212529;
  --white: #ffffff;
}

/* Reset / base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: #f5f5f5;
  color: var(--text-color);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

header {
  background-color: var(--primary-color);
  color: white;
  padding: 15px 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo { font-size: 24px; font-weight: bold; }
.logo span { font-weight: normal; }

nav ul { display: flex; list-style: none; }
nav ul li { margin-left: 20px; }
nav ul li a { color: white; text-decoration: none; font-weight: 500; transition: opacity 0.3s; }
nav ul li a:hover { opacity: 0.8; }

/* ====== Layout ====== */
.main-wrapper {
  display: flex;
  gap: 20px;
  margin: 20px 0;
}
/* Important for sticky in flex/grid rows */
.main-wrapper { align-items: flex-start; }

.content-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ====== Converter ====== */
.converter-section {
  background-color: var(--white);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.converter-section h2 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-size: 22px;
}

/* Use grid for desktop tool layout */
.converter-tool {
  display: grid;
  grid-template-columns: 1fr 48px 1fr;
  gap: 15px;
  align-items: end;
}

.input-group { display: flex; flex-direction: column; }
.input-group label {
  margin-bottom: 8px;
  color: var(--secondary-color);
  font-size: 14px;
  font-weight: 500;
}

.input-group input,
.input-group select {
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 16px;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.swap-btn {
  background-color: var(--light-bg);
  border: 1px solid #dbeafe;
  border-radius: 8px;
  width: 48px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
}
.swap-btn:hover { background-color: var(--border-color); }

.conversion-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.conversion-table th, .conversion-table td {
  padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--border-color);
}
.conversion-table th { background-color: var(--light-bg); font-weight: 600; }
.conversion-table tr:nth-child(even) { background-color: var(--light-bg); }
.conversion-table tr:hover { background-color: rgba(0, 123, 255, 0.1); }

.description-section {
  background-color: var(--white);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  margin-top: 0;
}
.description-section h3 { color: var(--primary-color); margin-bottom: 15px; }
.description-section p, .description-section ul { margin-bottom: 15px; color: var(--secondary-color); }
.description-section ul { padding-left: 20px; }

/* ====== Sidebar / Ads ====== */
.ad-section {
  width: 340px;
  background-color: var(--light-bg);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.ad-placeholder {
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e9ecef;
  border: 1px dashed var(--border-color);
  color: var(--secondary-color);
  margin-bottom: 20px;
}

.conversion-links { display: flex; flex-direction: column; gap: 10px; }
.conversion-links a {
  color: var(--primary-color);
  text-decoration: none;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.3s;
}
.conversion-links a:hover { background-color: rgba(0, 123, 255, 0.1); }

/* ====== Footer ====== */
.footer { background-color: var(--primary-color); color: white; padding: 30px 0 20px; margin-top: 30px; }
.footer-content { display: flex; flex-direction: column; gap: 20px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; }
.footer-links a { color: white; text-decoration: none; transition: opacity 0.3s; }
.footer-links a:hover { opacity: 0.8; }
.copyright { text-align: center; font-size: 14px; opacity: 0.8; }

/* ====== Additional Theme Vars (kept from your file) ====== */
:root {
  --primary-blue: #007BFF;
  --darker-blue: #0056D2;
  --light-blue-bg: #E8F1FC;
  --sidebar-hover: #D9EAFF;
  --light-gray: #CCCCCC;
  --mid-gray: #666666;
  --ad-box-bg: #F1F1F1;
  --main-text: #222222;
  --secondary-text: #555555;
  --swap-btn-bg: #EEF4FF;
  --sidebar-bg: #F2F6FC;
}

/* ====== Info section (kept) ====== */
.info-section { background-color: #ffffff; padding: 20px; border-left: 4px solid var(--primary-blue); border-radius: 6px; margin-bottom: 30px; }
.info-section h3 { margin-top: 0; color: var(--primary-blue); }
.info-section ul { list-style: none; padding: 0; }
.info-section ul li { margin: 6px 0; display: inline-block; width: 45%; justify-content: space-between; }
.info-section ul li a { color: rgb(6, 2, 241); text-decoration: underline; }
.info-section ul li a:hover { text-decoration: none; }

/* ====== Responsive ====== */
@media (max-width: 1024px) {
  .ad-section { width: 100%; order: -1; }
  .converter-tool { grid-template-columns: 1fr; grid-template-rows: auto auto auto; }
  .swap-btn { margin: 10px auto; transform: rotate(90deg); }
}

@media (max-width: 768px) {
  .main-wrapper { flex-direction: column; }
  .header-content { flex-direction: column; text-align: center; gap: 15px; }
  nav ul { flex-wrap: wrap; justify-content: center; gap: 10px; }
  nav ul li { margin: 0; }

  .description-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
    border-left: 4px solid #007bff;
  }
  .description-section h3 { color: #007bff; margin-bottom: 15px; }
  .formula-section h4 {
    color: #495057;
    margin: 20px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #dee2e6;
  }
  .description-section ul { margin-bottom: 15px; padding-left: 20px; }
  .description-section li { margin-bottom: 5px; line-height: 1.5; }
  .conversion-notes { background-color: #e9ecef; padding: 15px; border-radius: 6px; margin-top: 20px; font-size: 0.9em; }
}

/* ====== Sticky sidebar rules ====== */
/* Desktop: freeze sidebar */
@media (min-width: 1025px) {
  .freeze_div {
    position: -webkit-sticky;
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 16px);
    overflow: auto;
    align-self: start;
    width: 340px;
  }
}
/* Button row */
.button-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Base tab button */
.tab-btn {
  appearance: none;
    background: var(--primary-blue, #007BFF);
    color: #fff;
    /* font-weight: 700; */
    font-size: 14px;
    line-height: 1;
    padding: 15px 22px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s ease, transform .05s ease, box-shadow .2s ease;
}

/* Hover: slightly darker blue */
.tab-btn:hover {
  background: var(--darker-blue, #0056D2);
}

/* Active/selected state */
.tab-btn[aria-selected="true"],
.tab-btn.active {
  background: var(--darker-blue, #0056D2);
}

/* Keyboard focus ring */
.tab-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(16, 129, 255, 0.35);
}

/* Disabled (optional) */
.tab-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
