/* =========================================================================
   THE INVESTING SCHOOL — SITE-WIDE DESIGN SYSTEM (v2)
   =========================================================================
   This file is linked on every page, AFTER each page's own <style> block,
   so anything defined here refines/extends the existing look without
   touching the per-page markup or the inline CSS that already exists.

   HOW TO CHANGE YOUR MAIN COLORS:
   Scroll to "1. DESIGN SETTINGS" right below. Change the values there and
   the whole site updates - buttons, cards, glows, gradients, everything
   in this file reads from these few variables. Your original --blue /
   --bg / etc. variables (defined per-page) are untouched, so nothing
   from before this file existed can break.
   ========================================================================= */


/* =========================================================================
   1. DESIGN SETTINGS  — edit these to reskin the whole site
   ========================================================================= */
:root {
  --primary:        #0099ff;   /* same blue you already use */
  --primary-light:  #38bdf8;
  --secondary:      #7c3aed;   /* violet accent - used sparingly for premium feel */
  --accent:         #06b6d4;   /* cyan - used for highlights/ticks */
  --success:        #10b981;
  --danger:         #ef4444;
  --gold:           #f59e0b;

  --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  --gradient-text:    linear-gradient(90deg, var(--primary) 0%, var(--accent) 50%, var(--secondary) 100%);
  --glow-primary:     0 0 40px rgba(0,153,255,0.35);
  --glow-secondary:   0 0 40px rgba(124,58,237,0.30);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --glow-primary:   0 0 50px rgba(56,189,248,0.30);
  --glow-secondary: 0 0 50px rgba(167,139,250,0.28);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}


/* =========================================================================
   2. GLOBAL / GRID BACKGROUND / SCROLLBAR
   ========================================================================= */
.tis-grid-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(0,153,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,153,255,0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}
[data-theme="dark"] .tis-grid-bg {
  background-image:
    linear-gradient(rgba(56,189,248,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,189,248,0.08) 1px, transparent 1px);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--primary), var(--secondary)); border-radius: 10px; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }


/* =========================================================================
   3. NAVBAR POLISH
   ========================================================================= */
.nav-links a {
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute; left: 0; bottom: -6px; height: 2px; width: 0%;
  background: var(--gradient-primary);
  transition: width 0.3s var(--ease-premium);
  border-radius: 2px;
}
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

#main-header {
  transition: box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}
#main-header.tis-scrolled {
  box-shadow: 0 8px 30px rgba(0,20,60,0.08);
}
[data-theme="dark"] #main-header.tis-scrolled {
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}


/* =========================================================================
   4. BUTTONS - shine sweep + glow lift
   ========================================================================= */
.btn-hero, .btn-green, .btn-outline, .bm-btn-primary, .btn-submit-auth {
  position: relative;
  overflow: hidden;
  transition: transform 0.35s var(--ease-premium), box-shadow 0.35s var(--ease-premium);
}
.btn-hero::before, .btn-green::before, .bm-btn-primary::before, .btn-submit-auth::before {
  content: '';
  position: absolute; top: 0; left: -60%;
  width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.7s ease;
  pointer-events: none;
}
.btn-hero:hover::before, .btn-green:hover::before, .bm-btn-primary:hover::before, .btn-submit-auth:hover::before {
  left: 130%;
}
.btn-hero:hover, .btn-green:hover, .bm-btn-primary:hover, .btn-submit-auth:hover {
  transform: translateY(-3px);
  box-shadow: var(--glow-primary);
}
.btn-outline:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}


/* =========================================================================
   5. PREMIUM CARDS - lift, animated gradient border, soft glow
   ========================================================================= */
.fcard, .course-card, .plan-card, .bm-two-cols > div, .ci-card {
  position: relative;
  transition: transform 0.45s var(--ease-premium), box-shadow 0.45s var(--ease-premium);
}
.fcard::before, .course-card::before, .ci-card::before {
  content: '';
  position: absolute; inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient-text);
  opacity: 0;
  transition: opacity 0.4s ease;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.fcard:hover, .course-card:hover, .ci-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 24px 50px rgba(0,20,60,0.14);
}
[data-theme="dark"] .fcard:hover, [data-theme="dark"] .course-card:hover, [data-theme="dark"] .ci-card:hover {
  box-shadow: 0 24px 50px rgba(0,0,0,0.5);
}
.fcard:hover::before, .course-card:hover::before, .ci-card:hover::before { opacity: 1; }


