/* ============================================================
   MPG Calculator - How Do I Calculate My MPG?
   Scenic IT Solutions Styling
   ============================================================ */

.mpg-calc-wrap {
  width: 100%;
  color: #f1f1f5;
  font-family: 'Ubuntu', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Tabs Navigation */
.mpg-nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(18, 18, 24, 0.95);
  border: 1px solid #2a2a38;
  padding: 10px;
  border-radius: 14px;
  margin-bottom: 28px;
  position: relative;
  z-index: 2;
}

.mpg-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: #9d9db5;
  border: 1px solid transparent;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.mpg-tab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.mpg-tab-btn.active {
  background: linear-gradient(135deg, rgba(246, 139, 31, 0.15) 0%, rgba(2, 120, 168, 0.2) 100%);
  color: #F68B1F;
  border-color: rgba(246, 139, 31, 0.4);
  box-shadow: 0 4px 15px rgba(246, 139, 31, 0.15);
  font-weight: 600;
}

.mpg-tab-icon {
  font-size: 16px;
}

/* Two-column layout */
.mpg-grid-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 28px;
  align-items: start;
  margin-bottom: 40px;
}

@media (max-width: 1024px) {
  .mpg-grid-layout {
    grid-template-columns: 1fr;
  }
}

/* Main Input Card */
.mpg-card {
  background: rgba(15, 15, 20, 0.95);
  border: 1px solid #262635;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  position: relative;
}

.mpg-card-header {
  border-bottom: 1px solid #232332;
  padding-bottom: 16px;
  margin-bottom: 22px;
}

.mpg-card-title {
  font-size: 22px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mpg-card-subtitle {
  font-size: 14px;
  color: #8c8ca1;
  margin: 0;
  line-height: 1.5;
}

/* Form Groups & Inputs */
.mpg-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

@media (max-width: 600px) {
  .mpg-form-row {
    grid-template-columns: 1fr;
  }
}

.mpg-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}

.mpg-field label {
  font-size: 13.5px;
  font-weight: 600;
  color: #d1d1e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mpg-field-hint {
  font-size: 11.5px;
  color: #7d7d92;
  font-weight: 400;
}

.mpg-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.mpg-input-prefix,
.mpg-input-suffix {
  position: absolute;
  font-size: 13px;
  font-weight: 600;
  color: #0099E5;
  pointer-events: none;
  z-index: 1;
}

.mpg-input-prefix {
  left: 14px;
}

.mpg-input-suffix {
  right: 14px;
  color: #8888a0;
}

.mpg-input {
  width: 100%;
  background: #111118;
  border: 1.5px solid #282838;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  outline: none;
  transition: all 0.25s ease;
  font-family: inherit;
}

.mpg-input:focus {
  border-color: #0099E5;
  background: #151520;
  box-shadow: 0 0 0 3px rgba(0, 153, 229, 0.15);
}

.mpg-input.has-prefix {
  padding-left: 32px;
}

.mpg-input.has-suffix {
  padding-right: 58px;
}

.mpg-helper-text {
  font-size: 11.5px;
  color: #7b7b90;
  margin-top: 3px;
}

/* Quick Fill Buttons */
.mpg-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.mpg-preset-btn {
  background: #1b1b26;
  border: 1px solid #2d2d3e;
  color: #a5a5bc;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.mpg-preset-btn:hover {
  background: #252535;
  color: #F68B1F;
  border-color: #F68B1F;
}

/* Action Buttons */
.mpg-actions-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #222230;
}

