/* Card Styles */
.card {
  background-color: #0f172a;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  margin-bottom: 1.5rem;
}

/* .card-items {
  background-color: #0000005c;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  margin-bottom: 1.5rem;
} */

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.card-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.card-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
}

.subtitle {
  color: #94a3b8;
  font-size: 0.875rem;
}

/* Heatmap Container */
.heatmap-container {
  position: relative;
}

.heatmap-scroll-wrapper {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 0.5rem;
}

.heatmap-scroll-wrapper::-webkit-scrollbar {
  height: 8px;
}

.heatmap-scroll-wrapper::-webkit-scrollbar-track {
  background: #334155;
  border-radius: 4px;
}

.heatmap-scroll-wrapper::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

.heatmap-scroll-wrapper::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.month-labels {
  display: flex;
  margin-left: 4rem;
  margin-bottom: 0.75rem;
  position: relative;
  min-height: 1.25rem;
  width: 100%;
}

.month-label {
  position: relative; /* remove absolute so they flow */
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
}

.heatmap-grid-wrapper {
  display: flex;
  gap: 2rem;
  width: fit-content;
}

.day-labels {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 1.5rem;
}

.day-label {
  height: 11px;
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.heatmap-grid {
  display: flex;
  gap: 3px;
  padding-top: 1.5rem;
  width: fit-content;
}

.heatmap-week {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.heatmap-cell {
  width: 16.5px;
  height: 16px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.heatmap-cell:hover {
  outline: 2px solid #dc7041;
  outline-offset: 0;
  transform: scale(1.2);
}

.heatmap-cell.selected {
  outline: 2px solid #dc7041;
  outline-offset: 0;
}

.heatmap-cell.empty {
  background-color: transparent;
  cursor: default;
}

.heatmap-cell.empty:hover {
  outline: none;
  transform: none;
}

/* Heatmap cell colors - Buy (Green) */
/* .heatmap-cell.buy-1 {
  background-color: rgba(104, 211, 145, 0.3);
} */
.heatmap-cell.buy-1 {
  background-color: rgba(104, 211, 145, 0.5);
}
.heatmap-cell.buy-2 {
  background-color: rgba(104, 211, 145, 0.7);
}
.heatmap-cell.buy-3 {
  background-color: #68d391;
}

/* Heatmap cell colors - Sell (Red) */
/* .heatmap-cell.sell-1 {
  background-color: rgba(239, 68, 68, 0.3);
} */
.heatmap-cell.sell-1 {
  background-color: rgba(239, 68, 68, 0.5);
}
.heatmap-cell.sell-2 {
  background-color: rgba(239, 68, 68, 0.7);
}
.heatmap-cell.sell-3 {
  background-color: #ef4444;
}

/* Heatmap cell colors - Dividend (Blue) */
/* .heatmap-cell.dividend-1 {
  background-color: rgba(59, 130, 246, 0.3);
} */
.heatmap-cell.dividend-1 {
  background-color: rgba(59, 130, 246, 0.5);
}
.heatmap-cell.dividend-2 {
  background-color: rgba(59, 130, 246, 0.7);
}
.heatmap-cell.dividend-3 {
  background-color: #3b82f6;
}

/* Heatmap cell colors - Mixed (Orange accent) */
/* .heatmap-cell.mixed-1 {
  background-color: rgba(220, 112, 65, 0.3);
} */
.heatmap-cell.mixed-1 {
  background-color: rgba(220, 112, 65, 0.5);
}
.heatmap-cell.mixed-2 {
  background-color: rgba(220, 112, 65, 0.7);
}
.heatmap-cell.mixed-3 {
  background-color: #dc7041;
}

.heatmap-cell.no-data {
  background-color: rgba(148, 163, 184, 0.1);
}

/* Hover Tooltip - Removed for better UX */
/* #hover-tooltip {
  display: none !important;
} */

.legend {
  display: flex;
  justify-content: space-between; /* left vs right */
  align-items: center;
  margin-top: 1rem;
  gap: 2rem;
}

.legend-scale {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-label {
  font-size: 0.75rem;
  color: #94a3b8;
}

.legend-cells {
  display: flex;
  gap: 0.25rem;
}

.legend-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

.legend-empty {
  background-color: rgba(148, 163, 184, 0.1);
}
.legend-level-1 {
  background-color: rgba(104, 211, 145, 0.3);
}
.legend-level-2 {
  background-color: rgba(104, 211, 145, 0.5);
}
.legend-level-3 {
  background-color: rgba(104, 211, 145, 0.7);
}
.legend-level-4 {
  background-color: #68d391;
}

.legend-types {
  display: flex;
  gap: 0.75rem;
  margin-left: 1.5rem;
}

.legend-type {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.legend-type span {
  font-size: 0.75rem;
  color: #94a3b8;
}

.legend-buy {
  background-color: #68d391;
}
.legend-sell {
  background-color: #ef4444;
}
.legend-dividend {
  background-color: #3b82f6;
}
.legend-mixed {
  background-color: #dc7041;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  display: none;
}

.loading-state.active {
  display: flex;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #334155;
  border-top-color: #dc7041;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-state p {
  margin-top: 1rem;
  color: #94a3b8;
}

/* Activity Details */
.activity-details {
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.clear-button {
  background: transparent;
  color: #94a3b8;
  border: none;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.clear-button:hover {
  color: #ffffff;
  background-color: #334155;
}

/* Activity list - Compact modern design */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-item {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #334155;
  border-left: 4px solid #dc7041;
  border-radius: 8px;
  padding: 14px 16px;
  transition: all 0.3s ease;
}

.activity-item:hover {
  border-color: #dc7041;
  box-shadow: 0 4px 16px rgba(220, 112, 65, 0.25);
  transform: translateX(4px);
}

.activity-item.buy {
  border-left-color: #68d391;
}
.activity-item.sell {
  border-left-color: #ef4444;
}
.activity-item.dividend {
  border-left-color: #3b82f6;
}

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

.activity-title {
  flex: 1;
}

.activity-type-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.activity-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.activity-badge.buy {
  background-color: rgba(11, 163, 123, 0.2);
  color: #68d391;
  border: 1px solid #0ba37b;
}

.activity-badge.sell {
  background-color: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid #ef4444;
}

.activity-badge.dividend {
  background-color: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
  border: 1px solid #3b82f6;
}

.activity-symbol {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}

.activity-description {
  font-size: 11px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
}

.activity-date {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
}

.activity-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(51, 65, 85, 0.5);
}

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

.metric-label {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
}

.metric-value {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.metric-value.profit {
  color: #68d391;
}

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

.metric-value.dividend {
  color: #3b82f6;
}

/* Responsive Design */
@media (max-width: 768px) {

  .header h1 {
    font-size: 1.5rem;
  }

  .card {
    padding: 1rem;
  }

  .card-header h2 {
    font-size: 1.25rem;
  }

  .legend {
    flex-direction: column;
    align-items: start;
  }

  .legend-types {
    margin-left: 0;
  }

  .activity-metrics {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .activity-item {
    padding: 12px;
  }
}

/* Error State */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
}

.error-state svg {
  width: 64px;
  height: 64px;
  color: #ef4444;
  margin-bottom: 1rem;
}

.error-state h3 {
  color: #ffffff;
  margin-bottom: 0.5rem;
}

.error-state p {
  color: #94a3b8;
}

/* Year Selector - Modern design */
.year-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.year-selector label {
  font-size: 13px;
  font-weight: 600;
  color: #dc7041;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.year-select-dropdown {
  padding: 10px 16px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  border: 2px solid #dc7041;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  min-width: 120px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(220, 112, 65, 0.2);
  outline: none;
}

.year-select-dropdown:hover {
  border-color: #e87c50;
  background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
  box-shadow: 0 4px 12px rgba(220, 112, 65, 0.3);
  transform: translateY(-1px);
}

.year-select-dropdown:focus {
  border-color: #dc7041;
  box-shadow: 0 0 0 3px rgba(220, 112, 65, 0.2);
}
