/**
 * FleetCalc Pro - Cockpit Theme CSS
 * High-end Dark Automotive Cockpit aesthetic by Intrace Engineering.
 */

:root {
  --bg-cockpit: #0c0f14;
  --chassis-top: #cfd4dc;
  --chassis-metal-dark: #8b929e;
  --chassis-body: #161a22;
  --panel-carbon: #11141a;
  
  /* Key Colors (Intrace Cockpit Scheme) */
  --key-light-bg: #e1e4ea;
  --key-light-border: #b8bdc7;
  --key-light-text: #11141a;
  --key-light-shadow: #8f96a3;

  --key-dark-bg: #1c212b;
  --key-dark-border: #2d3545;
  --key-dark-text: #f0f3f8;
  --key-dark-shadow: #0a0d12;

  --key-accent-amber: #e65100;
  --key-accent-exe: #ff8f00;
  --key-cyan: #00e5ff;
  --key-status-green: #00e676;

  /* LCD Display */
  --lcd-bg: #8c9c82;
  --lcd-bg-dark: #121915;
  --lcd-text: #0f160e;
  --lcd-glow: rgba(15, 22, 14, 0.15);

  --font-lcd: 'Courier New', 'Consolas', 'Lucida Console', monospace;
  --font-ui: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg-cockpit);
  color: #f0f3f8;
  font-family: var(--font-ui);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 8px;
  touch-action: manipulation;
  user-select: none;
}

