:root {
  --bg-primary: #e0e0e0;
  --bg-secondary: #f0f0f0;
  --text-primary: #2d3748;
  --text-secondary: #718096;
  --lcd-bg: #1e293b;
  --lcd-text: #34d399; /* Emerald glow */
  --accent-blue: #3b82f6;
  --accent-pink: #ec4899;
  
  --shadow-dark: #bebebe;
  --shadow-light: #ffffff;
  
  --font-family: 'Outfit', sans-serif;
  --font-family-mono: 'Roboto Mono', monospace;
  --header-height: 100px;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* App Container */
.calc-app {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

/* Header & Tabs */
.app-header {
  height: var(--header-height);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.header-logo-row h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.nav-scroller {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
}

.nav-scroller::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  background: var(--bg-primary);
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
  transition: all 0.2s ease;
}

.nav-tab.active {
  color: var(--accent-blue);
  box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
}

/* Viewport and views */
.app-viewport {
  flex-grow: 1;
  position: relative;
  overflow: hidden;
}

.calc-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: opacity 0.2s ease;
}

.calc-view.active {
  opacity: 1;
  pointer-events: auto;
}

/* 1. LCD display Screen */
.lcd-screen-container {
  background: var(--lcd-bg);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  height: 110px;
  box-shadow: inset 4px 4px 8px rgba(0,0,0,0.6), 2px 2px 5px var(--shadow-light);
  border: 1px solid rgba(255,255,255,0.05);
}

.lcd-history {
  font-family: var(--font-family-mono);
  font-size: 13px;
  color: var(--text-secondary);
  height: 18px;
  overflow: hidden;
}

.lcd-main {
  font-family: var(--font-family-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--lcd-text);
  text-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
}

/* Standard keys grid */
.keys-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  flex-grow: 1;
  max-height: 380px;
}

.key-btn {
  background: var(--bg-primary);
  border: none;
  font-family: var(--font-family);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light);
  transition: all 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.key-btn:active {
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
  transform: scale(0.98);
}

.action-key {
  color: var(--accent-pink);
}

.operator-key {
  color: var(--accent-blue);
}

.equals-key {
  background: var(--accent-blue);
  color: #ffffff;
  box-shadow: 4px 4px 8px rgba(59, 130, 246, 0.3), -4px -4px 8px var(--shadow-light);
}

.equals-key:active {
  box-shadow: inset 3px 3px 6px rgba(0,0,0,0.2);
}

/* Investment Finance Panel */
.finance-container, .converter-container, .timezone-container, .fields-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.finance-container h3, .converter-container h3, .timezone-container h3, .fields-container h3 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.input-group input {
  background: var(--bg-primary);
  border: none;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  outline: none;
  box-shadow: inset 2px 2px 5px var(--shadow-dark), inset -2px -2px 5px var(--shadow-light);
}

.action-btn {
  width: 100%;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 4px 4px 8px rgba(59, 130, 246, 0.3), -4px -4px 8px var(--shadow-light);
  transition: all 0.2s;
}

.action-btn:active {
  box-shadow: inset 3px 3px 6px rgba(0,0,0,0.2);
  transform: scale(0.98);
}

.results-box {
  background: var(--bg-primary);
  border-radius: 14px;
  padding: 14px;
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.res-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.highlight-val {
  color: var(--accent-blue);
  font-size: 15px;
  font-weight: 800;
}

.chart-box {
  width: 100%;
  background: var(--bg-primary);
  border-radius: 10px;
  margin-top: 10px;
  box-shadow: 2px 2px 5px var(--shadow-dark);
  padding: 8px;
}

/* Converter Styles */
.category-tabs {
  display: flex;
  gap: 8px;
}

.cat-tab, .shape-tab {
  flex-grow: 1;
  background: var(--bg-primary);
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 700;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 2px 2px 4px var(--shadow-dark), -2px -2px 4px var(--shadow-light);
}

.cat-tab.active, .shape-tab.active {
  color: var(--accent-blue);
  box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
}

.converter-box {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 16px;
  box-shadow: inset 3px 3px 6px var(--shadow-dark), inset -3px -3px 6px var(--shadow-light);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.conv-input-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.conv-input-row input {
  flex-grow: 1;
  background: var(--bg-primary);
  border: none;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 8px;
  outline: none;
  box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
  font-family: var(--font-family-mono);
}

.conv-input-row select {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: none;
  border-radius: 8px;
  padding: 6px;
  font-family: var(--font-family);
  font-weight: 700;
  box-shadow: 2px 2px 4px var(--shadow-dark), -2px -2px 4px var(--shadow-light);
  outline: none;
}

.conv-arrow {
  text-align: center;
  font-size: 14px;
}

/* Timezone Slider Timeline */
.timeline-slider-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-primary);
  padding: 14px;
  border-radius: 12px;
  box-shadow: inset 2px 2px 4px var(--shadow-dark), inset -2px -2px 4px var(--shadow-light);
}

.timeline-slider-box input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #cbd5e1;
  border-radius: 3px;
  outline: none;
}

.timeline-slider-box input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-blue);
  cursor: pointer;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.zone-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.zone-card {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 3px 3px 6px var(--shadow-dark), -3px -3px 6px var(--shadow-light);
}

.zone-info {
  display: flex;
  flex-direction: column;
}

.zone-info strong {
  font-size: 13px;
}

.zone-info span {
  font-size: 10px;
  color: var(--text-secondary);
}

.zone-time {
  font-family: var(--font-family-mono);
  font-weight: 700;
  color: var(--accent-blue);
}

.shape-inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shape-tabs {
  display: flex;
  gap: 8px;
}
