/**
 * Chart Components CSS
 * Static layout styles for chart-related components
 * Refactored from inline JavaScript styles (Category B violations)
 */

/* ========================================
   SLIDER CHART COMPONENTS
   ======================================== */

/* Chart container for slider charts */
.slider-chart-container {
    height: 400px;
    margin-bottom: 20px;
}

/* Slider control panel */
.slider-container {
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 10px;
    text-align: center;
}

/* Slider label */
.slider-label {
    margin-right: 15px;
    font-size: 14px;
}

/* Slider input (range) */
.slider-input {
    width: 300px;
    margin: 0 15px;
}

/* Slider value display */
.slider-value {
    font-size: 14px;
    margin-left: 15px;
    min-width: 100px;
    display: inline-block;
}

/* ========================================
   CHART TITLE COMPONENTS
   ======================================== */

/* Chart title container with spacing */
.chart-title-container {
    margin-bottom: 0.5rem;
}

/* ========================================
   TABLE CHART COMPONENTS
   ======================================== */

/* Data table styling */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

/* Table header row */
.data-table thead tr {
    background: var(--input-bg);
    border-bottom: 2px solid var(--border-primary);
}

/* Table header cells */
.data-table th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid var(--border-primary);
    color: var(--text-secondary);
    font-weight: 600;
}

/* Table body rows - striped */
.data-table tbody tr:nth-child(odd) {
    background-color: var(--bg-tertiary);
}

/* Table data cells */
.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-primary);
}

/* Specific cell types */
.data-table td.cell-metric {
    font-weight: 500;
}

.data-table td.cell-interpretation {
    color: var(--text-secondary);
}

/* Interpretation color coding */
.data-table td.cell-interpretation.excellent {
    color: var(--success);
    font-weight: 500;
}

.data-table td.cell-interpretation.good {
    color: var(--info);
    font-weight: 500;
}

.data-table td.cell-interpretation.moderate {
    color: var(--warning);
    font-weight: 500;
}

.data-table td.cell-interpretation.poor {
    color: var(--error);
    font-weight: 500;
}

/* ========================================
   TRANSACTION TABLE SPECIFIC
   ======================================== */

.transactions-table {
    width: 100%;
    border-collapse: collapse;
}

.transactions-table thead {
    position: sticky;
    top: 0;
    background: var(--input-bg);
    z-index: 1;
}

.transactions-table thead tr {
    border-bottom: 2px solid var(--border-primary);
}

.transactions-table th {
    padding: 12px;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
}

.transactions-table th.text-left {
    text-align: left;
}

.transactions-table th.text-right {
    text-align: right;
}

.transactions-table td {
    padding: 12px;
}

.transactions-table td.text-left {
    text-align: left;
}

.transactions-table td.text-right {
    text-align: right;
}

.transactions-table tbody tr {
    border-bottom: 1px solid var(--border-primary);
    transition: background-color 0.15s ease;
}

.transactions-table tbody tr:hover {
    background-color: var(--hover-bg);
}

/* ========================================
   FUNDAMENTALS TABLE SPECIFIC
   ======================================== */

.f1-table-wrapper {
    overflow-x: auto;
}

.f1-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.f1-table thead tr {
    background: var(--input-bg);
    border-bottom: 2px solid var(--border-primary);
}

.f1-table th {
    padding: 8px 10px;  /* Reduced from 12px (Issue #12) */
    font-weight: 600;
    color: var(--text-primary);
}

.f1-table td {
    padding: 6px 8px;  /* Reduced from 10px 12px (Issue #12) */
    border-bottom: 1px solid var(--border-primary);
}

.f1-table {
    line-height: 1.4;  /* Reduced line height for compactness (Issue #12) */
}

