/**
 * Styles for SEM Trading Quotes webapp - Card View
 * Responsive card layout with 7-day mini charts
 */

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
  padding: 20px;
  max-width: 1600px;
  margin: 0 auto;
}

/* Header */
header {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.header-left {
  flex: 1;
}

header h1 {
  color: #2c3e50;
  font-size: 1.8rem;
  margin-bottom: 5px;
}

.header-subtitle {
  color: #7f8c8d;
  font-size: 0.95rem;
  margin: 5px 0 0 0;
}

.header-link {
  color: #3498db;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.header-link:hover {
  color: #2980b9;
  text-decoration: underline;
}

.auth-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

#user-email {
  color: #666;
  font-size: 0.9rem;
}

#login-btn {
  display: none !important;
}

/* Main content */
main {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Controls section */
.controls {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  align-items: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.btn:hover {
  background-color: #2980b9;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn:active {
  transform: translateY(0px);
}

.btn-primary {
  background-color: #27ae60;
}

.btn-primary:hover {
  background-color: #229954;
}

.btn-secondary {
  background-color: #95a5a6;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

#logout-btn {
  background-color: #e74c3c;
}

#logout-btn:hover {
  background-color: #c0392b;
}

#last-fetch-info {
  color: #666;
  font-size: 0.9rem;
}

/* Loading state */
.loading {
  text-align: center;
  padding: 40px;
}

.spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto 15px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Error message */
.error-message {
  background-color: #fadbd8;
  color: #c0392b;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
  border-left: 4px solid #e74c3c;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid #ecf0f1;
  padding-bottom: 0;
}

.tab-btn {
  padding: 12px 24px;
  background-color: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  color: #7f8c8d;
  transition: all 0.2s;
  margin-bottom: -2px;
}

.tab-btn:hover {
  color: #3498db;
  background-color: #f8f9fa;
}

.tab-btn.active {
  color: #3498db;
  border-bottom-color: #3498db;
}

/* Section Header with Controls */
.section-header-with-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
}

/* Timeframe Selector */
.timeframe-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.timeframe-btn {
  padding: 8px 16px;
  border: 1px solid #ddd;
  background-color: white;
  color: #555;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.timeframe-btn:hover {
  background-color: #f8f9fa;
  border-color: #3498db;
  color: #3498db;
}

.timeframe-btn.active {
  background-color: #3498db;
  color: white;
  border-color: #3498db;
}

/* Data info */
.data-info {
  padding: 15px;
  background-color: #ecf0f1;
  border-radius: 6px;
  margin-bottom: 20px;
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}

.data-info p {
  margin: 0;
  font-size: 0.95rem;
}

/* Cards Container */
.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

/* Stock Card */
.stock-card {
  background: white;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.3s;
  border-left: 4px solid;
  cursor: pointer;
}

