:root {
  /* Light Theme Variables */
  --bg-color: #f4f7f6;
  --surface-color: #ffffff;
  --text-primary: #1a1a1b;
  --text-secondary: #57606a;
  --primary-color: #1d9bf0;
  --border-color: #e1e8ed;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --header-bg: #ffffff;
  --accent-bullish: #28a745;
  --accent-bearish: #dc3545;
  --accent-neutral: #6c757d;
  --analysis-bg: #f8f9fa;
  --analysis-border: #e1e8ed;
}

[data-theme='dark'] {
  /* Dark Theme Variables */
  --bg-color: #0d1117;
  --surface-color: #161b22;
  --text-primary: #c9d1d9;
  --text-secondary: #8b949e;
  --primary-color: #58a6ff;
  --border-color: #30363d;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --header-bg: #161b22;
  --analysis-bg: #1c2128;
  --analysis-border: #30363d;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
}

header {
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.main-nav {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--primary-color);
}

.nav-link.active {
  color: var(--text-primary);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.25rem;
}

#theme-toggle {
  background: none;
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background 0.2s ease;
}

/* Landing Page (About) Styles */
.about-hero {
  text-align: center;
  padding: 4rem 0 6rem;
}

.about-hero h2 {
  font-size: 3.5rem;
  font-weight: 900;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.about-hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 2.5rem;
}

.cta-button {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  padding: 1rem 2.5rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(29, 155, 240, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(29, 155, 240, 0.4);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 8rem;
}

.feature-card {
  background: var(--surface-color);
  padding: 2.5rem;
  border-radius: 24px;
  border: 1px solid var(--border-color);
  text-align: center;
  transition: transform 0.3s;
}

.feature-card:hover {
  transform: translateY(-10px);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  display: block;
}

.feature-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.feature-card p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.guide-section {
  background: var(--surface-color);
  padding: 5rem 3rem;
  border-radius: 32px;
  border: 1px solid var(--border-color);
  margin-bottom: 8rem;
}

.guide-section h2 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 4rem;
}

.steps-container {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

.step-item {
  flex: 1;
  text-align: center;
  position: relative;
}

.step-number {
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.5rem;
  margin: 0 auto 1.5rem;
}

.step-item h4 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.step-item p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.mission-section {
  max-width: 800px;
  margin: 0 auto 10rem;
  text-align: center;
}

.mission-section h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
}

.mission-text {
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--text-primary);
}

main {
  max-width: 1200px;
  margin: 4rem auto;
  padding: 0 1.5rem;
}

/* Hero Section Styles */
#hero-section {
  text-align: center;
  margin-bottom: 6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
}

.stats-and-meter-row {
  display: flex;
  width: 100%;
  max-width: 900px;
  justify-content: space-between;
  align-items: stretch;
  gap: 2rem;
}

.trump-illustration img {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 5px solid var(--primary-color);
  object-fit: cover;
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
  transition: transform 0.3s ease;
}

.trump-illustration img:hover {
  transform: scale(1.02);
}

.illustration-label {
  margin-top: 1rem;
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.daily-stats {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, 1fr);
  gap: 1rem;
  background: var(--surface-color);
  padding: 2rem;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
}

.stat-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-left: 1rem;
  border-left: 4px solid var(--primary-color);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.stat-value {
  color: var(--text-primary);
  font-size: 2rem;
  font-weight: 900;
}

.crazy-meter-container {
  flex: 1;
  background: var(--surface-color);
  padding: 2rem;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.meter-title {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.gauge-wrapper {
  position: relative;
  width: 240px;
  height: 120px;
  margin: 0 auto;
  overflow: hidden;
}

.gauge-bg {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: conic-gradient(from 180deg at 50% 50%, 
    #28a745 0deg, 
    #ffc107 90deg, 
    #dc3545 180deg);
  mask: radial-gradient(circle at 50% 50%, transparent 65%, black 66%);
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent 65%, black 66%);
  transform: rotate(90deg);
}

.gauge-needle {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 4px;
  height: 95px;
  background: var(--text-primary);
  transform-origin: bottom center;
  transform: translateX(-50%) rotate(-90deg);
  transition: transform 1s cubic-bezier(0.17, 0.67, 0.83, 0.67);
  border-radius: 4px 4px 0 0;
}

.gauge-needle::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: var(--text-primary);
  border-radius: 50%;
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: bold;
}

.current-status {
  margin-top: 1.5rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
}

/* Content Section Spacing */
.content-section {
  margin-bottom: 6rem;
}

.section-header {
  margin-bottom: 2.5rem;
}

.section-header h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

/* Post Cards Carousel Styles */
.carousel-container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  width: 100%;
}