/* NA Reason Indicators (Issue #14) */
.na-indicator {
    display: inline-block;
    padding: 2px 6px;
    background-color: #fef3c7;  /* Light yellow */
    color: #92400e;  /* Dark yellow text */
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.f1-table tbody tr:hover {
    background-color: var(--hover-bg);
}

/* ========================================
   EVENTS TABLE SPECIFIC
   ======================================== */

.e1-table-wrapper {
    overflow-x: auto;
}

.e1-summary-section {
    padding: 0 0 1rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.e1-summary-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.e1-summary-stat {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========================================
   CONTRIBUTION TABLE SPECIFIC
   ======================================== */

.contribution-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.contribution-table-wrapper.scrollable {
    overflow-y: auto;
    border: 1px solid var(--border-primary);
    border-radius: 8px;
}

.contribution-table {
    width: 100%;
}

.contribution-table th {
    padding: 12px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}

.contribution-table th.sortable:hover {
    background-color: var(--hover-bg);
}

.contribution-table td {
    padding: 10px 12px;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 768px) {
    .slider-input {
        width: 200px;
    }
    
    .slider-label,
    .slider-value {
        font-size: 12px;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
        font-size: 12px;
    }
}

/* ========================================
   NEWS PAGINATION
   Shared between Portfolio O5 and Security cp_06
   ======================================== */

.news-pagination {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  margin-top: 1rem;
}

.pagination-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.pagination-info p {
  margin: 0;
}

.pagination-controls {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pagination-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  background: var(--btn-primary);
  color: var(--btn-text);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--btn-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgb(0 0 0 / 15%);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-pages {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.pagination-page-btn {
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination-page-btn:hover {
  background: var(--btn-primary);
  color: var(--btn-text);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgb(0 0 0 / 15%);
}

.pagination-page-btn.active {
  background: var(--btn-primary);
  color: var(--btn-text);
  font-weight: 600;
  border-color: var(--btn-primary);
}

.pagination-ellipsis {
  padding: 0 0.5rem;
  color: var(--text-secondary);
  user-select: none;
}

/* ========================================
   NEWS COMPONENT
   Shared between Portfolio O5 and Security cp_06
   ======================================== */

/* News Wrapper */
.news-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem 0;
}

/* News List */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* News Card */
.news-card {
  position: relative;
  padding: 1.5rem;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  transition: all 0.2s;
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgb(0 0 0 / 15%);
}

/* News Card Title */
.news-card h3 {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 0.75rem 0;
  margin-right: 45px;
}

.news-card h3 a {
  color: inherit;
  text-decoration: none;
}

.news-card h3 a:hover {
  color: var(--primary-color);
}

/* News Metadata */
.news-metadata {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8125rem;
  margin-bottom: 0.75rem;
}

/* News Summary */
.news-summary {
  color: var(--text-primary);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Article Content */
.article-content {
  color: var(--text-primary);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-md);
}

.article-content p {
  margin-bottom: var(--space-md);
  line-height: var(--leading-relaxed);
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  color: var(--text-primary);
  font-weight: 600;
  margin-top: var(--space-lg);
  margin-bottom: var(--space-md);
  line-height: 1.3;
}

.article-content h1 { font-size: 1.75rem; }
.article-content h2 { font-size: 1.5rem; }
.article-content h3 { font-size: 1.25rem; }
.article-content h4 { font-size: 1.125rem; }
.article-content h5 { font-size: 1rem; }
.article-content h6 { font-size: 0.875rem; }

.article-content ul,
.article-content ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

.article-content li {
  margin-bottom: var(--space-sm);
  line-height: var(--leading-relaxed);
}

.article-content strong,
.article-content b {
  font-weight: 600;
  color: var(--text-primary);
}

.article-content em,
.article-content i {
  font-style: italic;
  color: var(--text-secondary);
}

/* Article Summary */
.article-summary {
  color: var(--text-primary);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Read Full Link */
.read-full-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--btn-primary);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
  background: var(--btn-secondary-bg);
  transition: background 0.2s;
  white-space: nowrap;
}

.read-full-link:hover {
  background: var(--bg-tertiary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Article Toggle Button */
.article-toggle-btn {
  background: none;
  border: none;
  color: var(--btn-primary);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  padding: var(--space-sm) 0;
  text-decoration: none;
  transition: var(--transition-base);
}

.article-toggle-btn:hover {
  text-decoration: underline;
  opacity: 0.8;
}

/* Ticker Badge */
.ticker-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  background: var(--btn-primary);
  color: var(--btn-text);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Category Tag */
.category-tag {
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
}

/* Importance Badge */
.importance-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--btn-text);
  font-size: 0.875rem;
  font-weight: 700;
}

/* Key Points */
.key-points {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.key-points li {
  position: relative;
  padding: 0.375rem 0 0.375rem 1.25rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  line-height: 1.5;
}

.key-points li::before {
  content: '•';
  position: absolute;
  left: 0.25rem;
  color: var(--btn-primary);
  font-weight: 700;
}

/* Collapsible Sections */
.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.collapsible-arrow {
  color: var(--text-secondary);
  font-size: 0.75rem;
  transition: transform 0.2s;
}

/* News Stats Bar */
.news-stats-bar {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, 1fr);
}

.news-stat-card {
  padding: 1rem;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  text-align: center;
  transition: all 0.2s;
}

.news-stat-card:hover {
  box-shadow: 0 2px 8px rgb(0 0 0 / 10%);
  border-color: var(--primary-color);
}

.news-stat-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.news-stat-value {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 700;
}

/* Client-Side Filters */
.news-client-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  margin-bottom: 1rem;
}

.news-client-filters .control-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.news-client-filters label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.news-client-filters select {
  padding: 0.5rem;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--text-primary);
  cursor: pointer;
}

/* Empty State */
.news-empty-state {
  padding: 3rem;
  color: var(--text-secondary);
  text-align: center;
}

.news-empty-state-icon {
  font-size: 3rem;
  opacity: 0.3;
  margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .news-stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .news-stat-value {
    font-size: 1.25rem;
  }
}