.stock-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Card colors based on trend */
.stock-card.trend-up {
  border-left-color: #27ae60;
  background: linear-gradient(135deg, #ffffff 0%, #f0fff4 100%);
}

.stock-card.trend-down {
  border-left-color: #e74c3c;
  background: linear-gradient(135deg, #ffffff 0%, #fff5f5 100%);
}

.stock-card.trend-unchanged {
  border-left-color: #95a5a6;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

/* Card Header */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-header-content {
  flex: 1;
}

.card-symbol {
  font-size: 1.1rem;
  font-weight: 700;
  color: #2c3e50;
  margin: 0;
  line-height: 1.2;
}

.card-currency {
  font-size: 0.85rem;
  color: #7f8c8d;
  font-weight: 500;
}

.trend-badge {
  font-size: 1.5rem;
  line-height: 1;
}

.trend-badge.up {
  color: #27ae60;
}

.trend-badge.down {
  color: #e74c3c;
}

.trend-badge.unchanged {
  color: #95a5a6;
}

/* Card Price Info */
.card-price {
  margin-bottom: 12px;
}

.latest-price {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2c3e50;
  line-height: 1;
  margin-bottom: 4px;
}

.price-change {
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  gap: 8px;
}

.price-change .change {
  color: #7f8c8d;
}

.price-change .change.positive {
  color: #27ae60;
}

.price-change .change.negative {
  color: #e74c3c;
}

.price-change .percent {
  color: #7f8c8d;
}

.price-change .percent.positive {
  color: #27ae60;
}

.price-change .percent.negative {
  color: #e74c3c;
}

/* Card Metadata */
.card-metadata {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #ecf0f1;
}

.metadata-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metadata-label {
  font-size: 0.75rem;
  color: #7f8c8d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.metadata-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #2c3e50;
}

/* Card Dividends */
.card-dividends {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #ecf0f1;
}

.dividend-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.dividend-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #2c3e50;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dividend-yield {
  font-size: 0.8rem;
  font-weight: 600;
  color: #27ae60;
  background-color: #d4edda;
  padding: 2px 8px;
  border-radius: 12px;
}

.dividend-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dividend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.dividend-label {
  color: #7f8c8d;
  font-weight: 500;
}

.dividend-value {
  color: #27ae60;
  font-weight: 700;
}

/* Chart Container */
.chart-container {
  height: 80px;
  margin-top: 12px;
  position: relative;
}

.chart-container canvas {
  max-height: 80px;
}

/* Disclaimer */
.disclaimer {
  padding: 15px;
  background-color: #fff3cd;
  border-left: 4px solid #f39c12;
  border-radius: 6px;
  margin-top: 20px;
  font-size: 0.95rem;
}

/* Footer */
footer {
  margin-top: 30px;
  padding: 20px;
  text-align: center;
  color: #7f8c8d;
  font-size: 0.9rem;
}

footer p {
  margin-bottom: 5px;
}

footer a {
  color: #3498db;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive design */
@media (max-width: 1200px) {
  .cards-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
  }

  header h1 {
    font-size: 1.4rem;
  }

  .cards-container {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
  }

  .stock-card {
    padding: 12px;
  }

  .card-symbol {
    font-size: 1rem;
  }

  .latest-price {
    font-size: 1.5rem;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab-btn {
    padding: 10px 20px;
    font-size: 0.95rem;
    white-space: nowrap;
  }

  .data-info {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .cards-container {
    grid-template-columns: 1fr;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Section Titles */
.section-title {
  font-size: 1.5rem;
  color: #2c3e50;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #ecf0f1;
}

/* Portfolio Section */
#portfolio-section {
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 3px solid #3498db;
}

.portfolio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.portfolio-header h2 {
  color: #2c3e50;
  font-size: 1.6rem;
  margin: 0;
}

.portfolio-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-secondary {
  background-color: #95a5a6;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.portfolio-tabs {
  margin-bottom: 20px;
}

/* Empty Portfolio Message */
.empty-portfolio-message {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 8px;
  border: 2px dashed #95a5a6;
  margin-top: 20px;
}

.empty-portfolio-message p {
  color: #7f8c8d;
  font-size: 1.1rem;
  margin: 0;
}

/* Favorites Section */
#favorites-section {
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 3px solid #f39c12;
}

.favorites-header {
  margin-bottom: 20px;
}

.favorites-header h2 {
  color: #2c3e50;
  font-size: 1.6rem;
  margin: 0 0 5px 0;
}

.favorites-subtitle {
  color: #7f8c8d;
  font-size: 0.9rem;
  margin: 0;
}

.favorites-tabs {
  margin-bottom: 20px;
}

/* Star/Favorite Button */
.favorite-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.6rem;
  padding: 4px 8px;
  line-height: 1;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.favorite-btn:hover {
  transform: scale(1.2);
}

.favorite-btn.favorited {
  color: #f39c12;
}

.favorite-btn.not-favorited {
  color: #bdc3c7;
}

/* Card Symbol Row - for symbol and info icon */
.card-symbol-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Info Icon */
.info-icon {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: #3498db;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.info-icon:hover {
  background-color: #3498db;
  color: white;
  transform: scale(1.1);
}

/* Info Tooltip */
.info-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.95);
  border-radius: 8px;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.info-tooltip-content {
  color: white;
  position: relative;
}

.info-tooltip-content h4 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: #3498db;
}

.info-industry {
  margin-bottom: 12px;
  font-size: 0.9rem;
  color: #bdc3c7;
}

.info-description {
  line-height: 1.6;
  font-size: 0.95rem;
  text-align: justify;
}

.info-tooltip-close {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #e74c3c;
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
}

.info-tooltip-close:hover {
  background: #c0392b;
  transform: scale(1.1);
}

/* Portfolio Cards */
.portfolio-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.15);
  transition: all 0.3s;
  border-left: 6px solid;
  cursor: pointer;
}

