/* Template Global Styles - DeepEcon News Pages */

:root {
  --primary-color: #a62639;
  --primary-dark: #8b1e2e;
  --secondary-color: #1a1a1a;
  --text-dark: #1a1a1a;
  --text-light: #666;
  --text-lighter: #999;
  --bg-light: #fafafa;
  --bg-lighter: #ffffff;
  --border-color: #e0e0e0;
  --success-color: #4caf50;
  --warning-color: #ff9800;
  --danger-color: #ef5350;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #fafafa;
  color: #1a1a1a;
  line-height: 1.6;
}

/* ===================== UTILITY CLASSES ===================== */

.hidden {
  display: none !important;
}

/* ===================== HEADER STYLES ===================== */

.header {
  background: white;
  border-bottom: 3px solid #a62639;
  padding: 15px 0;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  gap: 20px;
}

.logo-image {
  height: 50px;
  width: auto;
  flex-shrink: 0;
}

.tagline {
  font-size: 16px;
  color: #1a1a1a;
  font-weight: 600;
  display: none;
  flex: 1;
}

/* Hamburger Menu */
.hamburger-menu {
  display: none;
  cursor: pointer;
  padding: 10px;
  flex-shrink: 0;
}

.hamburger-menu span {
  display: block;
  height: 3px;
  width: 25px;
  background: #1a1a1a;
  margin: 5px 0;
}

/* Navigation */
.nav {
  display: flex;
  gap: 30px;
  border-top: 1px solid #e0e0e0;
  padding: 15px 0;
  justify-content: center;
}

.main-nav-links {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  justify-content: center;
}

.nav a {
  color: #333;
  padding: 8px 12px;
  display: inline-block;
  text-decoration: none;
  font-size: 26px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.3s;
}

.nav a:hover {
  color: #a62639;
}

/* ===================== AUTHENTICATION SECTION ===================== */

.header-auth-section {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

/* User menu - hidden by default, shown when authenticated */
.user-menu {
  display: none;
  align-items: center;
  gap: 15px;
}

/* Show user menu when authenticated class is added */
.user-menu.authenticated {
  display: flex;
}

.username {
  color: var(--text-dark);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}

.logout-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.3s;
  white-space: nowrap;
}

.logout-btn:hover {
  background: var(--primary-dark);
}

/* Auth buttons - shown by default, hidden when user is authenticated */
.auth-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Hide auth buttons when .hidden class is added */
.auth-buttons.hidden {
  display: none !important;
}

.login-btn {
  background: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-block;
  white-space: nowrap;
}

.login-btn:hover {
  background: var(--primary-color);
  color: white;
}

.register-btn {
  background: var(--primary-color);
  color: white;
  border: 2px solid var(--primary-color);
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-block;
  white-space: nowrap;
}

.register-btn:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

/* Sentiment Tracker */
.sentiment-tracker-banner {
  background: transparent;
  border-top: 1px solid #e0e0e0;
  padding: 12px 0;
  text-align: center;
  margin: 0 -20px;
  display: flex;
  justify-content: center;
  gap: 25px;
  flex-wrap: wrap;
}

.sentiment-tracker-link {
  display: inline-block;
  background: #a62639;
  color: white !important;
  padding: 8px 20px;
  margin: 0 5px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.3s;
  border: none;
  cursor: pointer;
}

.sentiment-tracker-link:hover {
  background: #1a1a1a;
}

.sentiment-tracker-link.free {
  background: #a62639;
}

.sentiment-tracker-link.free:hover {
  background: #8b1e2f;
}

/* ===================== CONTAINER & LAYOUT ===================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ===================== DASHBOARD SPECIFIC ===================== */

