/* Forces padding to stay INSIDE the width boundaries */
*, *::before, *::after {
  box-sizing: border-box;
}

/* --- THEME VARIABLES --- */
:root {
  --bg: #f8f9fa;
  --text: #111;
  --box-bg: #ffffff;
  --box-shadow: rgba(0,0,0,0.05);
  --nav-border: #ddd;
  --footer-bg: #eee;
}

body.dark {
  --bg: #0f1115;
  --text: #e8e8e8;
  --box-bg: #1a1c20;
  --box-shadow: rgba(0,0,0,0.4);
  --nav-border: #333;
  --footer-bg: #1a1c20;
}

/* --- BASE STYLES --- */
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.header {
    padding: 20px 20px 0 20px; /* Removes the bottom padding completely */
    text-align: center;
}

.site-title {
  font-size: 28px;
  font-weight: 600;
  text-align: center;
}

.nav {
  display: flex;
  justify-content: center;
  align-items: center; /* same vertical center */
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--nav-border);
  flex-wrap: nowrap;
}

.nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: color 0.2s ease;
}

.theme-btn {
  font-size: 0; /* hides the text */
  position: relative;
  /* content: "\263D"; */
  background: none;
  border: 1px solid var(--nav-border);
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text);
}

.theme-btn::before {
  content: "\263D"; /* black moon */
  font-size: 16px;  /* restore visible size */
}

/* --- EMERGING DROPDOWN MENU --- */
.dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.dropbtn {
  background: none;
  border: none;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

/* The floating box */
.dropdown-content {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 150%; /* Pushes it down initially */
  left: 50%;
  transform: translateX(-50%) translateY(10px); /* Starts slightly lower for the 'emerging' effect */
  background-color: var(--box-bg);
  min-width: 200px;
  border: 1px solid var(--nav-border);
  border-radius: 12px;
  box-shadow: 0 8px 24px var(--box-shadow);
  z-index: 100;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 10px 0;
}

/* The little upward arrow (Border) */
.dropdown-content::before {
  content: "";
  position: absolute;
  bottom: 100%; 
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px;
  border-style: solid;
  border-color: transparent transparent var(--nav-border) transparent;
}

/* The little upward arrow (Inner Color to match background) */
.dropdown-content::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px;
  border-style: solid;
  border-color: transparent transparent var(--box-bg) transparent;
}

/* The links inside the dropdown */
.dropdown-content a {
  color: var(--text);
  padding: 12px 20px;
  text-decoration: none;
  display: block;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}

.dropdown-content a:hover {
  background-color: var(--bg); /* Highlights the row smoothly */
  color: #6ab0ff; /* Subtle blue text highlight */
}

/* Hover triggers the emerging animation */
.dropdown:hover .dropdown-content {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0); /* Snaps smoothly into place */
}

.dropdown:hover .dropbtn {
  color: #6ab0ff;
}

/* --- LAYOUT & GRID --- */
.layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 20px;
  flex: 1;
}

@media (min-width: 900px) {
  .layout { flex-direction: row; align-items: flex-start; }
  .grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1600px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}

/* --- BOX / CARD STYLING --- */
.item {
  width: 100%; 
}

.box {
  position: relative;
  background-color: var(--box-bg);
  border: 1px solid var(--nav-border);
  border-radius: 12px;
  padding: 20px;
  padding-bottom: 30px; /* Extra room for the X-axis labels */
  box-shadow: 0 2px 6px var(--box-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.box:hover {
  box-shadow: 0 8px 24px var(--box-shadow);
  transform: translateY(-2px);
}

.box-link {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10;
}

.box-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.box-title {
  font-size: 16px;
  font-weight: 600;
}

.tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--nav-border);
  color: var(--text);
  font-size: 11px;
  cursor: help;
  position: relative;
  z-index: 20;
}

/* --- TOOLTIP HOVER LOGIC --- */
.tooltip::after {
  content: attr(data-tip); /* Pulls the text out of your HTML attribute */
  position: absolute;
  bottom: 130%; /* Floats it just above the question mark */
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  width: 180px;
  background-color: #111; /* Sleek dark grey/black */
  color: #fff; /* Crisp white text */
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  text-align: center;
  line-height: 1.4;
  pointer-events: none; /* Stops the tooltip itself from interfering with the mouse */
  
  /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* The Hover Trigger */
.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0); /* Smoothly lifts up */
}

