@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "JetBrains Mono", monospace;
  background: #0a0a0a;
  color: #00ff41;
  min-height: 100vh;
  padding: 15px;
  font-size: 13px;
  line-height: 1.4;
}

.terminal-header {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px 8px 0 0;
  padding: 8px 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  max-width: 1400px;
  margin: 0 auto;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red {
  background: #ff5f56;
}
.dot.yellow {
  background: #ffbd2e;
}
.dot.green {
  background: #27ca3f;
}

.terminal-title {
  color: #888;
  font-size: 12px;
  margin-left: 10px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: #0a0a0a;
  border: 1px solid #333;
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 20px;
  min-height: calc(100vh - 60px);
}

.header {
  margin-bottom: 30px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 15px);
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.brand-logo {
  width: clamp(30px, 5vw, 40px);
  height: clamp(30px, 5vw, 40px);
  flex-shrink: 0;
}

.title {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 600;
  color: #fff;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
}

.subtitle {
  font-size: clamp(11px, 2vw, 13px);
  color: #666;
  margin-bottom: 8px;
  font-weight: 300;
}

.correlation {
  font-size: 11px;
  color: #666;
}

.input-section {
  background: #111;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 25px;
}

.input-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}

@media (min-width: 768px) {
  .input-grid {
    grid-template-columns: 2fr auto auto auto;
    gap: 15px;
    align-items: start;
  }
}

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

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

.input-field {
  background: #000;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 10px 12px;
  color: #00ff41;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  transition: all 0.2s ease;
}

.input-field:focus {
  outline: none;
  border-color: #00ff41;
  box-shadow: 0 0 0 1px #00ff41;
}

.input-field::placeholder {
  color: #444;
}

.btn {
  background: #000;
  border: 1px solid #00ff41;
  color: #00ff41;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.2s ease;
  height: 38px;
  align-self: center;
}

.btn:hover:not(:disabled) {
  background: #00ff41;
  color: #000;
}

.btn:disabled {
  border-color: #333;
  color: #333;
  cursor: not-allowed;
}

.loading {
  display: none;
  text-align: center;
  padding: 40px;
  color: #00ff41;
  font-size: 12px;
}

.loading-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #333;
  border-top: 2px solid #00ff41;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  text-align: left;
}

.loading-text p {
  margin: 0;
  line-height: 1.4;
}

.loading-subtext {
  color: #666 !important;
  font-size: 10px !important;
  margin-top: 4px;
  animation: pulse 2s ease-in-out infinite;
}

.loading-progress {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  background: #222;
  border-radius: 10px;
  overflow: hidden;
  height: 6px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #00ff41, #00aa2a);
  border-radius: 10px;
  width: 0%;
  transition: width 0.3s ease;
  animation: progressGlow 2s ease-in-out infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

@keyframes progressGlow {
  0%,
  100% {
    box-shadow: 0 0 5px rgba(0, 255, 65, 0.3);
  }
  50% {
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.6);
  }
}

.error {
  display: none;
  background: #1a0000;
  border: 1px solid #ff0000;
  color: #ff6666;
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 20px;
  font-size: 11px;
}

.section {
  margin-bottom: 30px;
}

.section-title {
  color: #888;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
  font-weight: 500;
}

.metrics-container {
  display: block;
  margin-bottom: 30px;
}

.metrics-panel {
  background: #111;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 30px;
  position: relative;
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
}

.metric-item {
  background: #000;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 15px;
  text-align: center;
}

.metric-value {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 5px;
}

.metric-label {
  color: #888;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chart-section {
  background: #111;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 25px;
  position: relative;
}

.chart-row {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

.chart-half {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .chart-row {
    flex-direction: column;
    gap: 20px;
  }

  .chart-half {
    margin-bottom: 25px;
  }

  .chart-half:last-child {
    margin-bottom: 0;
  }
}

.chart-title {
  color: #888;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
  font-weight: 500;
}

.chart-container {
  background: #000;
  border: 1px solid #222;
  border-radius: 4px;
  padding: 5px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  background: #111;
  border: 1px solid #333;
  border-radius: 6px;
}

.empty-title {
  color: #fff;
  font-size: 16px;
  margin-bottom: 10px;
}

.empty-subtitle {
  font-size: 12px;
  margin-bottom: 20px;
}

.example-code {
  background: #000;
  border: 1px solid #333;
  padding: 10px 15px;
  border-radius: 4px;
  display: inline-block;
  color: #00ff41;
  font-size: 11px;
  margin: 10px 0;
}

.results-section {
  display: none;
}

/* Tweet Button Styles */
.tweet-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #ffffff;
  color: #000000;
  border: 1px solid #fff;
  border-radius: 4px;
  padding: 6px 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 10;
  opacity: 0.9;
  min-height: 32px;
}

.tweet-btn:hover {
  background: #ffffff;
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
}

.tweet-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(255, 255, 255, 0.2);
}

.tweet-btn svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

/* Slider Panel Styles */
.slider-title {
  color: #888;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.slider-subtitle {
  color: #666;
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 300;
}