.carousel-control {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 10;
  font-size: 1.4rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.carousel-control:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.posts-wrapper-outer {
  flex-grow: 1;
  overflow: hidden;
  padding: 1rem 0.5rem;
}

.posts-wrapper {
  display: flex;
  gap: 2rem;
  transition: transform 0.5s ease;
  will-change: transform;
}

.post-card {
  min-width: calc((100% - 4rem) / 3);
  max-width: calc((100% - 4rem) / 3);
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.post-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.post-main-content {
  padding: 1.5rem;
  flex-grow: 1;
}

.post-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.25rem;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin-right: 1rem;
  background-color: var(--primary-color);
}

.user-info .username {
  font-weight: 700;
  display: block;
}

.user-info .timestamp {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.post-content {
  font-size: 1rem;
  line-height: 1.6;
}

.translate-btn {
  background: var(--border-color);
  border: none;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  margin-top: 1rem;
  font-weight: bold;
  transition: all 0.2s ease;
  align-self: flex-start;
}

.translate-btn:hover {
  background: var(--primary-color);
  color: white;
}

/* Redesigned AI Report Section */
.report-section {
  background-color: var(--analysis-bg);
  padding: 1.5rem;
  border-top: 1px solid var(--analysis-border);
  position: relative;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.label-icon {
  font-size: 0.9rem;
}

.analysis-text {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.impact-report {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px dashed var(--analysis-border);
}

.impact-value {
  font-weight: 800;
  font-size: 0.9rem;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
}

.impact-bullish { background: rgba(40, 167, 69, 0.1); color: var(--accent-bullish); }
.impact-bearish { background: rgba(220, 53, 69, 0.1); color: var(--accent-bearish); }
.impact-neutral { background: rgba(108, 117, 125, 0.1); color: var(--accent-neutral); }

/* Blur & Ad Overlay */
.blurred-content {
  filter: blur(10px);
  user-select: none;
  pointer-events: none;
}

.ad-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.02);
  z-index: 5;
}

.btn-view-analysis {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}

.btn-view-analysis:hover {
  transform: scale(1.05);
}

/* Chart Styles */
.chart-container {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--card-shadow);
  height: 450px;
}

/* Market Controls Refinement */
.market-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.search-container {
  display: flex;
  align-items: center;
  gap: 0;
  width: 320px;
}

.search-container input {
  flex-grow: 1;
  padding: 0.6rem 1rem;
  border: 1px solid var(--border-color);
  border-right: none;
  border-radius: 6px 0 0 6px;
  background: var(--surface-color);
  color: var(--text-primary);
  outline: none;
  font-size: 0.95rem;
}

.search-container button {
  padding: 0.6rem 1rem;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 1rem;
  transition: background 0.2s;
}

.search-container button:hover {
  background: var(--border-color);
}

.market-tabs {
  display: flex;
  gap: 0.25rem;
  width: 320px;
}

.tab-btn {
  flex: 1;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  padding: 0.6rem 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  text-align: center;
}

.tab-btn:hover {
  background: var(--border-color);
}

.tab-btn.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.header-with-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.modal-content {
  background-color: var(--surface-color);
  margin: 5% auto;
  padding: 0;
  border: 1px solid var(--border-color);
  width: 90%;
  max-width: 650px;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.modal-inner-content {
  padding: 2.5rem;
}

.close-btn {
  position: absolute;
  right: 1.5rem;
  top: 1.25rem;
  color: var(--text-secondary);
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10;
}

/* Ad Modal Specific */
.ad-modal {
  display: none;
  align-items: center;
  justify-content: center;
}

.ad-content {
  background: #000;
  color: white;
  width: 100%;
  max-width: 500px;
  padding: 3rem;
  border-radius: 28px;
  text-align: center;
}

.ad-video-placeholder {
  height: 200px;
  background: #111;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  margin-bottom: 2rem;
  border: 1px solid #333;
}

.ad-timer-container {
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

#ad-countdown { font-weight: bold; color: var(--primary-color); }

.close-ad-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.8rem 2.5rem;
  border-radius: 30px;
  font-weight: bold;
  cursor: pointer;
  opacity: 0.5;
}

.close-ad-btn:not(:disabled) { opacity: 1; }

.detail-section { margin-top: 1.5rem; position: relative; }
.detail-label { font-weight: 700; font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.5rem; display: block; }
.detail-text { font-size: 1.1rem; line-height: 1.6; }

.impact-score { font-size: 2.5rem; font-weight: 900; margin-top: 0.5rem; }
.score-positive { color: var(--accent-bullish); }
.score-negative { color: var(--accent-bearish); }

/* Mobile Responsive Adjustments */
@media (max-width: 1024px) {
  .post-card {
    min-width: calc((100% - 2rem) / 2);
    max-width: calc((100% - 2rem) / 2);
  }
}

@media (max-width: 768px) {
  main {
    margin: 2rem auto;
    padding: 0 1rem;
  }

  header {
    padding: 1rem;
  }

  .header-left {
    gap: 1rem;
  }

  .header-left h1 {
    font-size: 1.25rem;
  }

  .main-nav {
    gap: 0.75rem;
  }

  .nav-link {
    font-size: 0.85rem;
  }

  #hero-section {
    margin-bottom: 3rem;
    gap: 2rem;
  }

  .stats-and-meter-row {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  .trump-illustration img {
    width: 150px;
    height: 150px;
  }

  .illustration-label {
    font-size: 1.5rem;
  }

  .daily-stats {
    width: 100%;
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }

  .crazy-meter-container {
    width: 100%;
    padding: 1.5rem;
  }

  .gauge-wrapper {
    width: 200px;
    height: 100px;
  }

  .gauge-bg {
    width: 200px;
    height: 200px;
  }

  .gauge-needle {
    height: 80px;
  }

  .content-section {
    margin-bottom: 3.5rem;
  }

  .section-header h2 {
    font-size: 1.4rem;
    text-align: center;
  }

  .carousel-container {
    gap: 0.5rem;
  }

  .carousel-control {
    width: 36px;
    height: 48px;
    border-radius: 8px;
    font-size: 1rem;
  }

  .post-card {
    min-width: 100%;
    max-width: 100%;
    padding: 1.25rem;
  }

  .post-header {
    margin-bottom: 1rem;
  }

  .post-content {
    font-size: 0.95rem;
    min-height: auto;
  }

  .chart-container {
    height: 350px;
    padding: 1rem;
  }

  .header-with-tabs {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }

  .market-controls {
    width: 100%;
  }

  .search-container, .market-tabs {
    width: 100%;
    max-width: 320px;
  }

  /* About Page Mobile */
  .about-hero h2 {
    font-size: 2rem;
  }

  .about-hero p {
    font-size: 1rem;
    padding: 0 1rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    margin-bottom: 4rem;
  }

  .guide-section {
    padding: 3rem 1.5rem;
    margin-bottom: 4rem;
  }

  .steps-container {
    flex-direction: column;
    gap: 3rem;
  }

  .mission-section {
    margin-bottom: 5rem;
  }

  .mission-section h2 {
    font-size: 1.8rem;
  }

  .mission-text {
    font-size: 1rem;
  }

  /* Modal Mobile */
  .modal-content {
    width: 95%;
    margin: 10% auto;
    padding: 1.5rem;
  }

  .modal-inner-content {
    padding: 0;
  }

  .detail-text {
    font-size: 1.1rem;
  }

  .impact-score {
    font-size: 2rem;
  }
}