.dashboard-title-section {
  background: white;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dashboard-title {
  margin: 0 0 10px 0;
  color: #a62639;
  font-size: 24px;
  font-weight: 900;
  font-family: Georgia, serif;
  line-height: 1.2;
}

.dashboard-subtitle {
  margin: 0;
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

.filters-section {
  background: white;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-group {
  flex: 1;
  min-width: 200px;
}

.filter-label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  font-size: 14px;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-select,
.filter-input {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background-color: white;
  cursor: pointer;
}

.dashboard-layout {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.region-sidebar {
  flex: 0 0 150px;
  min-width: 150px;
}

.region-list {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  overflow: hidden;
}

.region-item {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid #e0e0e0;
  transition: all 0.2s;
}

.region-item:hover {
  background-color: #f5f5f5;
}

.region-item.active {
  background-color: #a62639;
  color: white;
}

.dashboard-main {
  flex: 1;
  min-width: 300px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.metric-card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  text-align: center;
}

.metric-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.sentiment-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.sentiment-indicator.positive {
  background-color: #4caf50;
}

.sentiment-indicator.negative {
  background-color: #ef5350;
}

.sentiment-indicator.mixed {
  background-color: #ff9800;
}

.metric-value {
  font-size: 32px;
  font-weight: bold;
}

.metric-value.positive {
  color: #4caf50;
}

.metric-value.negative {
  color: #ef5350;
}

.metric-value.mixed {
  color: #ff9800;
}

.metric-value.primary {
  color: #a62639;
  font-size: 48px;
}

.metric-detail {
  font-size: 14px;
  color: #666;
  margin-top: 10px;
}

.chart-card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.chart-title {
  margin: 0 0 20px 0;
  font-size: 16px;
  color: #1a1a1a;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.data-table-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background-color: #1a1a1a;
}

.data-table th {
  padding: 15px;
  color: white;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
}

.data-table th.align-left {
  text-align: left;
}

.data-table th.align-center {
  text-align: center;
}

.data-table tbody tr {
  border-bottom: 1px solid #e0e0e0;
  cursor: pointer;
  transition: background-color 0.2s;
}

.data-table tbody tr:hover {
  background-color: #f5f5f5;
}

.data-table tbody tr.expanded {
  background-color: #f5f5f5;
}

.data-table td {
  padding: 12px;
  font-size: 14px;
}

.expand-icon {
  margin-right: 8px;
}

.score-cell {
  text-align: center;
  font-weight: bold;
}

.score-cell.positive {
  color: #4caf50;
}

.score-cell.negative {
  color: #ef5350;
}

.score-cell.mixed {
  color: #ff9800;
}

.article-details-row {
  background-color: #fafafa;
  border-bottom: 1px solid #e0e0e0;
}

.article-details {
  padding: 15px 20px;
}

.article-details-header {
  font-size: 12px;
  color: #666;
  margin-bottom: 10px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.article-item {
  padding: 8px 0;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.article-item:last-child {
  border-bottom: none;
}

.article-score {
  width: 30px;
  text-align: center;
  font-weight: bold;
  font-size: 14px;
}

.article-link {
  flex: 1;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.article-link:hover {
  background-color: #e8e8e8;
  text-decoration: underline;
}

.article-category-badge {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  padding: 2px 6px;
  background-color: white;
  border-radius: 3px;
  border: 1px solid #e0e0e0;
}

/* ===================== FOOTER ===================== */

.footer {
  max-width: 1200px;
  margin: 60px auto 40px;
  padding: 30px 20px;
  border-top: 3px solid #1a1a1a;
  text-align: center;
  font-size: 13px;
  color: #666;
  line-height: 1.8;
}

.footer strong {
  color: #1a1a1a;
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
}

.footer-social {
  margin-bottom: 15px;
}

.footer-social a {
  color: #666;
  text-decoration: none;
  margin: 0 15px;
  font-weight: 600;
  transition: color 0.3s;
}

.footer-social a:hover {
  color: #a62639;
}

.footer-copyright {
  margin-bottom: 10px;
}

.footer-disclaimer {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: #999;
}

.loading {
  text-align: center;
  padding: 60px;
  color: #666;
  font-size: 16px;
}

/* ===================== RESPONSIVE DESIGN ===================== */

/* Mobile Styles - 768px and below */
@media (max-width: 768px) {
  .header-top {
    flex-direction: row;
    justify-content: space-between;
    margin-bottom: 10px;
  }

  .hamburger-menu {
    display: block;
  }

  .tagline {
    display: none;
  }

  .nav {
    display: none;
    flex-direction: column;
    padding: 0;
    border-top: none;
  }

  .nav.active {
    display: flex;
  }

  .main-nav-links {
    flex-direction: column;
    gap: 0;
  }

  .nav a {
    padding: 10px 15px;
    border-top: 1px solid #e0e0e0;
    font-size: 13px;
    text-align: center;
  }

  .header-auth-section {
    width: 100%;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
  }

  .auth-buttons {
    gap: 5px;
    width: 100%;
    justify-content: center;
  }

  .login-btn,
  .register-btn,
  .logout-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .user-menu {
    width: 100%;
    justify-content: center;
  }

  .username {
    font-size: 12px;
  }

  .region-sidebar {
    display: none;
  }

  .dashboard-title {
    font-size: 20px;
  }

  .dashboard-subtitle {
    font-size: 13px;
  }

  .filters-section {
    padding: 15px;
  }

  .filter-group {
    min-width: 100%;
  }
}

/* Desktop/Laptop Styles - 769px and above */
@media (min-width: 769px) {
  .logo-image {
    height: 120px;
  }

  .tagline {
    display: block;
    font-size: 24px;
    margin-top: 10px;
  }

  .nav a {
    padding: 15px 20px;
    font-size: 26px;
  }

  .dashboard-title {
    font-size: 32px;
  }

  .dashboard-subtitle {
    font-size: 14px;
  }
}

/* Large Screens - 1200px and above */
@media (min-width: 1200px) {
  .logo-image {
    height: 150px;
  }

  .tagline {
    font-size: 28px;
  }

  .dashboard-title {
    font-size: 36px;
  }

  .dashboard-subtitle {
    font-size: 16px;
  }
}

/* ===================== NEW MOCKUP DESIGN STYLES ===================== */

/* Container */
.tracker-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  background-color: #f5f5f5;
}

/* Filters Section */
.tracker-filters {
  background: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.filter-label-new {
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 600;
  color: #666;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
  display: block;
}

.filter-select-new,
.filter-input-new {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.filter-select-new:focus,
.filter-input-new:focus {
  outline: none;
  border-color: #a62639;
}

/* Data Freshness Indicator */
.data-freshness {
  font-size: 11px;
  color: #666;
  text-align: center;
  padding: 10px;
  background: #f9f9f9;
  border-radius: 4px;
  margin-bottom: 15px;
}

.data-freshness strong {
  color: #2e7d32;
}

/* Metrics Row */
.metrics-row-new {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.metric-card-new {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  text-align: center;
}

.metric-label-new {
  font-size: 11px;
  text-transform: uppercase;
  color: #666;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.metric-value-new {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 5px;
}

.metric-value-new.positive {
  color: #2e7d32;
}

.metric-value-new.negative {
  color: #c62828;
}

.metric-value-new.neutral {
  color: #757575;
}

.metric-subtitle-new {
  font-size: 13px;
  color: #666;
}

/* Two Column Layout */
.two-column-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

/* Chart Card */
.chart-card-new {
  background: white;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.chart-header-new {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.chart-title-new {
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Articles Section */
.articles-section-new {
  margin-top: 0;
}

.section-header-new {
  background: white;
  padding: 15px 20px;
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid #e0e0e0;
}

.section-title-new {
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Article Cards */
.article-card-new {
  background: white;
  padding: 20px;
  border-bottom: 1px solid #e0e0e0;
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 20px;
  align-items: start;
  transition: background 0.2s;
}

.article-card-new:hover {
  background: #fafafa;
}

.article-card-new:last-child {
  border-radius: 0 0 8px 8px;
}

.article-image-new {
  width: 120px;
  height: 80px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-image-new img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

.article-content-new {
  flex: 1;
}

.article-title-new {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #222;
  line-height: 1.4;
}

.article-meta-new {
  font-size: 12px;
  color: #666;
  margin-bottom: 10px;
}

.article-summary-new {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
  margin-bottom: 10px;
}

.article-tags-new {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-new {
  display: inline-block;
  padding: 3px 8px;
  background: #f0f0f0;
  border-radius: 3px;
  font-size: 11px;
  color: #666;
}

/* Article Metrics */
.article-metrics-new {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 220px;
}

.metric-badge-new {
  background: #f5f5f5;
  padding: 10px;
  border-radius: 4px;
  text-align: center;
}

.metric-badge-label-new {
  font-size: 10px;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 4px;
  font-weight: 600;
}

.metric-badge-value-new {
  font-size: 20px;
  font-weight: 700;
}

.metric-badge-value-new.positive {
  color: #2e7d32;
}

.metric-badge-value-new.negative {
  color: #c62828;
}

.metric-badge-value-new.neutral {
  color: #333;
}

.metric-badge-small-new {
  font-size: 14px;
  font-weight: 600;
  margin-top: 2px;
}

.metric-badge-small-new.positive {
  color: #2e7d32;
}

.metric-badge-small-new.negative {
  color: #c62828;
}

.metric-badge-small-new.neutral {
  color: #666;
}

.confidence-bar-new {
  margin-top: 8px;
}

.confidence-bar-bg-new {
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  overflow: hidden;
}

.confidence-bar-fill-new {
  height: 100%;
  background: #2e7d32;
  border-radius: 2px;
  transition: width 0.3s;
}

/* Sidebar */
.sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-section-new {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sidebar-title-new {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 15px;
  color: #333;
}

.sector-item-new {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}

.sector-item-new:last-child {
  border-bottom: none;
}

.sector-name-new {
  color: #555;
}

.sector-value-new {
  font-weight: 600;
  color: #2e7d32;
}

/* Responsive Design */
@media (max-width: 968px) {
  .two-column-layout {
    grid-template-columns: 1fr;
  }

  .article-card-new {
    grid-template-columns: 1fr;
  }

  .article-metrics-new {
    flex-direction: row;
    min-width: auto;
    flex-wrap: wrap;
  }

  .tracker-container {
    padding: 15px;
  }

  .filter-row {
    grid-template-columns: 1fr;
  }

  .metrics-row-new {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .article-image-new {
    width: 80px;
    height: 60px;
  }

  .article-title-new {
    font-size: 14px;
  }

  .metric-value-new {
    font-size: 32px;
  }
}