/* Text Colors */
.status { font-size: 11px; font-weight: 700; margin-left: auto; letter-spacing: 0.5px; }
.status.open { color: #10b981; }
.status.closed { color: #6b7280; }

.change { font-size: 14px; font-weight: 600; }
.change.positive { color: #10b981; }
.change.negative { color: #ef4444; }
.change.neutral { color: #6b7280; }

/* --- SPARKLINE & AXIS LABELS --- */
.sparkline-wrapper {
  width: 100%;
  height: 60px;
  margin-top: 15px;
  position: relative;
}

.sparkline {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.sparkline-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.sparkline-fill {
  stroke: none;
}

/* Axis Labels */
.axis-label {
  position: absolute;
  font-size: 11px;
  font-weight: 500;
  color: #999;
  z-index: 5;
  pointer-events: none;
}

.y-max { top: -10px; right: 0; }
.y-min { bottom: -5px; right: 0; }
.x-start { bottom: -20px; left: 0; }
.x-end { bottom: -20px; right: 45px; }

/* --- FOOTER & MISC --- */
/* --- INTRO TEXT --- */
.intro-text {
  max-width: 800px; /* Keeps line lengths comfortable for reading */
  margin: 30px auto; /* Centers the block and pushes it away from the nav/grid */
  text-align: center;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  opacity: 0.8; /* Softens the text so it doesn't compete with the logo */
  padding: 0 20px; /* Prevents text from touching the screen edges on mobile */
}

/* --- FOOTER & SEO TEXT --- */
.footer {
  background: var(--footer-bg);
  color: var(--text);
  margin-top: 60px; /* Creates distinct separation from the bottom of the grid */
  padding: 40px 20px;
  text-align: center;
  border-top: 1px solid var(--nav-border); /* Clean separating line */
}

.seo-text {
  max-width: 800px;
  margin: 0 auto 30px auto; /* Centers the SEO block */
}

.seo-text p {
  font-size: 13px; /* Smaller font for SEO text */
  line-height: 1.6;
  opacity: 0.6; /* Grays it out heavily so it's unobtrusive */
  margin-bottom: 15px;
}

.legal {
  border-top: 1px solid var(--nav-border);
  max-width: 400px;
  margin: 0 auto;
  padding-top: 20px;
}

.legal p {
  font-size: 12px;
  opacity: 0.4;
  margin: 0;
}

.ad-placeholder, .hidden-field {
  display: none !important;
}

/* --- FORM STYLES --- */
.input-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.input-group input,
.input-group textarea {
  padding: 12px;
  border: 1px solid var(--nav-border);
  border-radius: 8px;
  background: var(--bg); /* Matches dark/light mode automatically */
  color: var(--text);
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.input-group input:focus,
.input-group textarea:focus {
  outline: none;
  border-color: #6ab0ff; /* Subtle blue glow on focus */
  box-shadow: 0 0 0 3px rgba(106, 176, 255, 0.1);
}

.form-btn {
  background: var(--text); /* Black in light mode, White in dark mode */
  color: var(--bg);
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.1s ease;
  width: 100%;
}

.form-btn:hover {
  opacity: 0.8;
}

.form-btn:active {
  transform: scale(0.98);
}

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

.form-status {
  margin-top: 15px;
  font-size: 14px;
  text-align: center;
  font-weight: 600;
  min-height: 20px; /* Prevents layout jump when text appears */
}

.form-status.success { color: #10b981; } /* Green */
.form-status.error { color: #ef4444; } /* Red */

/* --- CSS LOGO BANNER --- */
.logo-container {
  background-color: #2b5783; 
  color: #ffffff;
  text-align: center;
  margin: 0 auto 0 auto; 
  
  /* --- THE TWEAK --- */
  /* Reduced the side padding from 20px down to 5px so the giant text has room to breathe */
  padding: 40px 5px; 
  
  border-radius: 12px; 
  box-sizing: border-box; 
  
  /* Widened from 90% to 95% to maximize mobile screen space */
  width: 95%; 
  max-width: 800px; 
  box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
}

.brand-name {
  font-family: 'Playfair Display', serif;
  
  /* --- THE ORIGINAL BIG SIZE IS BACK --- */
  font-size: clamp(48px, 8vw, 90px); 
  font-weight: 400;
  
  /* Added these two lines just in case someone has an incredibly tiny phone */
  /* It ensures that if the text DOES have to wrap, the two lines stack beautifully */
  line-height: 1.1; 
  letter-spacing: -1px; /* Tucks the letters just slightly tighter */
}

.slogan {
  font-family: 'Inter', sans-serif; /* Your requested font */
  font-size: clamp(14px, 3vw, 24px); 
  font-weight: 300;
  letter-spacing: 1px; /* Spreads out the slogan to match the image */
  opacity: 0.9; /* Softens the white slightly so the brand name pops */
}

body.dark .logo-container {
  background-color: #1a1c20; /* Changes to dark grey in dark mode */
}

/* --- MONETIZATION & SIDEBAR --- */

/* 1. Mobile-Specific Sponsor Blocks (Inside the Grid) */
.mobile-sponsor {
  display: block; /* Visible by default on mobile phones */
  grid-column: 1 / -1; /* Forces the banner to span the full width of the mobile grid */
  margin: 10px 0;
  text-align: center;
}

.mobile-sponsor img {
  max-width: 85%; /* Shrinks the banner slightly on mobile as requested */
  height: auto;
  border-radius: 6px;
  background-color: #ffffff;
  padding: 10px;
  box-sizing: border-box;
}

/* 2. Desktop Sidebar (Hidden on Mobile) */
.sidebar {
  display: none; /* Completely hidden on mobile phones */
  padding: 0 20px 20px 20px;
  box-sizing: border-box;
}

/* 3. Shared Sponsor Card Styling */
.sponsor-label {
  font-size: 11px;
  color: #999;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  display: block;
}

.sponsor-card {
  background-color: var(--box-bg);
  border: 1px solid var(--nav-border);
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 2px 6px var(--box-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sponsor-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--box-shadow);
}

/* --- THE DESKTOP SWITCH --- */
@media (min-width: 900px) {
  /* Turn OFF the mobile banners */
  .mobile-sponsor {
    display: none !important; 
  }
  
  /* Turn ON the right sidebar */
  .sidebar {
    display: block; 
    width: 280px;
    flex-shrink: 0;
    padding: 20px 20px 20px 0;
    position: sticky; /* Follows the user as they scroll */
    top: 20px;
  }
}

/* --- SUBPAGE LAYOUT --- */
.subpage-container {
  max-width: 800px; /* Keeps the content from stretching too wide on desktop monitors */
  margin: 0 auto; /* Automatically centers the container perfectly */
  padding: 20px; /* Gives nice breathing room on the left/right for mobile screens */
  display: flex;
  flex-direction: column;
  gap: 25px; /* Creates clean, even spacing between the chart and the text blocks */
}

.sponsor-shoutout {
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  background-color: var(--box-bg);
  border: 1px solid var(--nav-border);
  padding: 12px;
  border-radius: 8px;
}

.sponsor-shoutout a {
  color: #6ab0ff; /* S&P 500 accent color */
  font-weight: 600;
  text-decoration: none;
}

.sponsor-shoutout a:hover {
  text-decoration: underline;
}

.info-text-area {
  background-color: var(--box-bg);
  border: 1px solid var(--nav-border);
  border-radius: 12px;
  padding: 30px;
  line-height: 1.7;
  font-size: 16px;
  box-shadow: 0 2px 6px var(--box-shadow);
  margin-bottom: 40px; /* Pushes the footer down slightly */
}

.info-text-area h2 {
  margin-top: 0;
  margin-bottom: 15px;
}

/* --- FOOTER MENU --- */
.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin: 10px 0 30px 0;
  flex-wrap: wrap; /* Lets them stack neatly on tiny phone screens */
}

.footer-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.6; /* Keeps them subtle */
  transition: opacity 0.2s ease, color 0.2s ease;
}

.footer-links a:hover {
  opacity: 1;
  color: #6ab0ff; /* Subtle blue highlight on hover */
  text-decoration: underline;
}

/* --- BROKER REVIEW CARDS --- */
.review-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

.review-card {
  display: flex;
  background-color: var(--box-bg);
  border: 1px solid var(--nav-border);
  border-radius: 12px;
  padding: 15px;
  align-items: center;
  gap: 15px;
  box-shadow: 0 2px 6px var(--box-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.review-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--box-shadow);
}

/* Left side: Logo container */
.review-logo {
  flex-shrink: 0;
  width: 90px;
  height: 60px;
  background-color: #ffffff; /* Always white so logos pop */
  border-radius: 8px;
  border: 1px solid #eee;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
  box-sizing: border-box;
}

.review-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Right side: Text and Buttons */
.review-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.review-intro {
  font-size: 13px;
  color: var(--text);
  opacity: 0.8;
  line-height: 1.4;
  margin-bottom: 5px;
  
  /* Forces the text to cut off perfectly at 2 lines with an ellipsis (...) */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.review-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap; /* Allows buttons to stack safely on ancient, tiny phones */
}

/* The "Money" Button */
.btn-signup {
  background-color: #10b981; /* Matches the market-up green */
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: opacity 0.2s;
}

.btn-signup:hover {
  opacity: 0.8;
}

/* The "Info" Button */
.btn-review {
  background-color: transparent;
  color: var(--text);
  border: 1px solid var(--nav-border);
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: background-color 0.2s;
}

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

/* The Mini Disclaimer */
.review-disclaimer {
  font-size: 11px;
  color: var(--text);
  opacity: 0.5; /* Keeps it legally visible, but visually quiet */
  margin-top: 4px;
  line-height: 1.3;
}

.review-disclaimer a {
  color: inherit;
  text-decoration: underline;
}

.review-disclaimer a:hover {
  opacity: 0.8;
}

/* Institutional Asset Labels */
.asset-labels {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text);
  opacity: 0.5; /* Keeps it strictly in the background */
  margin-top: 15px;
  font-weight: 600;
  text-align: center;
}

.asset-labels .divider {
  margin: 0 10px;
  opacity: 0.4;
}

/* --- INDIVIDUAL REVIEW PAGE LAYOUT --- */
.review-page-wrapper {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

/* Left Sidebar Placeholder (Hidden on mobile, 160px wide on desktop) */
.review-sidebar-left {
  flex-shrink: 0;
  width: max-content;  /* Hugs the exact width of the ad */
  height: max-content; /* Hugs the exact height of the ad */
  position: sticky;    /* Optional: Makes the ad follow the user as they scroll */
  top: 20px;
}

/* Main Content Area */
.review-main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 30px;
  min-width: 0; /* Prevents overflow bugs on mobile */
}

/* The Top Block: Logo + Text */
.review-hero-block {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap; /* Allows stacking on mobile */
}

.review-hero-logo {
  width: 200px;
  height: 200px;
  flex-shrink: 0;
  background-color: #ffffff;
  border: 1px solid var(--nav-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  box-sizing: border-box;
  box-shadow: 0 2px 6px var(--box-shadow);
}

.review-hero-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.review-hero-text {
  flex-grow: 1;
  min-width: 250px;
  
  /* --- THE NEW BOX STYLING --- */
  background-color: var(--box-bg);
  border: 1px solid var(--nav-border);
  border-radius: 12px;
  padding: 30px; /* Gives the text plenty of breathing room */
  box-shadow: 0 2px 6px var(--box-shadow);
  box-sizing: border-box; /* Ensures the padding doesn't break your grid */
}

.review-hero-text p {
  line-height: 1.6;
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--text);
  opacity: 0.9;
}

/* The "Wall Street" CTA Button */
.wall-street-cta {
  display: inline-block;
  background-color: #10b981; /* The 'Market Up' Green */
  color: #ffffff;
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-decoration: none;
  border-radius: 4px; /* Sharp, institutional edges */
  transition: opacity 0.2s, transform 0.1s;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.wall-street-cta:hover {
  opacity: 0.9;
}

.wall-street-cta:active {
  transform: translateY(2px);
}

/* Ad Banner ph */
.ad-banner-horizontal {
  width: 100%;
  display: flex;
  justify-content: center; /* Centers the ad if it's narrower than the screen */
  margin: 10px 0;
}

/* Mobile Adjustments */
@media (max-width: 900px) {
  .review-sidebar-left {
    display: none !important; /* Forces the sidebar away on phones */
  }
  .review-hero-block {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* --- SOCIAL --- */
.social-links-container {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 40px 0; /* Gives perfect breathing room before the contact form */
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  background-color: var(--box-bg);
  border: 1px solid var(--nav-border);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-decoration: none;
  border-radius: 4px; /* Sharp, edges */
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px var(--box-shadow);
}

/* High-contrast inversion on hover */
.social-link:hover {
  border-color: var(--text); 
  background-color: var(--text);
  color: var(--bg);
  transform: translateY(-2px); /* Subtle lift */
}
