/* Ideal Weight Calculator - Calculator Archive
 * Pixel-perfect clone of Calculator.net Ideal Weight Calculator
 */

.iw-page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 15px 40px;
  font-family: Arial, Helvetica, sans-serif;
  color: #333333;
}

/* Top Bar: Breadcrumbs & Print / Saved */
.iw-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 8px;
}

.iw-breadcrumbs {
  color: #0844a4;
}

.iw-breadcrumbs a {
  color: #0844a4;
  text-decoration: none;
}

.iw-breadcrumbs a:hover {
  text-decoration: underline;
}

.iw-breadcrumbs .sep {
  color: #777777;
  margin: 0 4px;
}

.iw-breadcrumbs .current {
  color: #333333;
}

.iw-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.iw-saved-btn {
  background: #f4f6f8;
  border: 1px solid #b5c7d8;
  color: #003366;
  font-size: 11.5px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.iw-saved-btn:hover {
  background: #e2eaf2;
  border-color: #0844a4;
}

.iw-saved-badge {
  background: #003366;
  color: #ffffff;
  border-radius: 10px;
  padding: 0 5px;
  font-size: 10px;
  line-height: 14px;
}

.iw-print-link {
  color: #0844a4;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 13px;
  font-family: inherit;
  padding: 0;
}

.iw-print-link:hover {
  color: #002277;
}

/* Page Title */
.iw-page-title {
  font-size: 26px;
  font-weight: bold;
  color: #003366;
  margin: 0 0 10px 0;
}

/* Intro Paragraph */
.iw-intro-text {
  font-size: 13px;
  line-height: 1.55;
  color: #333333;
  margin: 0 0 16px 0;
}

.iw-intro-text em {
  font-style: italic;
}

/* Two-column layout: Left Content (740px) vs Right Sidebar (320px) */
.iw-main-grid {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 25px;
  align-items: start;
}

.iw-content-col {
  min-width: 0;
}

/* Calculator + Result Row */
.iw-calc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
  align-items: flex-start;
}

/* FORM CONTAINER */
.iw-form-container {
  flex: 0 0 310px;
  width: 310px;
}

/* Tabs */
.iw-tabs {
  display: flex;
  background: #ffffff;
  border-bottom: 1px solid #c5d5e5;
  margin-bottom: 0;
}

.iw-tab {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  border: 1px solid #c5d5e5;
  border-bottom: none;
  background: #19528d;
  color: #ffffff;
  margin-right: 3px;
  border-radius: 3px 3px 0 0;
  transition: background 0.15s ease;
}

.iw-tab:hover {
  background: #2365aa;
}

.iw-tab.active {
  background: #ffffff;
  color: #003366;
  border-bottom: 1px solid #ffffff;
  margin-bottom: -1px;
}

/* Form Box */
.iw-form-box {
  background: #ffffff;
  border: 1px solid #c5d5e5;
  padding: 12px 14px 16px;
  border-radius: 0 3px 3px 3px;
}

.iw-form-table {
  width: 100%;
  border-collapse: collapse;
}

.iw-form-table td {
  padding: 6px 4px;
  font-size: 13px;
  vertical-align: middle;
}

.iw-form-table td:first-child {
  width: 65px;
  color: #222222;
  font-weight: normal;
}

.iw-gender-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.iw-gender-group label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 13px;
}

.iw-gender-group input[type="radio"] {
  cursor: pointer;
  margin: 0;
}

.iw-input {
  border: 1px solid #999999;
  border-radius: 2px;
  padding: 4px 6px;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
}

.iw-input:focus {
  outline: none;
  border-color: #0844a4;
  box-shadow: 0 0 3px rgba(8, 68, 164, 0.4);
}

.iw-age-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.iw-age-row .iw-input {
  width: 75px;
}

.iw-age-note {
  font-size: 12px;
  color: #555555;
}

.iw-unit-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.iw-unit-row .iw-input {
  width: 100%;
}

.iw-unit-row span {
  font-size: 12px;
  color: #333333;
  min-width: 22px;
}

