/* company.css - fixed and improved */

/* wrapper */
.company {
  margin-top: 24px;
  margin-bottom: 80px;
}

/* hero */
.company-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto; /* allow top row for price */
  gap: 24px;
  align-items: center;
  background: #ffffff;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.1);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.8s ease-out;
}
.company-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4);
}

.company-logo {
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
}

.company-logo img {
  max-width: 100px;
  height: auto;
  object-fit: contain;
  display: block;
}

@media (max-width: 640px) {
  .company-logo {
    justify-content: center;
    margin-bottom: 12px;
  }
  .company-logo img {
    max-width: 80px;
  }
}
.company-headings h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  color: #1e293b;
  line-height: 1.2;
  margin-bottom: 8px;
}
.company-headings .ticker {
  color: #64748b;
  font-weight: 700;
}
.company-tagline {
  color: #64748b;
  margin-bottom: 8px;
}
.company-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #64748b;
  font-size: 14px;
}
.meta-link {
  color: #1e40af;
  text-decoration: none;
  border-bottom: 1px dotted rgba(30, 64, 175, 0.4);
}
.meta-link:hover {
  text-decoration: underline;
}
.meta-dot {
  opacity: 0.6;
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin: 32px 0 40px;
}

.stat-pill {
  background: rgba(59, 130, 246, 0.06);
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-radius: 20px;
  padding: 24px 28px;
  text-align: center;
  box-shadow: 0 10px 28px rgba(59, 130, 246, 0.12);
  transition: transform 0.2s ease;
}
.stat-pill:hover {
  transform: translateY(-3px);
}

.stat-label {
  display: block;
  font-size: 14px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.stat-value {
  display: block;
  font-weight: 800;
  font-size: 28px;
  color: #1e293b;
}

/* make them stand out more */
.big-pill {
  background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
}

/* reusable card */
.card {
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  padding: 24px;
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease-out;
}

.card canvas {
  margin-top: 24px;
}

.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-header h2 {
  font-size: 20px;
  color: #10b981; /* bright green heading like your screenshot */
  font-weight: 800;
}
.card-header .link {
  color: #1e40af;
  text-decoration: none;
  font-weight: 600;
}
.card-header .link:hover {
  text-decoration: underline;
}

/* table - improved readability */
.table-wrap {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 640px; /* allow horizontal scroll on small screens */
}
.table thead th {
  text-align: left;
  color: #1e293b;
  font-weight: 700;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  white-space: nowrap;
}
.table tbody td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(241, 245, 249, 0.8);
  color: #334155;
  vertical-align: middle;
}
.table tbody tr:nth-child(odd) {
  background: rgba(59, 130, 246, 0.02);
}
.table td.amount {
  font-weight: 700;
  color: #0f172a;
} /* emphasize amounts */
.table td.date {
  color: #64748b;
  white-space: nowrap;
}

/* bullets */
.bullets {
  padding-left: 20px;
  color: #334155;
  margin-top: 8px;
}
.bullets li {
  margin: 8px 0;
  line-height: 1.6;
}

/* news section */
.news-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.news-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  padding: 20px 24px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-title {
  font-weight: 700;
  font-size: 15px;
  color: #1e293b;
  margin-bottom: 8px;
  text-decoration: none;
}

.news-title:hover {
  text-decoration: underline;
  color: #2563eb;
}

.news-tickers {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ticker-pill {
  background: rgba(37, 99, 235, 0.08);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  transition: background 0.2s ease;
}

.ticker-pill:hover {
  background: rgba(37, 99, 235, 0.2);
}

@media (max-width: 640px) {
  .company-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .company-meta {
    justify-content: center;
    flex-wrap: wrap;
  }
  .card {
    padding: 18px;
  }
  .table {
    min-width: 520px;
  }
}

a:focus {
  outline: 3px solid rgba(59, 130, 246, 0.18);
  outline-offset: 3px;
}

.dividend-alert {
  background-color: #fff8e1;
  border: 1px solid #fdd835;
  border-left: 5px solid #fbc02d;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  border-radius: 4px;
  font-family: system-ui, sans-serif;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dividend-alert strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
  color: #795548;
}

.dividend-alert p {
  margin: 0;
  font-size: 0.95rem;
  color: #5d4037;
}

#showmore {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.2s ease;
}

#showmore:hover {
  color: #1e40af;
  text-decoration: underline;
}

#showmore:focus {
  outline: none;
  text-decoration: underline;
}

.no-dividends-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 6px solid #ef4444;
  padding: 16px 20px;
  border-radius: 8px;
  margin: 24px 0;
  font-size: 16px;
  font-weight: 600;
  color: #b91c1c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  animation: fadeInUp 0.6s ease-out;
}

.stocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  align-items: stretch;
}

.stock-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.price-change {
  grid-column: 1 / -1; /* span across both columns */
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;

  justify-content: flex-end; /* push it right on desktop */
}

.price-change .price {
  font-size: 28px;
  font-weight: 800;
  color: #0f172a;
}

.price-change .change {
  font-size: 16px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  line-height: 1.2;
}

.price-change .change.up {
  color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
}

.price-change .change.down {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
}

.price-change .change.flat {
  color: #64748b;
  background: rgba(100, 116, 139, 0.1);
}

@media (max-width: 640px) {
  .price-change {
    justify-content: center; /* center on small screens */
  }
}

.chart-header {
  margin-top: 24px;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  border-bottom: 2px solid rgba(226, 232, 240, 0.8);
  padding-bottom: 6px;
}

#myChart {
  width: 100% !important;
  height: 260px !important; /* consistent height */
}
