/* ===========================
   Nincompoops Investments CSS
   =========================== */

/* --- Base --- */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #ffffff;
  color: #333;
}

/* --- Navbar --- */
.navbar {
  box-shadow: 0 2px 4px rgba(0,0,0,.08);
  background-color: #fff !important;
  padding: 0.5rem 1.5rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.navbar-brand img {
  height: 42px;
  width: auto;
}

.brand-text {
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  line-height: 1.1;
  white-space: nowrap;
}

.brand-blue {
  color: #003087;
}

.brand-red {
  color: #c00;
}

.navbar .nav-link {
  font-weight: 500;
  color: #555 !important;
  padding: 0.5rem 0.85rem !important;
  border-radius: 4px;
  transition: background-color 0.15s, color 0.15s;
}

.navbar .nav-link:hover {
  background-color: #f0f0f0;
  color: #000 !important;
}

.navbar .nav-item.current .nav-link {
  color: #c00 !important;
  font-weight: 600;
}

/* --- Stock Pulse Nav Item --- */
.nav-link-stock-pulse {
  background: linear-gradient(135deg, #7c3aed, #a855f7, #6d28d9) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  font-weight: 600 !important;
  white-space: nowrap;
}

.nav-link-stock-pulse:hover {
  background: linear-gradient(135deg, #5b21b6, #7c3aed, #4c1d95) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

@keyframes beta-shimmer {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

@keyframes beta-glow {
  0%, 100% { box-shadow: 0 0 4px rgba(139,92,246,0.5); }
  50%       { box-shadow: 0 0 10px rgba(139,92,246,0.9), 0 0 18px rgba(109,40,217,0.4); }
}

.beta-badge {
  display: inline-block;
  background: linear-gradient(135deg, #6d28d9, #a855f7);
  background-size: 200% auto;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  background-clip: unset !important;
  -webkit-background-clip: unset !important;
  font-size: 0.5rem;
  font-weight: 700;
  padding: 0.12rem 0.38rem;
  border-radius: 20px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: super;
  margin-left: 0.2rem;
  line-height: 1.2;
  text-shadow: none;
  border: 1px solid rgba(255,255,255,0.2);
  isolation: isolate;
  animation: beta-shimmer 3s linear infinite, beta-glow 2.5s ease-in-out infinite;
  cursor: pointer;
}

body.dark-mode .nav-link-stock-pulse {
  background: linear-gradient(135deg, #c084fc, #a855f7, #e879f9) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

body.dark-mode .nav-link-stock-pulse:hover {
  background: linear-gradient(135deg, #e9d5ff, #c084fc, #d8b4fe) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* --- Page header --- */
.page-header {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
}

.page-header h2 {
  font-weight: 700;
  font-size: 1.9rem;
  margin-bottom: 0.25rem;
}

.page-header .lead {
  color: #666;
}

/* --- Home hero --- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem 3rem;
  text-align: center;
}

.hero img {
  max-width: 420px;
  width: 100%;
  height: auto;
}

.hero-tagline {
  margin-top: 1.25rem;
  font-size: 1.15rem;
  color: #555;
}

/* --- Portfolio grid --- */
.portfolio-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
  padding: 0 1rem 2rem;
}

.stock-card {
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 10px;
  padding: 1.5rem 1.25rem 1.25rem;
  width: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
}

.stock-card:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
  transform: translateY(-3px);
}

.stock-card .logo-wrap {
  height: 72px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.stock-card .logo-wrap img {
  max-height: 72px;
  max-width: 140px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.stock-card .company-name {
  font-size: 0.88rem;
  color: #555;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.stock-card .ticker-badge {
  display: inline-block;
  background-color: transparent;
  color: #003087;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.18rem 0.65rem;
  border-radius: 20px;
  border: 1px solid #003087;
  letter-spacing: 0.05em;
}

/* --- Content sections --- */
.content-section {
  max-width: 720px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.content-card {
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 10px;
  padding: 2rem;
}

/* --- Contact --- */
.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.contact-item .label {
  font-weight: 600;
  min-width: 70px;
  color: #333;
}

.contact-item a {
  color: #c00;
  text-decoration: none;
}

.contact-item a:hover {
  text-decoration: underline;
}

/* --- Testimonials --- */
.testimonial-section {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.testimonial-card {
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.testimonial-card h5 {
  font-weight: 700;
  margin-bottom: 1rem;
  color: #333;
}

.testimonial-card video {
  width: 100%;
  max-width: 540px;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

/* --- Stock price & gain badges --- */
.stock-card .current-price {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 0.5rem;
  color: #333;
}

.stock-card .gain-dollar,
.stock-card .gain-pct {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 0.3rem;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.stock-card .gain-loading {
  background: #f0f0f0;
  color: #aaa;
}

.stock-card .gain-positive {
  background: #e6f4ea;
  color: #1a7c3e;
}

.stock-card .gain-negative {
  background: #fce8e8;
  color: #c00;
}

/* --- Gains iframe --- */
.gains-container {
  padding: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}

.gains-container iframe {
  width: 100%;
  min-height: 600px;
  border: none;
  border-radius: 8px;
}

/* --- Stock card clickable --- */
.stock-card {
  cursor: pointer;
}

/* --- Chart modal --- */
.chart-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.chart-modal-box {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 700px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.25);
  overflow: hidden;
}

.chart-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e2e2;
}

.chart-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #333;
}

.chart-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #999;
  cursor: pointer;
  padding: 0 0.25rem;
}

.chart-modal-close:hover {
  color: #333;
}

.chart-range-group {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
  margin-right: 0.75rem;
}

.chart-range-btn {
  background: none;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #555;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.chart-range-btn:hover {
  background-color: #f0f0f0;
  color: #333;
}

.chart-range-btn.active {
  background-color: #003087;
  border-color: #003087;
  color: #fff;
}

.chart-modal-body {
  padding: 1.25rem;
  min-height: 260px;
  position: relative;
}

.chart-loading {
  text-align: center;
  color: #aaa;
  font-size: 0.95rem;
  padding: 3rem 0;
}

.chart-error {
  text-align: center;
  color: #c00;
  font-size: 0.9rem;
  padding: 2rem 0;
}

/* --- Konami Code Easter Egg --- */
/*
 * Seamless downward cascade math:
 * Hard-stop period P ≈ 400px at 135deg.
 * Y-only seamless shift = P × √2 ≈ 566px.
 * Hard duplicate stops = blocky retro stripes (no blending).
 * background-attachment: fixed removed — it breaks animation compositing.
 */
@keyframes konami-rainbow-flow {
  from { background-position: 0 0; }
  to   { background-position: 0 566px; }
}

body.konami-rainbow {
  min-height: 100vh !important;
  background-image: repeating-linear-gradient(
    135deg,
    #ff0000   0px, #ff0000  57px,
    #ff8800  57px, #ff8800 114px,
    #ffff00 114px, #ffff00 171px,
    #00cc00 171px, #00cc00 228px,
    #00ccff 228px, #00ccff 285px,
    #0000ff 285px, #0000ff 342px,
    #cc00ff 342px, #cc00ff 400px
  ) !important;
  background-position: 0 0;
  animation: konami-rainbow-flow 3s linear infinite !important;
}

body.konami-rainbow::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent    0px,
    transparent    2px,
    rgba(0,0,0,0.18) 2px,
    rgba(0,0,0,0.18) 3px
  );
}

/* --- Dark Mode Toggle Switch --- */
.dark-mode-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  margin: 0;
  padding: 0.25rem 0.5rem;
  user-select: none;
}

.dark-mode-toggle input {
  display: none;
}

.toggle-track {
  width: 36px;
  height: 20px;
  background: #ccc;
  border-radius: 20px;
  position: relative;
  display: inline-block;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.dark-mode-toggle input:checked + .toggle-track {
  background: #00cc66;
}

.dark-mode-toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(16px);
}

.toggle-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: #555;
}

/* --- Dark Mode --- */
body.dark-mode {
  background-color: #0a0a0a;
  color: #00e676;
}

body.dark-mode .navbar {
  background-color: #111 !important;
  box-shadow: 0 2px 4px rgba(0,255,100,0.08);
}

body.dark-mode .navbar .nav-link {
  color: #00cc66 !important;
}

body.dark-mode .navbar .nav-link:hover {
  background-color: #1a2a1a;
  color: #00ff88 !important;
}

body.dark-mode .navbar .nav-item.current .nav-link {
  color: #00ff88 !important;
}

body.dark-mode .navbar-toggler {
  border-color: #00cc66;
}

body.dark-mode .navbar-toggler-icon {
  filter: invert(60%) sepia(100%) saturate(400%) hue-rotate(100deg) brightness(1.2);
}

body.dark-mode .brand-blue {
  color: #00e676;
}

body.dark-mode .brand-red {
  color: #66ff99;
}

body.dark-mode .page-header h2 {
  color: #00e676;
}

body.dark-mode .page-header .lead {
  color: #66bb6a;
}

body.dark-mode .hero-tagline {
  color: #66bb6a;
}

body.dark-mode .stock-card {
  background: #111;
  border-color: #1b4d2e;
}

body.dark-mode .stock-card:hover {
  box-shadow: 0 6px 18px rgba(0,255,100,0.15);
}

body.dark-mode .stock-card .company-name {
  color: #66bb6a;
}

body.dark-mode .stock-card .ticker-badge {
  color: #00e676;
  border-color: #00e676;
}

body.dark-mode .stock-card .current-price {
  color: #00e676;
}

body.dark-mode .stock-card .gain-loading {
  background: #1a2a1a;
  color: #4a7a4a;
}

body.dark-mode .stock-card .gain-positive {
  background: #0a2a14;
  color: #00e676;
}

body.dark-mode .stock-card .gain-negative {
  background: #2a0a0a;
  color: #ff6b6b;
}

body.dark-mode .content-card {
  background: #111;
  border-color: #1b4d2e;
  color: #00e676;
}

body.dark-mode .contact-item .label {
  color: #00e676;
}

body.dark-mode .contact-item a {
  color: #00ff88;
}

body.dark-mode .testimonial-card {
  background: #111;
  border-color: #1b4d2e;
}

body.dark-mode .testimonial-card h5 {
  color: #00e676;
}

body.dark-mode .site-footer {
  background: #111;
  border-top-color: #1b4d2e;
  color: #4a7a4a;
}

body.dark-mode .chart-modal-box {
  background: #111;
}

body.dark-mode .chart-modal-header {
  border-bottom-color: #1b4d2e;
}

body.dark-mode .chart-modal-title {
  color: #00e676;
}

body.dark-mode .chart-modal-close {
  color: #4a7a4a;
}

body.dark-mode .chart-modal-close:hover {
  color: #00e676;
}

body.dark-mode .chart-range-btn {
  border-color: #1b4d2e;
  color: #66bb6a;
}

body.dark-mode .chart-range-btn:hover {
  background-color: #1a2a1a;
  color: #00e676;
}

body.dark-mode .chart-range-btn.active {
  background-color: #00cc66;
  border-color: #00cc66;
  color: #000;
}

body.dark-mode .chart-loading {
  color: #4a7a4a;
}

body.dark-mode .chart-error {
  color: #ff6b6b;
}

body.dark-mode .toggle-label {
  color: #00cc66;
}

body.dark-mode .toggle-track {
  background: #00cc66;
}

/* --- Footer --- */
.site-footer {
  border-top: 1px solid #e2e2e2;
  background: #fff;
  text-align: center;
  padding: 1.25rem;
  font-size: 0.82rem;
  color: #999;
  margin-top: 3rem;
}