.iw-unit-split {
  display: flex;
  align-items: center;
  gap: 6px;
}

.iw-unit-split input {
  width: 60px;
}

/* Button Row */
.iw-btn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.iw-calc-btn {
  background: #4c8b25;
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
  border: 1px solid #3d701e;
  border-radius: 3px;
  padding: 6px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.iw-calc-btn:hover {
  background: #3f741f;
}

.iw-calc-btn svg {
  fill: #ffffff;
}

.iw-clear-btn {
  background: #999999;
  color: #ffffff;
  font-size: 13px;
  font-weight: normal;
  border: 1px solid #777777;
  border-radius: 3px;
  padding: 6px 14px;
  cursor: pointer;
}

.iw-clear-btn:hover {
  background: #888888;
}

/* RESULTS CONTAINER */
.iw-result-container {
  flex: 1;
  min-width: 290px;
  background: #ffffff;
  border-radius: 3px;
  overflow: hidden;
}

.iw-result-header {
  background: #5b8c32;
  color: #ffffff;
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 3px 3px 0 0;
}

.iw-result-title {
  font-size: 16px;
  font-weight: bold;
  margin: 0;
}

.iw-save-action {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0.95;
  padding: 2px 5px;
}

.iw-save-action:hover {
  opacity: 1;
  text-decoration: underline;
}

.iw-result-content {
  padding: 10px 0;
}

.iw-result-intro {
  font-size: 13px;
  margin: 0 0 8px 0;
  color: #333333;
}

/* Result Table */
.iw-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 4px;
  border: 1px solid #c5d5e5;
  background: #ffffff;
}

.iw-table th {
  background: #24588f;
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
  text-align: left;
  padding: 6px 10px;
  border: 1px solid #1c4977;
}

.iw-table th:last-child {
  text-align: right;
}

.iw-table td {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #d9e3ed;
  color: #333333;
}

.iw-table tr:nth-child(even) td {
  background: #f9fbfd;
}

.iw-table td:last-child {
  text-align: right;
  font-weight: bold;
  color: #227700;
}

.iw-save-feedback {
  display: none;
  font-size: 11.5px;
  color: #27ae60;
  margin-top: 6px;
  font-weight: bold;
}

/* RELATED SECTION */
.iw-related-box {
  margin: 10px 0 26px 0;
}

.iw-related-title {
  display: inline-block;
  background: #e8edf3;
  color: #003366;
  font-size: 12px;
  font-weight: bold;
  padding: 3px 10px;
  border-radius: 3px 3px 0 0;
  border: 1px solid #c5d5e5;
  border-bottom: none;
  margin-bottom: 0;
}

.iw-related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: #f4f6f9;
  padding: 10px 12px;
  border: 1px solid #c5d5e5;
  border-radius: 0 3px 3px 3px;
}

.iw-related-btn {
  background: #23527c;
  color: #ffffff;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: bold;
  padding: 5px 12px;
  border-radius: 3px;
  transition: background 0.15s ease;
  display: inline-block;
}

.iw-related-btn:hover {
  background: #173855;
  text-decoration: none;
  color: #ffffff;
}

/* EDITORIAL / SEO CONTENT */
.iw-seo-article {
  margin-top: 15px;
  font-size: 13px;
  line-height: 1.65;
  color: #333333;
}

.iw-seo-article h2 {
  font-size: 20px;
  color: #003366;
  font-weight: bold;
  margin: 22px 0 8px 0;
  padding-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
}

.iw-seo-article h3 {
  font-size: 15px;
  color: #003366;
  font-weight: bold;
  margin: 16px 0 6px 0;
}

.iw-seo-article p {
  margin: 0 0 10px 0;
}

.iw-seo-article ul, .iw-seo-article ol {
  margin: 0 0 12px 0;
  padding-left: 20px;
}

.iw-seo-article li {
  margin-bottom: 6px;
}

.iw-seo-callout {
  background: #f0f7fd;
  border-left: 4px solid #19528d;
  padding: 12px 14px;
  margin: 14px 0;
  border-radius: 0 4px 4px 0;
}

