/**
 * 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: 15px;
}

/* Market Search Container */
.market-search-container {
  position: relative;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.market-search-input {
  flex: 1;
  max-width: 500px;
  padding: 12px 16px;
  font-size: 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  transition: all 0.3s;
  outline: none;
}

.market-search-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.market-search-input::placeholder {
  color: #999;
}

.search-count {
  font-size: 14px;
  color: #666;
  font-weight: 500;
  white-space: nowrap;
}

/* 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 {
  position: relative;  /* Added for absolute positioning of child elements */
  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;
}

.privacy {
  padding: 15px;
  background-color: #ffcdcd;
  border-left: 4px solid #f31212;
  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-content {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }

  .header-left {
    width: 100%;
    margin-bottom: 15px;
  }

  .auth-buttons {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .auth-buttons .btn {
    width: 100%;
  }

  #user-email {
    text-align: center;
    width: 100%;
  }

  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;
  }

  /* Modal tabs responsive */
  .modal-tabs {
    gap: 8px;
    padding: 12px 15px;
  }

  .modal-tabs .tab-btn {
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  /* Dividend details responsive */
  .dividend-details {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .dividend-item {
    padding: 12px;
  }

  .dividend-symbol {
    font-size: 16px;
  }

  .dividend-amount {
    font-size: 18px;
  }

  .dividend-expected {
    padding: 8px 10px;
    font-size: 13px;
  }

  .dividend-expected-amount {
    font-size: 15px;
  }
}

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

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

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

  /* Header adjustments for small screens */
  header h1 {
    font-size: 1.2rem;
  }

  .header-subtitle {
    font-size: 0.85rem;
  }

  .privacy {
    font-size: 0.8rem;
  }

  /* Modal adjustments */
  .modal-content {
    width: 95%;
    max-width: 95%;
    margin: 10px;
  }

  .modal-large .modal-body {
    padding: 15px;
  }

  .modal-header h2 {
    font-size: 1.3rem;
  }

  /* Dividend tabs for very small screens */
  .modal-tabs {
    gap: 6px;
    padding: 10px;
  }

  .modal-tabs .tab-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  /* Dividend items on small screens */
  .dividend-item {
    padding: 10px;
  }

  .dividend-symbol {
    font-size: 14px;
  }

  .dividend-amount {
    font-size: 16px;
  }

  .dividend-detail {
    font-size: 13px;
  }

  .dividend-detail-label {
    font-size: 12px;
  }

  .dividend-expected {
    padding: 6px 8px;
    font-size: 12px;
  }

  .dividend-expected-amount {
    font-size: 14px;
  }
}

/* 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 {
  position: relative;  /* Added for absolute positioning of child elements */
  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;
  display: flex;
  flex-direction: column;
  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 tabs */
.modal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 15px 20px;
  background-color: #f8f9fa;
  border-bottom: 2px solid #ecf0f1;
  justify-content: center;
}

.modal-tabs .tab-btn {
  flex: 0 1 auto;
  padding: 10px 18px;
  background: white;
  border: 2px solid #ddd;
  border-radius: 20px;
  color: #7f8c8d;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.modal-tabs .tab-btn:hover {
  border-color: #3498db;
  background: #f0f3ff;
  color: #2c3e50;
}

.modal-tabs .tab-btn.active {
  background: #3498db;
  color: white;
  border-color: #3498db;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.modal-body {
  padding: 25px;
  overflow-y: auto;
  flex: 1;
}

/* 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;
  transition: background 0.3s ease;
}

/* Transparent variant - shown when no recent announcements */
.announcements-header.transparent {
  background: transparent;
  border-bottom: 1px solid #e0e0e0;
  margin: 0 0 12px 0;
  padding: 8px 0;
}

.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;
}

/* Transparent header variant - adjust button styling */
.announcements-header.transparent .view-announcements-btn {
  background: #f0f0f0;
  border: 1px solid #ddd;
  color: #555;
}

.announcements-header.transparent .view-announcements-btn:hover {
  background: #e0e0e0;
  border-color: #ccc;
}

.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;
}

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

.floating-dividends-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(245, 87, 108, 0.6);
}

/* Dividends modal */
.dividends-list {
  padding: 10px 0;
}

.dividend-item {
  background: white;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s;
}

.dividend-item.owned {
  background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f4 100%);
  border: 2px solid #4caf50;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.dividend-item.owned .dividend-symbol::before {
  content: "✓ ";
  color: #4caf50;
  font-weight: bold;
}

.dividend-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-color: #667eea;
}

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

.dividend-symbol {
  font-size: 18px;
  font-weight: 700;
  color: #2c3e50;
  flex: 1;
}

.dividend-amount {
  font-size: 20px;
  font-weight: 700;
  color: #27ae60;
  margin-left: 10px;
}

.dividend-expected {
  background: #fff9e6;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 10px;
  font-size: 14px;
}

.dividend-expected-label {
  color: #666;
  font-weight: 500;
  margin-right: 5px;
}

.dividend-expected-amount {
  color: #f57c00;
  font-weight: 700;
  font-size: 16px;
}

