/* Calorie Calculator Page Styles - Pixel-perfect Calculator.net Clone */

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

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

.cal-breadcrumbs {
  color: #0844a4;
  font-size: 13px;
}

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

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

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

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

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

.cal-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;
}

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

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

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

/* Page Title & Intro */
.cal-page-title {
  font-size: 26px;
  font-weight: bold;
  color: #003366;
  margin: 0 0 8px 0;
}

.cal-intro-text {
  font-size: 13.5px;
  line-height: 1.55;
  color: #333333;
  margin: 0 0 16px 0;
}

/* Main 2-Column Layout: Content Column & Sidebar */
.cal-main-grid {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 22px;
}

.cal-content-col {
  flex: 1;
  min-width: 0;
}

.cal-sidebar-col {
  width: 270px;
  flex-shrink: 0;
}

/* Calculator Top Row: Form Box & Result Box */
.cal-calc-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

/* Form Container & Tabs */
.cal-form-container {
  width: 330px;
  flex-shrink: 0;
}

.cal-tabs {
  display: flex;
  margin-bottom: -1px;
  position: relative;
  z-index: 2;
}

.cal-tab {
  background-color: #2f5597;
  color: #ffffff;
  border: 1px solid #2f5597;
  border-bottom: none;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: bold;
  cursor: pointer;
  margin-right: 2px;
  border-radius: 3px 3px 0 0;
  transition: background-color 0.15s;
  white-space: nowrap;
}

.cal-tab:hover {
  background-color: #24437a;
}

.cal-tab.active {
  background-color: #eeeeee;
  color: #000000;
  border: 1px solid #cccccc;
  border-bottom: 1px solid #eeeeee;
  cursor: default;
}

/* Form Box */
.cal-form-box {
  background-color: #eeeeee;
  border: 1px solid #cccccc;
  padding: 14px 16px;
  font-size: 13px;
  border-radius: 0 3px 3px 3px;
}

.cal-form-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
}

.cal-form-table td {
  vertical-align: middle;
  padding: 2px 0;
}

.cal-label-col {
  width: 70px;
  font-weight: normal;
  color: #333333;
  padding-right: 8px;
  font-size: 13px;
}