.iw-seo-callout-title {
  font-weight: bold;
  color: #003366;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.iw-formula-block {
  background: #f8fafc;
  border: 1px solid #d1dce7;
  padding: 8px 12px;
  margin: 8px 0 12px 0;
  border-radius: 3px;
  font-family: Consolas, Monaco, monospace;
  font-size: 12.5px;
  color: #1e3a8a;
}

/* RIGHT SIDEBAR */
.iw-sidebar {
  width: 310px;
}

/* Search widget */
.iw-search-card {
  margin-bottom: 20px;
}

.iw-search-form {
  display: flex;
  gap: 4px;
}

.iw-search-input {
  flex: 1;
  border: 1px solid #888888;
  border-radius: 2px;
  padding: 5px 8px;
  font-size: 13px;
  font-family: inherit;
}

.iw-search-input:focus {
  outline: none;
  border-color: #0844a4;
  box-shadow: 0 0 3px rgba(8, 68, 164, 0.4);
}

.iw-search-btn {
  background: #23527c;
  color: #ffffff;
  border: 1px solid #1a3e5d;
  border-radius: 2px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
}

.iw-search-btn:hover {
  background: #173855;
}

/* Instant search autocomplete dropdown */
.iw-search-results-dropdown {
  display: none;
  background: #ffffff;
  border: 1px solid #c5d5e5;
  border-radius: 3px;
  margin-top: 4px;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  position: absolute;
  width: 310px;
  z-index: 100;
}

.iw-search-results-dropdown.active {
  display: block;
}

.iw-search-result-item {
  padding: 6px 10px;
  font-size: 12.5px;
  color: #0844a4;
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #edf2f7;
}

.iw-search-result-item:hover {
  background: #f0f4f9;
}

.iw-search-result-item .item-cat {
  font-size: 11px;
  color: #777777;
}

/* Sidebar Calculators Card */
.iw-sidebar-card {
  border: 1px solid #c5d5e5;
  border-radius: 3px;
  background: #ffffff;
  margin-bottom: 20px;
  overflow: hidden;
}

.iw-sidebar-header {
  background: #23527c;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: bold;
  padding: 7px 10px;
}

.iw-sidebar-body {
  padding: 10px;
}

.iw-two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
}

