/* IBKR Sentiment Widget Styles */

* {
  box-sizing: border-box;
}

body {
  background-color: #f8f9fa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 0;
}

.sentiment-widget {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 20px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* ====== Header ====== */
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.header-title {
  font-size: 24px;
  font-weight: 500;
  color: #333;
}

.chevron {
  color: #ccc;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.chevron svg {
  width: 24px;
  height: 24px;
}

/* ====== Sub Header ====== */
.sub-header {
  display: flex;
  align-items: center;
  color: #888;
  font-size: 14px;
  margin-bottom: 15px;
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 10px;
}

.sub-header-col {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.ticker-name {
  font-weight: 500;
  color: #333;
}

.dot {
  height: 8px;
  width: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-blue {
  background-color: #0d6efd;
}

.dot-gray {
  background-color: #ccc;
}

/* ====== Data Row ====== */
.data-row {
  display: flex;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #f0f0f0;
}

.label-col {
  flex: 1;
  min-width: 150px;
}

.label-main {
  font-size: 16px;
  font-weight: 400;
  color: #333;
  margin-bottom: 3px;
}

.label-sub {
  font-size: 13px;
  color: #888;
}

.value-col {
  flex: 0 0 auto;
  text-align: right;
  min-width: 90px;
  padding: 0 15px;
}

.value-main {
  font-size: 16px;
  font-weight: 400;
  color: #333;
  margin-bottom: 2px;
}

.value-sub {
  font-size: 13px;
  font-weight: 400;
}

.text-up {
  color: #28a745;
}

.text-down {
  color: #dc3545;
}

.data-row--last {
  border-bottom: none;
}


.footer-box {
  margin-top: 20px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
}

.footer-label-main {
  font-size: 18px;
  font-weight: 400;
  color: #333;
  margin-bottom: 2px;
}

.footer-label-sub {
  font-size: 14px;
  color: #888;
}

.text-end {
  text-align: right;
}

.footer-value-main {
  font-size: 18px;
  font-weight: 400;
  color: #333;
  margin-bottom: 3px;
}

.footer-value-sub {
  font-size: 14px;
  font-weight: 500;
}

/* ====== Bar Chart ====== */
.chart-col {
  flex: 0 0 auto;
  width: 50px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  padding-left: 8px;
}

.bar-container {
  width: 12px;
  height: 35px;
  background-color: #e0e0e0;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  width: 100%;
  border-radius: 3px;
  transition: height 0.4s ease;
}

.bar-fill-blue {
  background-color: #0d6efd;
}

.bar-fill-gray {
  background-color: #adb5bd;
}

/* ====== Error Message ====== */
.error-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: #666;
  font-size: 14px;
  text-align: center;
  padding: 20px;
  border: 1px solid #e3dcdc;
  border-radius: 8px;
  background: #fff;
}

.error-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

.error-text {
  max-width: 300px;
  line-height: 1.5;
}

/* ====== Skeleton Loader ====== */
.widget-skeleton {
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton {
  background: #e9ecef;
  border-radius: 6px;
  margin-bottom: 12px;
}

.skeleton-header {
  height: 30px;
  margin-bottom: 20px;
}

.skeleton-row {
  height: 60px;
  margin-bottom: 15px;
}

.skeleton-footer {
  height: 80px;
  border-radius: 12px;
}

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

/* ====== Responsive ====== */
@media (max-width: 500px) {
  .sentiment-widget {
    padding: 14px 12px;
  }

  .header-title {
    font-size: 18px;
  }

  /* Keep sub-header as a row matching data-row columns */
  .sub-header {
    font-size: 12px;
  }

  .sub-header .label-col {
    font-size: 12px;
  }

  .sub-header-col {
    gap: 4px;
  }

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

  .label-main {
    font-size: 14px;
  }

  .label-sub {
    font-size: 11px;
  }

  .value-col {
    min-width: 60px;
    padding: 0 6px;
  }

  .value-main {
    font-size: 13px;
  }

  .value-sub {
    font-size: 11px;
  }

  .chart-col {
    width: 38px;
    gap: 3px;
    padding-left: 4px;
  }

  .data-row {
    padding: 12px 0;
  }

  .footer-box {
    padding: 12px;
  }

  .footer-label-main {
    font-size: 15px;
  }

  .footer-label-sub {
    font-size: 12px;
  }

  .footer-value-main {
    font-size: 15px;
  }

  .footer-value-sub {
    font-size: 12px;
  }
}

@media (max-width: 360px) {
  .sentiment-widget {
    padding: 10px 10px;
  }

  .header-title {
    font-size: 16px;
  }

  .label-main {
    font-size: 13px;
  }

  .label-sub {
    font-size: 10px;
  }

  .value-col {
    min-width: 52px;
    padding: 0 4px;
  }

  .value-main {
    font-size: 12px;
  }

  .value-sub {
    font-size: 10px;
  }

  .chart-col {
    width: 30px;
    gap: 2px;
    padding-left: 2px;
  }

  .bar-container {
    width: 10px;
    height: 28px;
  }

  .footer-label-main,
  .footer-value-main {
    font-size: 14px;
  }
}