.portfolio-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.portfolio-card.profit {
  border-left-color: #27ae60;
  background: linear-gradient(135deg, #ffffff 0%, #e8f8f0 100%);
}

.portfolio-card.loss {
  border-left-color: #e74c3c;
  background: linear-gradient(135deg, #ffffff 0%, #fdecea 100%);
}

.portfolio-card.neutral {
  border-left-color: #95a5a6;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.portfolio-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.portfolio-symbol {
  font-size: 1.3rem;
  font-weight: 700;
  color: #2c3e50;
  margin: 0;
}

.portfolio-quantity {
  font-size: 0.9rem;
  color: #7f8c8d;
  margin-top: 4px;
}

.portfolio-badge {
  background-color: #3498db;
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.portfolio-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
  margin-bottom: 16px;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.metric-label {
  font-size: 0.8rem;
  color: #7f8c8d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #2c3e50;
}

.metric-value.profit {
  color: #27ae60;
}

.metric-value.loss {
  color: #e74c3c;
}

.portfolio-summary {
  padding-top: 16px;
  border-top: 2px solid #ecf0f1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gains-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.gain-item {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 0.9rem;
}

.gain-item.total-gain {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid #ecf0f1;
  font-size: 1rem;
  font-weight: 700;
}

.gain-label {
  color: #7f8c8d;
  font-weight: 600;
}

.gain-value {
  font-weight: 700;
}

.gain-value.profit {
  color: #27ae60;
}

.gain-value.loss {
  color: #e74c3c;
}

.pl-badge {
  font-size: 1.1rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 6px;
}

.pl-badge.profit {
  background-color: #d4edda;
  color: #155724;
}

.pl-badge.loss {
  background-color: #f8d7da;
  color: #721c24;
}

.expand-indicator {
  font-size: 1.5rem;
  color: #7f8c8d;
  transition: transform 0.3s;
}

.portfolio-card.expanded .expand-indicator {
  transform: rotate(180deg);
}

/* Transaction Details (Expandable) */
.transaction-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  margin-top: 16px;
}

.portfolio-card.expanded .transaction-details {
  max-height: 1000px;
}

.transaction-details-header {
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #ecf0f1;
}

.transaction-item {
  background-color: #f8f9fa;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 10px;
  border-left: 4px solid #95a5a6;
}

.transaction-item.tx-buy {
  border-left-color: #27ae60;
  background-color: #f0fdf4;
}

.transaction-item.tx-sell {
  border-left-color: #e74c3c;
  background-color: #fef2f2;
}

.transaction-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.transaction-type {
  font-weight: 700;
  font-size: 0.85rem;
}

.transaction-item.tx-buy .transaction-type {
  color: #27ae60;
}

.transaction-item.tx-sell .transaction-type {
  color: #e74c3c;
}

.transaction-info {
  color: #555;
}

/* Modal */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 5px 30px rgba(0,0,0,0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 2px solid #ecf0f1;
}

.modal-header h2 {
  margin: 0;
  color: #2c3e50;
  font-size: 1.5rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: #7f8c8d;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #e74c3c;
}

.modal-body {
  padding: 25px;
}

/* Add Lot Section */
.add-lot-section {
  background-color: #f8f9fa;
  padding: 20px;
  border-radius: 6px;
  margin-bottom: 30px;
}

.add-lot-section h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #2c3e50;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

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

.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #555;
}

.form-group input,
.form-group select {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  background-color: #fff;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Transactions List */
.transactions-list-section {
  margin-top: 30px;
}

.transactions-list-section h3 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #2c3e50;
}

.transactions-list {
  max-height: 400px;
  overflow-y: auto;
}

.empty-message {
  text-align: center;
  color: #7f8c8d;
  padding: 30px;
  font-style: italic;
}

.transaction-list-item {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.transaction-list-item.tx-buy {
  border-left: 4px solid #27ae60;
}

.transaction-list-item.tx-sell {
  border-left: 4px solid #e74c3c;
}

.transaction-list-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.transaction-list-info {
  flex: 1;
}

.transaction-list-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.transaction-type-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.tx-buy .transaction-type-badge {
  background-color: #d4edda;
  color: #155724;
}

.tx-sell .transaction-type-badge {
  background-color: #f8d7da;
  color: #721c24;
}

.transaction-list-symbol {
  font-weight: 700;
  font-size: 1.1rem;
  color: #2c3e50;
}

.transaction-list-details {
  font-size: 0.9rem;
  color: #7f8c8d;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.transaction-list-actions {
  display: flex;
  gap: 10px;
}

.btn-edit {
  background-color: #3498db;
  padding: 8px 12px;
  font-size: 0.9rem;
}

.btn-edit:hover {
  background-color: #2980b9;
}

.btn-delete {
  background-color: #e74c3c;
  padding: 8px 12px;
  font-size: 0.9rem;
}

.btn-delete:hover {
  background-color: #c0392b;
}

/* Portfolio Summary Section (Overall Position) */
.portfolio-summary-section {
  margin-bottom: 25px;
  padding: 0 5px;
}

.summary-card {
  background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  color: white;
}

.summary-card h3 {
  margin: 0 0 20px 0;
  font-size: 1.4rem;
  font-weight: 600;
  text-align: center;
}

.summary-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.summary-metric {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  transition: transform 0.2s, background 0.2s;
}

.summary-metric:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.2);
}

.summary-label {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.9;
  margin-bottom: 8px;
}