.iw-two-cols a {
  font-size: 12px;
  color: #0844a4;
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.iw-two-cols a:hover {
  text-decoration: underline;
}

.iw-two-cols a.active {
  font-weight: bold;
  color: #000000;
  text-decoration: underline;
}

.iw-sidebar-footer {
  border-top: 1px solid #e2e8f0;
  margin-top: 10px;
  padding-top: 8px;
  font-size: 11.5px;
  text-align: center;
  color: #666666;
}

.iw-sidebar-footer a {
  color: #0844a4;
  text-decoration: none;
  margin: 0 2px;
}

.iw-sidebar-footer a:hover {
  text-decoration: underline;
}

/* MODALS: Saved Calculations */
.iw-modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.iw-modal-backdrop.active {
  display: flex;
}

.iw-modal-card {
  background: #ffffff;
  border-radius: 4px;
  width: 90%;
  max-width: 520px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: iwFadeIn 0.2s ease;
}

@keyframes iwFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.iw-modal-header {
  background: #23527c;
  color: #ffffff;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  font-size: 14px;
}

.iw-modal-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.iw-modal-body {
  padding: 14px 16px;
  max-height: 380px;
  overflow-y: auto;
  font-size: 13px;
}

.iw-modal-footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.iw-saved-item {
  border-bottom: 1px solid #edf2f7;
  padding: 8px 0;
}

.iw-saved-item:last-child {
  border-bottom: none;
}

.iw-saved-item-header {
  display: flex;
  justify-content: space-between;
  color: #777;
  font-size: 11px;
  margin-bottom: 4px;
}

.iw-saved-item-title {
  font-weight: bold;
  color: #003366;
}

.iw-saved-item-del {
  color: #c0392b;
  cursor: pointer;
  border: none;
  background: none;
  font-size: 11px;
}

/* RTL Support */
[dir="rtl"] .iw-page-container {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .iw-table th {
  text-align: right;
}

[dir="rtl"] .iw-table th:last-child,
[dir="rtl"] .iw-table td:last-child {
  text-align: left;
}

[dir="rtl"] .iw-seo-callout {
  border-left: none;
  border-right: 4px solid #19528d;
  border-radius: 4px 0 0 4px;
}

[dir="rtl"] .iw-tab {
  margin-right: 0;
  margin-left: 3px;
}

.iw-modal-card-lg {
  max-width: 680px;
}

.iw-print-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.iw-print-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: bold;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.iw-print-action-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.iw-print-action-btn.iw-btn-print-now {
  background: #5c9038;
  color: #ffffff;
  border-color: #48722b;
}

.iw-print-action-btn.iw-btn-print-now:hover {
  background: #4d7a2f;
}

.iw-print-sheet {
  background: #ffffff;
  font-size: 12.5px;
  line-height: 1.5;
  color: #1e293b;
}

.iw-print-sheet-header {
  border-bottom: 2px solid #003366;
  padding-bottom: 8px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.iw-print-sheet-title {
  font-size: 18px;
  font-weight: bold;
  color: #003366;
  margin: 0;
}

.iw-print-sheet-date {
  font-size: 11px;
  color: #64748b;
}

.iw-print-section-title {
  font-size: 13.5px;
  font-weight: bold;
  color: #003366;
  margin: 12px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
}

.iw-print-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  font-size: 12px;
}

.iw-print-table th,
.iw-print-table td {
  border: 1px solid #cbd5e1;
  padding: 6px 8px;
}

.iw-print-table th {
  background: #f1f5f9;
  font-weight: bold;
  color: #1e293b;
  text-align: left;
}

.iw-print-tip {
  font-size: 11.5px;
  color: #64748b;
}

.iw-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #1e293b;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  display: none;
  z-index: 99999;
  animation: iwToastIn 0.2s ease;
}

@keyframes iwToastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* RESPONSIVE DESIGN */
@media (max-width: 900px) {
  .iw-main-grid {
    grid-template-columns: 1fr;
  }
  .iw-sidebar {
    width: 100%;
  }
  .iw-search-results-dropdown {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .iw-calc-row {
    flex-direction: column;
  }
  .iw-form-container {
    width: 100%;
    flex: 1 1 100%;
  }
  .iw-result-container {
    width: 100%;
  }
}

/* PRINT STYLES */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  /* When printing from modal */
  body.iw-printing-modal .site-header,
  body.iw-printing-modal .site-footer,
  body.iw-printing-modal .iw-main-grid,
  body.iw-printing-modal .iw-top-bar,
  body.iw-printing-modal .iw-toast,
  body.iw-printing-modal #iw-saved-modal,
  body.iw-printing-modal .iw-print-toolbar,
  body.iw-printing-modal .iw-modal-header,
  body.iw-printing-modal .iw-modal-footer {
    display: none !important;
  }

  body.iw-printing-modal #iw-print-modal {
    display: block !important;
    position: static !important;
    background: transparent !important;
    width: 100% !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.iw-printing-modal .iw-modal-card {
    max-width: 100% !important;
    width: 100% !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  body.iw-printing-modal .iw-modal-body {
    padding: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* Default page print */
  .site-header, .site-footer, .iw-top-bar, .iw-sidebar, .iw-tabs, .iw-btn-row, .iw-related-box, .iw-save-action, .iw-modal-backdrop, .iw-toast {
    display: none !important;
  }
  .iw-main-grid {
    display: block !important;
  }
  .iw-page-container {
    max-width: 100% !important;
    padding: 0 !important;
  }
  .iw-calc-row {
    display: block !important;
  }
  .iw-result-container {
    border: 1px solid #333 !important;
    margin-top: 15px;
  }
}