/* =========================================================================
   6. HEADINGS - animated gradient text + underline accent
   ========================================================================= */
.tis-gradient-text {
  background: var(--gradient-text);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: tisTextSweep 4s ease-in-out infinite;
}
@keyframes tisTextSweep {
  0%, 100% { background-position: 0% center; }
  50%      { background-position: 100% center; }
}
.tis-heading-accent {
  position: relative; display: inline-block;
}
.tis-heading-accent::after {
  content: '';
  position: absolute; left: 0; bottom: -8px;
  width: 56px; height: 4px; border-radius: 4px;
  background: var(--gradient-primary);
}


/* =========================================================================
   7. SCROLL-REVEAL SYSTEM (independent of any existing per-page script)
   ========================================================================= */
.tis-reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.7s var(--ease-premium), transform 0.7s var(--ease-premium);
}
.tis-reveal.tis-visible { opacity: 1; transform: translateY(0); }
.tis-reveal[data-delay="1"] { transition-delay: 0.08s; }
.tis-reveal[data-delay="2"] { transition-delay: 0.16s; }
.tis-reveal[data-delay="3"] { transition-delay: 0.24s; }
.tis-reveal[data-delay="4"] { transition-delay: 0.32s; }
.tis-reveal[data-delay="5"] { transition-delay: 0.40s; }


/* =========================================================================
   8. FLOATING / GLOW DECORATIVE ELEMENTS (used in hero + section accents)
   ========================================================================= */
.tis-orb {
  position: absolute; border-radius: 50%; filter: blur(60px);
  opacity: 0.5; pointer-events: none; z-index: 0;
  animation: tisOrbFloat 8s ease-in-out infinite;
}
@keyframes tisOrbFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  50%      { transform: translate(12px,-18px) scale(1.06); }
}

.tis-float-card {
  animation: tisCardFloat 5s ease-in-out infinite;
}
.tis-float-card.d2 { animation-delay: 1.4s; animation-duration: 6s; }
.tis-float-card.d3 { animation-delay: 0.7s; animation-duration: 5.6s; }
@keyframes tisCardFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}


/* =========================================================================
   9. AUTH SPLIT LAYOUT (login.html / signup.html)
   ========================================================================= */
.tis-auth-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 0;
  max-width: 1000px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,20,60,0.18);
}
[data-theme="dark"] .tis-auth-split { box-shadow: 0 30px 80px rgba(0,0,0,0.55); }

.tis-auth-visual {
  position: relative;
  background: var(--gradient-primary);
  padding: 48px 40px;
  display: flex; flex-direction: column; justify-content: center;
  color: #fff; overflow: hidden;
}
.tis-auth-visual h3 { font-size: 26px; font-weight: 800; margin: 0 0 12px; line-height: 1.3; }
.tis-auth-visual p { font-size: 14.5px; opacity: 0.92; line-height: 1.6; margin: 0 0 22px; }
.tis-auth-visual .tis-auth-point {
  display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600;
  margin-bottom: 12px; opacity: 0.96;
}
.tis-auth-visual .tis-auth-point i { color: #fff; }

.tis-auth-form-side {
  padding: 48px 40px;
}

@media (max-width: 860px) {
  .tis-auth-split { grid-template-columns: 1fr; max-width: 460px; }
  .tis-auth-visual { display: none; } /* keep mobile focused on the form */
}


/* =========================================================================
   11. TRUST BADGES - proper pill styling (was bare unstyled text)
   ========================================================================= */
.bm-trust-item {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  padding: 10px 20px !important;
  border-radius: 50px !important;
  box-shadow: 0 6px 18px rgba(0,20,60,0.08);
  color: var(--text-main, #0f1e3c) !important;
}
[data-theme="dark"] .bm-trust-item {
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

/* =========================================================================
   12. RESPONSIVE SAFETY NET
   ========================================================================= */
@media (max-width: 480px) {
  .tis-float-card, .ai-float-chip { display: none; }
}

/* Found during responsive QA: these two-column layouts had no mobile
   fallback and would squeeze awkwardly on small screens. */
@media (max-width: 760px) {
  .tis-two-col-hero { grid-template-columns: 1fr !important; }
  .tis-two-col-form { grid-template-columns: 1fr !important; }
}