.dividend-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  font-size: 14px;
  color: #657786;
}

.dividend-detail {
  display: flex;
  flex-direction: column;
}

.dividend-detail-label {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  color: #8899a6;
  margin-bottom: 2px;
}

.dividend-detail-value {
  color: #2c3e50;
}

/* Compact dividend item layout */
.dividend-item-compact {
  background: white;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s;
}

.dividend-item-compact.owned {
  background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f4 100%);
  border: 2px solid #4caf50;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.dividend-item-compact:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-color: #667eea;
}

.compact-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e1e8ed;
}

.compact-header .dividend-symbol {
  font-size: 18px;
  font-weight: 700;
  color: #2c3e50;
}

.owned-badge {
  background: #4caf50;
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px;
}

.compact-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
  padding: 6px 0;
  align-items: center;
}

.compact-row.highlight {
  background: #f8f9fa;
  padding: 8px;
  border-radius: 4px;
  margin: 2px 0;
}

.compact-label {
  font-size: 12px;
  font-weight: 600;
  color: #657786;
  text-transform: uppercase;
}

.compact-value {
  font-size: 14px;
  color: #2c3e50;
  font-weight: 500;
}

.compact-row.highlight .compact-value {
  font-weight: 700;
  color: #667eea;
}

/* Card Action Buttons */
.card-action-buttons {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.view-announcements-btn,
.view-dividends-btn {
  background: white;
  border: 2px solid #e1e8ed;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.view-announcements-btn:hover {
  background: #667eea;
  border-color: #667eea;
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.view-dividends-btn:hover {
  background: #27ae60;
  border-color: #27ae60;
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(39, 174, 96, 0.3);
}

/* Entity Dividend Modal Styles */
.entity-dividend-stats {
  margin-bottom: 24px;
}

.entity-dividend-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.entity-dividend-history h3,
.entity-upcoming-section h3 {
  color: #2c3e50;
  font-size: 18px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e1e8ed;
}

.entity-dividend-timeline {
  /* Scrolling handled by parent modal-body */
}

.year-group-entity {
  background: white;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}

.year-header-entity {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.year-label-entity {
  font-size: 18px;
  font-weight: 700;
}

.year-total-entity {
  font-size: 16px;
  font-weight: 600;
}

.year-count-entity {
  font-size: 14px;
  opacity: 0.9;
}

.year-dividends-entity {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dividend-payment-item {
  background: #f8f9fa;
  border: 1px solid #e1e8ed;
  border-radius: 6px;
  padding: 12px;
  transition: all 0.3s;
}

.dividend-payment-item.eligible {
  background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f4 100%);
  border: 2px solid #4caf50;
  box-shadow: 0 2px 6px rgba(76, 175, 80, 0.2);
}

.dividend-payment-item:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.payment-amount {
  font-size: 18px;
  font-weight: 700;
  color: #27ae60;
}

.payment-type {
  display: flex;
  align-items: center;
}

.payment-eligible {
  background: #4caf50;
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.payment-details-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #657786;
  margin-bottom: 6px;
}

.payment-detail {
  display: flex;
  align-items: center;
}

.payment-received-row {
  background: #fff;
  border: 1px solid #4caf50;
  border-radius: 4px;
  padding: 8px;
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.payment-received-label {
  font-size: 13px;
  color: #657786;
}

.payment-received-amount {
  font-size: 14px;
  font-weight: 700;
  color: #27ae60;
}

/* Upcoming Events Section */
.entity-upcoming-section {
  margin-top: 24px;
}

.upcoming-section {
  margin-bottom: 20px;
}

.upcoming-section h4 {
  color: #2c3e50;
  font-size: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.upcoming-item {
  background: white;
  border: 1px solid #e1e8ed;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s;
}

.upcoming-item:hover {
  border-color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.upcoming-date {
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
  flex: 1;
}

.upcoming-amount {
  font-size: 16px;
  font-weight: 700;
  color: #27ae60;
  margin: 0 12px;
}

.upcoming-days {
  font-size: 12px;
  color: #657786;
  background: #f8f9fa;
  padding: 4px 8px;
  border-radius: 4px;
}

.dividend-type {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.dividend-type.interim {
  background: #e3f2fd;
  color: #1976d2;
}

.dividend-type.final {
  background: #e8f5e9;
  color: #388e3c;
}

.dividend-type.special {
  background: #fff3e0;
  color: #f57c00;
}

.dividend-type.other {
  background: #f3e5f5;
  color: #7b1fa2;
}

.modal-info {
  background: #f0f7ff;
  border-left: 4px solid #667eea;
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 4px;
  font-size: 14px;
  color: #2c3e50;
}

/* Dividend Overview Section */
#dividend-overview-section {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.dividend-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.sort-select {
  padding: 10px 16px;
  border: 2px solid #e1e8ed;
  border-radius: 8px;
  background: white;
  font-size: 14px;
  font-weight: 500;
  color: #2c3e50;
  cursor: pointer;
  transition: all 0.3s;
}

.sort-select:hover {
  border-color: #667eea;
}

.sort-select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dividend-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 24px 0;
}

@media (max-width: 1200px) {
  .dividend-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .dividend-stats {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.stat-card.green {
  background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
  box-shadow: 0 4px 12px rgba(86, 171, 47, 0.3);
}

.stat-card.orange {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 4px 12px rgba(245, 87, 108, 0.3);
}

.stat-card.blue {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  box-shadow: 0 4px 12px rgba(79, 172, 254, 0.3);
}

.stat-label {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
}

.dividend-overview-content {
  /* Parent modal-body handles scrolling */
}

.dividend-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.dividend-table thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.dividend-table th {
  padding: 16px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dividend-table th:first-child {
  border-top-left-radius: 8px;
}

.dividend-table th:last-child {
  border-top-right-radius: 8px;
}

.dividend-table tbody tr {
  border-bottom: 1px solid #e1e8ed;
  transition: all 0.2s;
}

.dividend-table tbody tr:hover {
  background: #f8f9fa;
}

.dividend-table tbody tr.eligible-row {
  background: linear-gradient(90deg, #e8f5e9 0%, #ffffff 100%);
  border-left: 4px solid #27ae60;
}

.dividend-table tbody tr.eligible-row:hover {
  background: linear-gradient(90deg, #dcedc8 0%, #f8f9fa 100%);
}

.dividend-table tbody tr:last-child {
  border-bottom: none;
}

.dividend-table td {
  padding: 16px 12px;
  font-size: 14px;
  color: #2c3e50;
}

.company-cell {
  font-weight: 600;
  color: #667eea;
  position: relative;
}

.company-name-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.eligible-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #27ae60;
  color: white;
  font-size: 12px;
}

.total-dividends-badge {
  display: inline-block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
  white-space: nowrap;
}

.yield-cell {
  font-weight: 700;
  font-size: 16px;
}

.yield-high {
  color: #27ae60;
}

.yield-medium {
  color: #f39c12;
}

.yield-low {
  color: #95a5a6;
}

.amount-cell {
  font-weight: 600;
}

.date-cell {
  color: #657786;
  font-size: 13px;
}

.frequency-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.frequency-annual {
  background: #e3f2fd;
  color: #1976d2;
}

.frequency-semi {
  background: #e8f5e9;
  color: #388e3c;
}

.frequency-quarterly {
  background: #fff3e0;
  color: #f57c00;
}

.frequency-other {
  background: #f3e5f5;
  color: #7b1fa2;
}

/* Expandable Dividend Cards */
.dividend-card {
  background: white;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.dividend-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #667eea;
}

.dividend-card.owned {
  border-left: 4px solid #27ae60;
}

.dividend-card.expanded {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.dividend-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}

.dividend-card-header:hover {
  background: #f8f9fa;
}

.card-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-company-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-company-name {
  font-size: 18px;
  font-weight: 700;
  color: #667eea;
}

.card-metrics {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

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

.metric-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #657786;
  font-weight: 600;
}

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

.card-right {
  display: flex;
  align-items: center;
  margin-left: 16px;
}

.expand-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.expand-btn:hover {
  background: #e8ebed;
}

.expand-icon {
  font-size: 14px;
  color: #657786;
  transition: transform 0.3s;
}

.dividend-card-body {
  border-top: 1px solid #e1e8ed;
  padding: 20px;
  background: #f8f9fa;
}

.year-group {
  background: white;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid #e1e8ed;
}

.year-group:last-child {
  margin-bottom: 0;
}

.year-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #667eea;
}

.year-label {
  font-size: 16px;
  font-weight: 700;
  color: #667eea;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.year-total {
  font-size: 16px;
  font-weight: 700;
  color: #27ae60;
}

.year-dividends {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dividend-detail-row {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  border-left: 4px solid transparent;
  transition: all 0.2s;
}

.dividend-detail-row:hover {
  background: #e9ecef;
}

.dividend-type-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
  white-space: nowrap;
  align-self: flex-start;
}

.dividend-type-badge.interim {
  background: #e3f2fd;
  color: #1976d2;
}

.dividend-type-badge.final {
  background: #e8f5e9;
  color: #388e3c;
}

.dividend-type-badge.special {
  background: #fff3e0;
  color: #f57c00;
}

.dividend-type-badge.other {
  background: #f3e5f5;
  color: #7b1fa2;
}

.dividend-detail-info {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

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

.dividend-detail-item.highlight {
  background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
  padding: 8px;
  border-radius: 4px;
  border-left: 3px solid #667eea;
}

.detail-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #657786;
  font-weight: 600;
}

.detail-value {
  font-size: 14px;
  font-weight: 700;
  color: #2c3e50;
}

.dividend-detail-item.highlight .detail-value {
  color: #667eea;
  font-size: 16px;
}

/* Announcements modal */
.announcements-list {
  padding: 10px 0;
}

.announcements-items {
  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;
}

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

  .floating-dividends-btn {
    width: 50px;
    height: 50px;
    font-size: 20px;
    bottom: 80px;
    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%;
  }
}