/* Carbon fiber background texture */
body {
  background-image: 
    radial-gradient(circle at 50% 0%, #1c2333 0%, transparent 70%),
    linear-gradient(27deg, #101319 5px, transparent 5px) 0 5px,
    linear-gradient(207deg, #101319 5px, transparent 5px) 10px 0px,
    linear-gradient(27deg, #171b24 5px, transparent 5px) 0px 10px,
    linear-gradient(207deg, #171b24 5px, transparent 5px) 10px 5px,
    linear-gradient(90deg, #0e1117 10px, transparent 10px),
    linear-gradient(#0c0f14 25%, #080a0e 25%, #080a0e 50%, #0c0f14 50%, #0c0f14 75%, #080a0e 75%, #080a0e 100%);
  background-size: 100% 100%, 20px 20px, 20px 20px, 20px 20px, 20px 20px, 20px 20px, 20px 20px;
}

/* Master Calculator Chassi */
.calc-chassis {
  width: 100%;
  max-width: 980px;
  background: var(--chassis-body);
  border-radius: 14px;
  border: 2px solid #2f3747;
  box-shadow: 
    0 20px 50px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 1px rgba(255, 255, 255, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Brushed Metal Header */
.chassis-header {
  background: linear-gradient(180deg, #e6eaf0 0%, #b8c0cc 45%, #9ea8b6 100%);
  border-bottom: 3px solid #11141a;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: #11141a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 3px 6px rgba(0,0,0,0.4);
}

.header-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  height: 50px;
}

.model-name {
  font-size: 26pt;
  font-weight: 900;
  color: #0d1117;
  letter-spacing: 2px;
  line-height: 1;
  margin: 0;
  padding: 0;
  text-shadow: 0 1px 0 rgba(255,255,255,0.85);
}

.model-name .calc-orange {
  color: #ff6d00;
  font-weight: 900;
}

.model-subtitle {
  color: #c62828;
  font-size: 8pt;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin: 0;
  padding: 0;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255,255,255,0.6);
}

.header-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
}

.header-brand-logos {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 50px;
}

.logo-badge-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  background: #ffffff;
  height: 50px;
  box-sizing: border-box;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.logo-badge-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 119, 182, 0.3), inset 0 0 0 1px #0077b6;
}

.header-brand-logo {
  height: 100%;
  width: auto;
  object-fit: contain;
  display: block;
}

/* Power Switch */
.power-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.power-switch-container {
  display: flex;
  align-items: center;
  background: #1e2430;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid #000;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
  cursor: pointer;
}

.power-switch-slider {
  width: 22px;
  height: 16px;
  background: linear-gradient(180deg, #ff6d00 0%, #d84315 100%);
  border-radius: 2px;
  border: 1px solid #772b00;
  box-shadow: 0 1px 2px rgba(0,0,0,0.5);
  transition: transform 0.2s ease;
}

.power-switch-container.off .power-switch-slider {
  transform: translateX(-14px);
  background: linear-gradient(180deg, #555 0%, #333 100%);
  border-color: #222;
}

.power-label {
  font-size: 7.5pt;
  font-weight: 800;
  color: #ffffff;
  margin-left: 6px;
  letter-spacing: 0.5px;
}

/* Controls row (Lang, Deg/Rad, PDF, Memories) */
.telemetry-bar {
  background: #141820;
  border-bottom: 1px solid #283040;
  padding: 8px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 8.5pt;
}

.telemetry-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.header-help-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #ff9100 0%, #ff6d00 100%);
  color: #0b0e14 !important;
  font-weight: 800;
  font-size: 8.5pt;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(255, 145, 0, 0.35);
  border: 1px solid #ffab40;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.header-help-btn:hover {
  background: linear-gradient(135deg, #ffa726 0%, #ff9100 100%);
  box-shadow: 0 4px 12px rgba(255, 145, 0, 0.55);
  transform: translateY(-1px);
}

.control-select, .control-btn {
  background: #202634;
  color: #f0f3f8;
  border: 1px solid #364157;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 8.5pt;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: background 0.15s, border-color 0.15s;
}

.control-select:hover, .control-btn:hover {
  background: #2b3345;
  border-color: var(--key-cyan);
}

.control-btn.accent {
  background: linear-gradient(180deg, #ff6d00 0%, #e65100 100%);
  border-color: #ff9100;
  color: #fff;
}

/* HUD / LCD Dual Display */
.display-housing {
  background: #090c10;
  padding: 14px 18px;
  border-bottom: 2px solid #222a38;
}

.lcd-screen {
  background: linear-gradient(180deg, #9caea0 0%, #899c8d 100%);
  border: 3px solid #11141a;
  border-radius: 6px;
  box-shadow: 
    inset 0 4px 10px rgba(0, 0, 0, 0.45),
    0 1px 1px rgba(255, 255, 255, 0.1);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Top LCD Indicators */
.lcd-indicators {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-lcd);
  font-size: 8.5pt;
  font-weight: 800;
  color: #2b392e;
  letter-spacing: 1px;
  border-bottom: 1px dashed rgba(43, 57, 46, 0.4);
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.lcd-indicator-tag {
  opacity: 0.25;
}

.lcd-indicator-tag.active {
  opacity: 1;
  color: #0b150c;
  text-shadow: 0 0 1px rgba(0,0,0,0.5);
}

/* Expression Secondary Line */
.lcd-expression {
  font-family: var(--font-lcd);
  font-size: 11pt;
  font-weight: 700;
  color: #1e2b20;
  min-height: 18px;
  text-align: right;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 4px;
}

/* Primary Big Numerical Line */
.lcd-main-value {
  font-family: var(--font-lcd);
  font-size: 26pt;
  font-weight: 900;
  color: #0d160e;
  text-align: right;
  letter-spacing: 1.5px;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

/* Power Off State for LCD */
.calc-chassis.powered-off .lcd-screen {
  background: #141716;
}

.calc-chassis.powered-off .lcd-indicators,
.calc-chassis.powered-off .lcd-expression,
.calc-chassis.powered-off .lcd-main-value {
  visibility: hidden;
}

/* Responsive Tabs for Smartphones */
.mobile-tabs-bar {
  display: none;
  background: #141822;
  border-bottom: 1px solid #283244;
  padding: 6px 12px;
  gap: 6px;
  overflow-x: auto;
}

.mobile-tab-btn {
  flex: 1;
  background: #1f2636;
  color: #b0bac9;
  border: 1px solid #2e384d;
  padding: 8px 10px;
  font-size: 8pt;
  font-weight: 700;
  border-radius: 4px;
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
}

.mobile-tab-btn.active {
  background: var(--key-accent-amber);
  color: #ffffff;
  border-color: #ff9100;
}

@media (max-width: 768px) {
  .mobile-tabs-bar {
    display: flex;
  }
  .chassis-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
  }
  .header-left {
    order: 1;
    height: auto;
  }
  .header-right {
    order: 2;
    gap: 10px;
  }
  .header-brand-logos {
    height: 38px;
    gap: 8px;
  }
  .logo-badge-link {
    height: 38px;
    padding: 2px 4px;
  }
  .model-name {
    font-size: 18pt;
  }
  .model-subtitle {
    font-size: 6.5pt;
  }
  .telemetry-bar {
    padding: 6px 10px;
    gap: 6px;
    justify-content: center;
  }
  .telemetry-group {
    justify-content: center;
    width: 100%;
    gap: 4px;
    flex-wrap: wrap;
  }
  .control-select, .control-btn {
    padding: 3px 6px;
    font-size: 7.5pt;
    height: 28px;
    min-width: 0;
  }
  .header-help-btn {
    padding: 4px 8px;
    font-size: 7.5pt;
  }
}