.summary-value {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Copyright Footer */
.copyright {
  margin-top: 15px;
  font-size: 0.9rem;
  color: #95a5a6;
  border-top: 1px solid #ecf0f1;
  padding-top: 10px;
}

.copyright a {
  color: #3498db;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.copyright a:hover {
  color: #2980b9;
  text-decoration: underline;
}

/* Chart Container - Support for multiple charts */
.chart-section {
  margin-bottom: 15px;
}

.chart-label {
  font-size: 0.85rem;
  color: #7f8c8d;
  font-weight: 600;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chart-container + .chart-section {
  margin-top: 20px;
}

/* Utility classes */
.hidden {
  display: none;
}

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

.mt-20 {
  margin-top: 20px;
}

/* ===== ANNOUNCEMENTS ===== */

/* Announcements header in stock cards */
.announcements-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
  border-radius: 6px 6px 0 0;
  margin: -16px -16px 12px -16px;
}

.announcement-icon {
  font-size: 18px;
  cursor: default;
  transition: transform 0.2s;
}

.announcement-icon:hover {
  transform: scale(1.2);
}

.view-announcements-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
  margin-left: auto;
}

.view-announcements-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Floating announcements button */
.floating-announcements-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  transition: all 0.3s;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-announcements-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.6);
}

.floating-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #e74c3c;
  color: white;
  border-radius: 12px;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: bold;
  min-width: 20px;
  text-align: center;
}

/* Announcements modal */
.announcements-list {
  max-height: 600px;
  overflow-y: auto;
  padding: 10px 0;
}

.announcements-items {
  max-height: 450px;
  overflow-y: auto;
  margin-top: 15px;
}

.announcement-item {
  background: #f8f9fa;
  border-left: 4px solid #667eea;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.announcement-item:hover {
  background: #e9ecef;
  transform: translateX(4px);
}

.announcement-item[data-type="Dividend"] {
  border-left-color: #27ae60;
}

.announcement-item[data-type="Financial Statement"] {
  border-left-color: #3498db;
}

.announcement-item[data-type="Other"] {
  border-left-color: #95a5a6;
}

/* Recent announcement highlighting (last 7 days) */
.announcement-item.recent-dividend {
  background: linear-gradient(135deg, #d5f4e6 0%, #c8f7dc 100%);
  border-left-color: #27ae60;
  border-left-width: 5px;
  box-shadow: 0 2px 8px rgba(39, 174, 96, 0.2);
}

.announcement-item.recent-financial-statement {
  background: linear-gradient(135deg, #fff4d6 0%, #ffeaa7 100%);
  border-left-color: #f39c12;
  border-left-width: 5px;
  box-shadow: 0 2px 8px rgba(243, 156, 18, 0.2);
}

.announcement-item.recent-other {
  background: linear-gradient(135deg, #d6e9ff 0%, #b3d9ff 100%);
  border-left-color: #3498db;
  border-left-width: 5px;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.announcement-item.recent-dividend:hover,
.announcement-item.recent-financial-statement:hover,
.announcement-item.recent-other:hover {
  transform: translateX(6px);
}

.announcement-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.announcement-type {
  font-weight: 600;
  color: #2c3e50;
  font-size: 14px;
}

.announcement-entity {
  font-weight: 700;
  color: #2c3e50;
  font-size: 15px;
}

.announcement-date {
  color: #7f8c8d;
  font-size: 13px;
}

.announcement-type-row {
  margin-bottom: 8px;
}

.announcement-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.announcement-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: #667eea;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 13px;
  transition: background 0.2s;
}

.announcement-link:hover {
  background: #5568d3;
}

/* Announcements filters */
.announcements-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  border: 2px solid #ddd;
  background: white;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
}

.filter-btn:hover {
  border-color: #667eea;
  background: #f0f3ff;
}

.filter-btn.active {
  background: #3498db;
  color: white;
  border-color: #3498db;
}

/* Filter count badge */
.filter-count {
  display: inline-block;
  background: #e74c3c;
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: bold;
  margin-left: 5px;
  min-width: 18px;
  text-align: center;
}

.filter-btn.active .filter-count {
  background: rgba(255, 255, 255, 0.3);
}

/* Large modal for global announcements */
.modal-large {
  max-width: 900px;
}

.modal-large .modal-body {
  max-height: 600px;
  overflow-y: auto;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .floating-announcements-btn {
    width: 50px;
    height: 50px;
    font-size: 20px;
    bottom: 20px;
    right: 20px;
  }

  .announcements-header {
    gap: 6px;
    padding: 6px 10px;
  }

  .announcement-icon {
    font-size: 16px;
  }

  .announcements-filters {
    gap: 8px;
  }

  .filter-btn {
    padding: 6px 12px;
    font-size: 13px;
  }

  .modal-large {
    max-width: 95%;
  }
}