.cal-input-col {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cal-input-text {
  width: 65px;
  height: 24px;
  padding: 2px 5px;
  border: 1px solid #707070;
  background-color: #ffffff;
  font-size: 13px;
  color: #000000;
  box-sizing: border-box;
}

.cal-input-text:focus {
  outline: 1px solid #2b5797;
}

.cal-unit-note {
  font-size: 12px;
  color: #333333;
}

/* Radio Group */
.cal-radio-group {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.cal-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
}

.cal-radio-label input[type="radio"] {
  margin: 0;
  cursor: pointer;
}

/* Activity Select Dropdown */
.cal-select {
  width: 100%;
  max-width: 235px;
  height: 25px;
  padding: 2px 4px;
  border: 1px solid #707070;
  background-color: #ffffff;
  font-size: 12.5px;
  color: #000000;
  box-sizing: border-box;
}

/* Settings Toggle & Collapsible Panel */
.cal-settings-wrap {
  margin-top: 4px;
  margin-bottom: 8px;
}

.cal-settings-link {
  color: #0844a4;
  font-size: 12.5px;
  text-decoration: underline;
  cursor: pointer;
  display: inline-block;
  font-weight: bold;
}

.cal-settings-link:hover {
  color: #002277;
}

.cal-settings-panel {
  margin-top: 8px;
  padding: 8px 10px;
  background-color: #e2e6ec;
  border: 1px solid #c0c8d4;
  border-radius: 3px;
  font-size: 12px;
}

.cal-settings-row {
  margin-bottom: 6px;
}

.cal-settings-row:last-child {
  margin-bottom: 0;
}

.cal-settings-row label {
  display: block;
  margin-bottom: 3px;
  font-weight: bold;
  color: #222;
}

/* Buttons */
.cal-btn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.cal-btn-calculate {
  background-color: #2e7d32;
  color: #ffffff;
  border: 1px solid #1e6322;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: bold;
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s;
}

.cal-btn-calculate:hover {
  background-color: #256628;
}

.cal-btn-calculate .btn-arrow {
  font-size: 11px;
  line-height: 1;
}

.cal-btn-clear {
  background-color: #9e9e9e;
  color: #ffffff;
  border: 1px solid #888888;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: normal;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 0.15s;
}

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

/* Notes Under Calculator */
.cal-notes-list {
  margin: 10px 0 20px 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: #333333;
  line-height: 1.6;
}

.cal-notes-list li {
  margin-bottom: 3px;
}

/* Results Section */
.cal-results-box {
  flex: 1;
  min-width: 0;
  background-color: #ffffff;
  border: 1px solid #b7c8d9;
  border-radius: 4px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.cal-res-header {
  font-size: 18px;
  font-weight: bold;
  color: #003366;
  margin-bottom: 6px;
  border-bottom: 1px solid #e0e6ed;
  padding-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cal-unit-toggle-btn {
  background: #f0f4f8;
  border: 1px solid #c0d0e0;
  color: #0844a4;
  font-size: 11.5px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
}

.cal-unit-toggle-btn:hover {
  background: #e2ecf5;
}

.cal-res-intro {
  font-size: 12.5px;
  color: #555555;
  line-height: 1.45;
  margin-bottom: 12px;
}

/* Maintenance Highlight Card */
.cal-maintain-card {
  background-color: #edf7ed;
  border: 1px solid #c8e6c9;
  border-left: 5px solid #2e7d32;
  padding: 10px 14px;
  border-radius: 3px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cal-maintain-label {
  font-size: 14px;
  font-weight: bold;
  color: #1e4620;
}

.cal-maintain-val {
  font-size: 22px;
  font-weight: bold;
  color: #2e7d32;
}

.cal-maintain-unit {
  font-size: 13px;
  font-weight: normal;
  color: #444;
  margin-left: 2px;
}

/* Goals Breakdown Table */
.cal-goals-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-bottom: 14px;
}

.cal-goals-table th,
.cal-goals-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid #e8e8e8;
}

.cal-goals-table th {
  background-color: #f2f5f9;
  color: #003366;
  font-weight: bold;
}

.cal-goals-table tr:hover {
  background-color: #f9fbfd;
}

.cal-goals-table .goal-num {
  font-weight: bold;
  color: #2e7d32;
}

.cal-goals-table .goal-pct {
  font-size: 11px;
  color: #777777;
}

/* Metabolic Stats Pill Bar */
.cal-stats-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.cal-stat-pill {
  flex: 1;
  min-width: 140px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 6px 10px;
  border-radius: 3px;
  font-size: 11.5px;
}

.cal-stat-pill .stat-label {
  color: #64748b;
  display: block;
  margin-bottom: 2px;
}

.cal-stat-pill .stat-val {
  font-size: 14px;
  font-weight: bold;
  color: #0f172a;
}

/* Action row inside results */
.cal-res-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #eef2f6;
}

.cal-save-action-btn {
  background-color: #003366;
  color: #ffffff;
  border: none;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: bold;
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cal-save-action-btn:hover {
  background-color: #0844a4;
}

/* Food Energy Converter Section */
.cal-converter-section {
  margin-top: 24px;
  margin-bottom: 30px;
}

.cal-section-title {
  font-size: 20px;
  font-weight: bold;
  color: #003366;
  margin: 0 0 6px 0;
}

.cal-converter-intro {
  font-size: 13.5px;
  color: #333333;
  line-height: 1.55;
  margin: 0 0 12px 0;
}

.cal-converter-box {
  background-color: #eeeeee;
  border: 1px solid #cccccc;
  padding: 14px 16px;
  font-size: 13px;
  border-radius: 3px;
}

.cal-converter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.cal-conv-input {
  width: 75px;
  height: 25px;
  padding: 2px 6px;
  border: 1px solid #707070;
  background-color: #ffffff;
  font-size: 13px;
  box-sizing: border-box;
}

.cal-conv-select {
  height: 25px;
  padding: 2px 6px;
  border: 1px solid #707070;
  background-color: #ffffff;
  font-size: 13px;
  box-sizing: border-box;
  max-width: 220px;
}

.cal-conv-eq {
  font-weight: bold;
  font-size: 14px;
  color: #333333;
}

.cal-conv-result {
  font-weight: bold;
  font-size: 15px;
  color: #2e7d32;
  min-width: 60px;
  display: inline-block;
}

/* Right Sidebar Column */
.cal-side-search-form {
  display: flex;
  margin-bottom: 14px;
  position: relative;
}

.cal-side-search-wrap {
  position: relative;
  flex: 1;
}

.cal-side-search-input {
  width: 100%;
  height: 28px;
  padding: 3px 8px;
  font-size: 13px;
  border: 1px solid #7f9db9;
  border-right: none;
  box-sizing: border-box;
  border-radius: 2px 0 0 2px;
}

.cal-side-search-btn {
  background-color: #2b5797;
  color: #ffffff;
  border: 1px solid #2b5797;
  padding: 0 12px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 0 2px 2px 0;
  transition: background-color 0.15s;
}

.cal-side-search-btn:hover {
  background-color: #1e3f6f;
}

.cal-search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #7f9db9;
  border-top: none;
  max-height: 260px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  display: none;
}

.cal-search-dropdown.active {
  display: block;
}

.cal-search-item {
  padding: 6px 10px;
  font-size: 12px;
  color: #333333;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
}

.cal-search-item:hover {
  background-color: #eef4fb;
  color: #0844a4;
}

.cal-search-item-cat {
  font-size: 10.5px;
  color: #888888;
}

/* Sidebar Card */
.cal-side-card {
  border: 1px solid #2f5597;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
  background-color: #ffffff;
}

.cal-side-card-title {
  background-color: #2f5597;
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
  padding: 5px 10px;
  letter-spacing: 0.2px;
}

.cal-side-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 6px 8px;
  gap: 4px 6px;
  font-size: 12px;
}

