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

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

/* ===================== HERO SECTION ===================== */

.hero-section {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  background: white;
  overflow: hidden;
  margin-bottom: 40px;
}

.hero-image-wrapper {
  width: 100%;
  min-height: 400px;
  overflow: hidden;
  grid-column: 1;
}

.hero-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-image-placeholder {
  background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
}

.hero-content {
  padding: 30px 20px 30px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  grid-column: 2;
}

.hero-labels {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.hero-label {
  display: inline-block;
  background: #a62639;
  color: white;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-category {
  display: inline-block;
  background: #1a1a1a;
  color: white;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-title {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 15px;
  color: #1a1a1a;
  font-family: Georgia, serif;
}

.hero-subtitle {
  font-size: 16px;
  color: #555;
  line-height: 1.6;
  margin-bottom: 12px;
}

.hero-meta-info {
  display: flex;
  gap: 25px;
  margin-bottom: 20px;
  font-size: 13px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  flex-direction: column;
}

.meta-label {
  color: #999;
  font-size: 11px;
  text-transform: uppercase;
}

.meta-value {
  color: #333;
  font-weight: 600;
  margin-top: 2px;
}

.meta-value.high {
  color: #a62639;
  font-weight: 700;
}

.hero-takeaway {
  background: #f5f5f5;
  padding: 15px;
  border-left: 4px solid #a62639;
  margin-bottom: 25px;
  font-size: 13px;
  line-height: 1.6;
}

.takeaway-title {
  display: block;
  margin-bottom: 5px;
  color: #1a1a1a;
  font-weight: 700;
}

.takeaway-text {
  color: #555;
}

.hero-cta {
  display: inline-block;
  background: #1a1a1a;
  color: white;
  padding: 12px 28px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.3s;
  width: fit-content;
  border: none;
  cursor: pointer;
}

.hero-cta:hover {
  background: #a62639;
}

/* ===================== INDICATORS BANNER ===================== */

.indicators-banner {
  background: #1a1a1a;
  color: white;
  padding: 20px 0;
  margin: 40px 0;
}

.indicators-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  text-align: center;
}

.indicator-box {
  display: flex;
  flex-direction: column;
}

.indicator-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
  margin-bottom: 8px;
}

.indicator-number {
  font-size: 32px;
  font-weight: 900;
}

.indicator-number.green {
  color: #4caf50;
}

.indicator-number.orange {
  color: #ff9800;
}

.indicator-number.blue {
  color: #2196f3;
}

.indicator-date {
  font-size: 12px;
  opacity: 0.6;
  margin-top: 5px;
}

/* ===================== SECTION HEADER & FILTERS ===================== */

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 35px;
  padding-bottom: 15px;
  border-bottom: 3px solid #1a1a1a;
}

.section-title {
  font-size: 26px;
  font-weight: 900;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  font-family: Georgia, serif;
}

.section-filters {
  display: flex;
  gap: 15px;
  font-size: 12px;
  flex-wrap: wrap;
}

.filter-link {
  color: #666;
  text-decoration: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color 0.3s;
  padding-bottom: 2px;
  white-space: nowrap;
  cursor: pointer;
}

.filter-link:hover {
  color: #a62639;
}

.filter-link.active {
  color: #a62639;
  border-bottom: 2px solid #a62639;
}

/* ===================== STORIES GRID ===================== */

.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.story-card {
  background: white;
  overflow: hidden;
  transition: transform 0.3s;
  cursor: pointer;
}

.story-card:hover {
  transform: translateY(-5px);
}

.story-image-wrapper {
  height: 200px;
  overflow: hidden;
  position: relative;
}

.story-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-image-placeholder {
  background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
}

.story-category-tag {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(26, 26, 26, 0.9);
  color: white;
  padding: 6px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.story-content {
  padding: 20px;
  border-left: 4px solid transparent;
  transition: border-color 0.3s;
}

.story-card:hover .story-content {
  border-left-color: #a62639;
}

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

.story-day {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #a62639;
  letter-spacing: 1px;
}

.story-sentiment {
  font-size: 11px;
  font-weight: 700;
}

.story-sentiment.bullish {
  color: #4caf50;
}

.story-sentiment.bearish {
  color: #ef5350;
}

.story-sentiment.mixed {
  color: #ff9800;
}

.story-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.3;
  color: #1a1a1a;
  margin-bottom: 10px;
  font-family: Georgia, serif;
}

.story-title a {
  color: inherit;
  text-decoration: none;
}

.story-title a:hover {
  color: #a62639;
}

.story-excerpt {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 12px;
}

.story-meta {
  font-size: 12px;
  color: #999;
  font-style: italic;
}

/* ===================== 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: #a62639;
  text-decoration: none;
  margin: 0 15px;
  font-weight: 600;
  transition: color 0.3s;
}

.footer-social a:hover {
  color: #1a1a1a;
}

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

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

  .hero-section {
    display: flex;
    flex-direction: column;
  }

  .hero-image-wrapper {
    order: 2;
    margin: 15px 0;
    min-height: 200px;
  }

  .hero-image-placeholder {
    min-height: 200px;
    font-size: 50px;
  }

  .hero-content {
    order: 1;
    padding: 15px;
  }

  .hero-title {
    font-size: 24px;
  }

  .hero-subtitle {
    font-size: 16px;
  }

  .hero-takeaway {
    order: 3;
  }

  .hero-meta-info {
    order: 2;
  }

  .stories-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .section-filters {
    gap: 10px;
    font-size: 11px;
  }
}

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

  .hero-title {
    font-size: 36px;
  }

  .hero-subtitle {
    font-size: 17px;
  }

  .hero-takeaway {
    font-size: 14px;
  }

  .meta-label {
    font-size: 11px;
  }

  .meta-value {
    font-size: 13px;
  }

  .story-excerpt {
    font-size: 14px;
  }

  .story-meta {
    font-size: 12px;
  }
}

/* Large Screens - 1200px and above */
@media (min-width: 1200px) {
  .logo-image {
    height: 150px;
  }

  .tagline {
    font-size: 28px;
  }

  .hero-subtitle {
    font-size: 18px;
  }

  .hero-takeaway,
  .takeaway-text {
    font-size: 16px;
  }

  .story-excerpt {
    font-size: 16px;
  }
}