#mainSliderContainer {
  margin-bottom: 20px;
}

.slider-item {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  padding: 15px;
  background: #000;
  border: 1px solid #222;
  border-radius: 4px;
  gap: 15px;
}

.slider-item:last-child {
  margin-bottom: 0;
}

.slider-label {
  color: #00ff41;
  font-size: 12px;
  font-weight: 600;
  min-width: 80px;
  flex-shrink: 0;
}

.slider-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider-input {
  flex: 1;
  height: 6px;
  background: #333;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #00ff41;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
}

.slider-input::-webkit-slider-thumb:hover {
  background: #00aa2a;
  transform: scale(1.1);
}

.slider-input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #00ff41;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.slider-input::-moz-range-thumb:hover {
  background: #00aa2a;
  transform: scale(1.1);
}

.slider-value {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  min-width: 50px;
  text-align: right;
}

.slider-controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
  align-items: center;
}

.preset-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.preset-btn {
  background: #000;
  border: 1px solid #333;
  color: #888;
  padding: 12px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 120px;
  text-align: center;
}

.preset-btn:hover {
  border-color: #00ff41;
  color: #00ff41;
  background: #111;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 255, 65, 0.2);
}

.preset-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 255, 65, 0.2);
}

.preset-details {
  font-size: 9px;
  color: #666;
  font-weight: 400;
  margin-top: 2px;
}

.preset-btn:hover .preset-details {
  color: #00aa2a;
}

.slider-metrics {
  background: #000;
  border: 1px solid #222;
  border-radius: 4px;
  padding: 15px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 15px;
}

.slider-metric {
  text-align: center;
}

.slider-metric-value {
  color: #00ff41;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
}

.slider-metric-label {
  color: #666;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  body {
    padding: 8px;
  }
  .container {
    padding: 12px;
  }
  .input-section {
    padding: 15px;
  }
  .metrics-panel,
  .chart-section {
    padding: 15px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .slider-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .slider-wrapper {
    flex-direction: column;
    gap: 8px;
  }

  .slider-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .preset-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .preset-btn {
    min-width: auto;
    padding: 10px 14px;
  }

  .slider-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* Enhanced mobile chart responsiveness */
  .chart-container {
    overflow-x: auto;
  }

  /* Better touch targets for mobile */
  .btn {
    min-height: 44px;
    padding: 12px 20px;
  }

  .input-field {
    min-height: 44px;
  }

  .slider-input {
    height: 8px;
  }

  .slider-input::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
  }

  .slider-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }

  /* Tweet button mobile positioning */
  .tweet-btn {
    position: static;
    margin-bottom: 10px;
    align-self: flex-start;
  }

  .metrics-panel,
  .chart-section {
    display: flex;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  body {
    padding: 5px;
    font-size: 12px;
  }

  .container {
    padding: 10px;
    border-radius: 0 0 6px 6px;
  }

  .terminal-header {
    padding: 6px 12px;
    flex-wrap: wrap;
  }

  .terminal-title {
    font-size: 10px;
  }

  .title {
    font-size: 16px;
  }

  .subtitle {
    font-size: 10px;
  }

  .input-section,
  .metrics-panel,
  .chart-section {
    padding: 12px;
  }

  .btn {
    padding: 12px 16px;
    font-size: 11px;
    min-height: 44px;
  }

  .input-field {
    padding: 12px 10px;
    font-size: 16px; /* Prevent zoom on iOS */
    min-height: 44px;
  }

  .metric-value {
    font-size: 14px;
  }

  .metric-label {
    font-size: 9px;
  }

  .slider-item {
    padding: 12px;
  }

  .preset-buttons {
    gap: 6px;
  }

  .preset-btn {
    padding: 12px;
    font-size: 10px;
    min-height: 44px;
  }

  .preset-details {
    font-size: 8px;
  }

  .slider-metrics {
    grid-template-columns: 1fr;
  }

  /* Enhanced small screen optimizations */
  .header-brand {
    justify-content: center;
    text-align: center;
  }

  .empty-state {
    padding: 40px 15px;
  }

  .loading-content {
    flex-direction: column;
    gap: 10px;
  }

  .chart-container {
    min-height: 250px;
  }

  /* Improve readability on small screens */
  .section-title,
  .chart-title {
    font-size: 10px;
  }

  .slider-title {
    font-size: 10px;
    text-align: center;
  }

  .slider-subtitle {
    font-size: 9px;
    text-align: center;
  }
}

/* Large screen optimizations */
@media (min-width: 1400px) {
  .container {
    max-width: 1600px;
  }

  .terminal-header {
    max-width: 1600px;
  }

  .chart-row {
    gap: 30px;
  }

  .metrics-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
  .preset-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .preset-btn {
    flex: 1;
    min-width: 120px;
    max-width: 150px;
  }

  .slider-metrics {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .slider-input::-webkit-slider-thumb {
    border: 1px solid #000;
  }

  .dot {
    border: 0.5px solid rgba(255, 255, 255, 0.1);
  }
}