.cal-side-card-grid a {
  color: #0844a4;
  text-decoration: none;
  padding: 2px 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-side-card-grid a:hover {
  text-decoration: underline;
}

.cal-side-card-grid a.active-link {
  font-weight: bold;
  color: #000000;
}

.cal-side-card-footer {
  border-top: 1px solid #e0e0e0;
  background-color: #f7f9fa;
  padding: 5px 8px;
  font-size: 11.5px;
  color: #444444;
  text-align: center;
}

.cal-side-card-footer a {
  color: #0844a4;
  text-decoration: none;
  margin: 0 2px;
}

.cal-side-card-footer a:hover {
  text-decoration: underline;
}

/* Modals */
.cal-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 15px;
}

.cal-modal-card {
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cal-modal-header {
  background-color: #003366;
  color: #ffffff;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cal-modal-title {
  font-size: 16px;
  font-weight: bold;
  margin: 0;
}

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

.cal-modal-body {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
  font-size: 13px;
}

.cal-modal-footer {
  padding: 10px 14px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.cal-saved-item {
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  padding: 10px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cal-saved-meta {
  font-size: 11px;
  color: #64748b;
}

.cal-saved-main {
  font-weight: bold;
  color: #2e7d32;
  font-size: 14px;
}

.cal-saved-item-actions {
  display: flex;
  gap: 6px;
}

.cal-btn-load-saved {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 2px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: bold;
  cursor: pointer;
}

.cal-btn-del-saved {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 2px;
  padding: 3px 8px;
  font-size: 11.5px;
  cursor: pointer;
}

.cal-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  z-index: 10000;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
  pointer-events: none;
}

.cal-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* SEO / AEO / GEO Section Styling */
.calc-seo-section {
  margin-top: 35px;
  padding-top: 25px;
  border-top: 1px solid #d0dbe5;
  color: #2d3748;
  font-size: 14px;
  line-height: 1.65;
}

.calc-seo-section h2 {
  font-size: 21px;
  color: #003366;
  margin: 24px 0 10px 0;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 5px;
}

.calc-seo-section h3 {
  font-size: 16.5px;
  color: #1e3a8a;
  margin: 18px 0 8px 0;
}

.calc-seo-section p {
  margin: 0 0 12px 0;
}

.seo-formula-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #003366;
  border-radius: 3px;
  padding: 12px 14px;
  margin: 14px 0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  color: #1e293b;
}

.seo-aeo-card {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 12px 16px;
  margin: 12px 0;
}

.seo-aeo-card .aeo-q {
  font-weight: bold;
  color: #003366;
  font-size: 14.5px;
  margin-bottom: 6px;
}

.seo-aeo-card .aeo-a {
  color: #334155;
  font-size: 13.5px;
  line-height: 1.55;
}

.geo-insight-box {
  background: #fefce8;
  border: 1px solid #fef08a;
  border-left: 4px solid #eab308;
  border-radius: 3px;
  padding: 12px 16px;
  margin: 14px 0;
}

.geo-insight-box .geo-title {
  font-weight: bold;
  color: #854d0e;
  margin-bottom: 4px;
}

.seo-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 16px 0;
}