.mpg-btn-primary {
  background: linear-gradient(135deg, #F68B1F 0%, #d87311 100%);
  color: #000000;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(246, 139, 31, 0.3);
}

.mpg-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(246, 139, 31, 0.45);
  background: linear-gradient(135deg, #ff9838 0%, #e67c15 100%);
}

.mpg-btn-secondary {
  background: #1a1a24;
  color: #c5c5db;
  border: 1px solid #2e2e42;
  font-weight: 600;
  font-size: 13.5px;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.mpg-btn-secondary:hover {
  background: #232332;
  color: #ffffff;
  border-color: #404058;
}

/* Sticky Results Sidebar */
.mpg-sidebar {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mpg-result-card {
  background: linear-gradient(180deg, #151622 0%, #0e0f17 100%);
  border: 1px solid #2e3046;
  border-radius: 18px;
  padding: 26px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
}

.mpg-result-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #F68B1F 0%, #0099E5 100%);
}

.mpg-result-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  color: #0099E5;
  background: rgba(0, 153, 229, 0.12);
  border: 1px solid rgba(0, 153, 229, 0.3);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.mpg-score-hero {
  text-align: center;
  padding: 10px 0 20px 0;
  border-bottom: 1px solid #232435;
}

.mpg-score-value {
  font-size: 56px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
  letter-spacing: -1px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}

.mpg-score-value span.mpg-val {
  background: linear-gradient(135deg, #ffffff 0%, #F68B1F 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.mpg-score-unit {
  font-size: 20px;
  font-weight: 600;
  color: #0099E5;
  letter-spacing: 0;
}

.mpg-rating-tag {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.rating-excellent {
  background: rgba(0, 255, 170, 0.15);
  color: #00ffaa;
  border: 1px solid rgba(0, 255, 170, 0.3);
}

.rating-good {
  background: rgba(0, 153, 229, 0.15);
  color: #0099E5;
  border: 1px solid rgba(0, 153, 229, 0.3);
}

.rating-average {
  background: rgba(246, 139, 31, 0.15);
  color: #F68B1F;
  border: 1px solid rgba(246, 139, 31, 0.3);
}

.rating-low {
  background: rgba(255, 77, 77, 0.15);
  color: #ff5555;
  border: 1px solid rgba(255, 77, 77, 0.3);
}

/* Fuel Economy Meter Bar */
.mpg-meter-wrap {
  margin: 18px 0;
}

.mpg-meter-bar {
  width: 100%;
  height: 8px;
  background: #1d1e2b;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.mpg-meter-fill {
  height: 100%;
  width: 50%;
  background: linear-gradient(90deg, #ff5555 0%, #F68B1F 35%, #0099E5 70%, #00ffaa 100%);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.mpg-meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #6d6d84;
  margin-top: 5px;
}

/* Key Metrics Grid */
.mpg-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
}

.mpg-stat-box {
  background: #111119;
  border: 1px solid #232332;
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.mpg-stat-label {
  font-size: 11px;
  font-weight: 500;
  color: #8c8ca4;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mpg-stat-val {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
}

.mpg-stat-sub {
  font-size: 10.5px;
  color: #5c5c72;
  margin-top: 2px;
}

/* Secondary Conversions List */
.mpg-conv-list {
  background: #12131b;
  border: 1px solid #222330;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 14px;
}

.mpg-conv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  padding: 6px 0;
  border-bottom: 1px solid #1a1a24;
}

.mpg-conv-row:last-child {
  border-bottom: none;
}

.mpg-conv-name {
  color: #88889c;
}

.mpg-conv-num {
  font-weight: 700;
  color: #0099E5;
}

/* Multi-Tank Log Table */
.mpg-table-container {
  overflow-x: auto;
  margin-top: 16px;
  border-radius: 10px;
  border: 1px solid #262638;
}

.mpg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.mpg-table th {
  background: #141520;
  color: #a4a4be;
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid #28283c;
}

.mpg-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #1f1f2d;
  color: #ddd;
}

.mpg-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.mpg-btn-delete {
  background: rgba(255, 77, 77, 0.15);
  color: #ff5555;
  border: 1px solid rgba(255, 77, 77, 0.3);
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
}

.mpg-btn-delete:hover {
  background: #ff5555;
  color: #fff;
}

/* Formula Callout Banner */
.mpg-formula-box {
  background: linear-gradient(135deg, rgba(2, 120, 168, 0.12) 0%, rgba(246, 139, 31, 0.08) 100%);
  border: 1px solid rgba(0, 153, 229, 0.3);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.mpg-formula-icon {
  font-size: 32px;
}

.mpg-formula-text {
  flex: 1;
}

.mpg-formula-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #0099E5;
  font-weight: 700;
  margin-bottom: 4px;
}

.mpg-formula-math {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.mpg-formula-math code {
  color: #F68B1F;
  background: rgba(0,0,0,0.3);
  padding: 2px 8px;
  border-radius: 6px;
}

/* Step-by-Step Educational Cards */
.mpg-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.mpg-step-card {
  background: #14141d;
  border: 1px solid #252535;
  border-radius: 14px;
  padding: 22px;
  position: relative;
  transition: transform 0.25s, border-color 0.25s;
}

.mpg-step-card:hover {
  transform: translateY(-3px);
  border-color: #3b3b55;
}

.mpg-step-badge {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #F68B1F 0%, #0099E5 100%);
  color: #000;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 14px;
}

.mpg-step-card h3 {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 8px 0;
}

.mpg-step-card p {
  font-size: 13.5px;
  color: #9292a8;
  line-height: 1.6;
  margin: 0;
}

/* Comparison Bar Chart Visuals */
.mpg-compare-bar-group {
  margin-bottom: 16px;
}

.mpg-compare-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: #ddd;
  margin-bottom: 6px;
}

.mpg-compare-track {
  width: 100%;
  height: 22px;
  background: #1a1a26;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.mpg-compare-fill-a {
  height: 100%;
  background: linear-gradient(90deg, #ff5555, #F68B1F);
  border-radius: 8px;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-size: 11px;
  font-weight: 700;
  color: #000;
}

.mpg-compare-fill-b {
  height: 100%;
  background: linear-gradient(90deg, #0099E5, #00ffaa);
  border-radius: 8px;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-size: 11px;
  font-weight: 700;
  color: #000;
}

/* Toast Message */
.mpg-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #1c1d29;
  border: 1px solid #F68B1F;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

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