.seo-summary-table th,
.seo-summary-table td {
  border: 1px solid #cbd5e1;
  padding: 8px 10px;
  text-align: left;
}

.seo-summary-table th {
  background: #f1f5f9;
  font-weight: bold;
  color: #003366;
}

.seo-summary-table tr:nth-child(even) {
  background: #f8fafc;
}

/* RTL Support for Arabic */
[dir="rtl"] .cal-top-bar,
[dir="rtl"] .cal-breadcrumbs,
[dir="rtl"] .cal-input-col,
[dir="rtl"] .cal-converter-row,
[dir="rtl"] .cal-btn-row,
[dir="rtl"] .cal-goals-table th,
[dir="rtl"] .cal-goals-table td,
[dir="rtl"] .seo-summary-table th,
[dir="rtl"] .seo-summary-table td {
  text-align: right;
}

[dir="rtl"] .cal-tab {
  margin-right: 0;
  margin-left: 2px;
  border-radius: 3px 3px 0 0;
}

[dir="rtl"] .cal-maintain-card {
  border-left: 1px solid #c8e6c9;
  border-right: 5px solid #2e7d32;
}

[dir="rtl"] .seo-formula-box,
[dir="rtl"] .geo-insight-box {
  border-left: 1px solid #cbd5e1;
  border-right: 4px solid #003366;
}

[dir="rtl"] .cal-notes-list {
  padding-left: 0;
  padding-right: 18px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .cal-main-grid {
    flex-direction: column;
  }
  .cal-sidebar-col {
    width: 100%;
  }
  .cal-calc-row {
    flex-direction: column;
  }
  .cal-form-container {
    width: 100%;
  }
  .cal-results-box {
    width: 100%;
  }
}

@media print {
  /* Print Modal view */
  body.cal-printing-modal .site-header,
  body.cal-printing-modal .site-footer,
  body.cal-printing-modal .cal-sidebar-col,
  body.cal-printing-modal .cal-top-actions,
  body.cal-printing-modal .cal-btn-row,
  body.cal-printing-modal .cal-converter-section,
  body.cal-printing-modal .cal-main-grid,
  body.cal-printing-modal .cal-toast,
  body.cal-printing-modal #cal-saved-modal,
  body.cal-printing-modal .cal-modal-header,
  body.cal-printing-modal .cal-modal-footer {
    display: none !important;
  }

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

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

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

  /* Default page print */
  .site-header,
  .site-footer,
  .cal-sidebar-col,
  .cal-top-actions,
  .cal-btn-row,
  .cal-converter-section,
  .cal-modal-backdrop,
  .cal-toast {
    display: none !important;
  }
  .cal-main-grid {
    display: block !important;
  }
  .cal-page-container {
    max-width: 100% !important;
    padding: 0 !important;
  }
  .cal-results-box {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}
