* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
  /* 1. Define the Pure Colors */
  --color-pure-white: rgb(255, 255, 255);
  --color-pure-black: #000000;

  --bg-color: var(--color-pure-white);
  --bg-main: var(--color-pure-white);

  /* For cards/boxes on top of white*/
  --bg-surface: #f2f2f2;

  --text-color: #333333;
  --accent-color: #000000;
  --star-color-rgb: 0, 0, 0;
  --trail-color: rgba(240, 240, 240, 0.2);
}

/* 2. Dark Mode Overrides */
body.dark-mode {
  --bg-color: var(--color-pure-black);
  --bg-main: var(--color-pure-black);

  --bg-surface: #111111;

  --text-color: #dddddd;
  --accent-color: #ffffff;
  --star-color-rgb: 255, 255, 255;
  --trail-color: rgba(0, 0, 0, 0.2);
}

body,
html {
  /* height: 100%; */
  min-height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text-color);
  background-color: var(--bg-main);
  overflow-x: hidden;
}

/* 2. FORCE these specific elements to use that font */
a,
button,
input,
select,
textarea,
li,
span,
div {
  font-family: inherit;
}

/* --- 1. Layout & Trigger --- */
#sidebar-nav {
  position: fixed;
  right: 40px;
  top: 40px;
  width: 200px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  pointer-events: none;
  z-index: 100;
}

/* The Trigger Container (Top Right relative to nav) */
.menu-trigger-container {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 15px;
  pointer-events: auto;
}

/* The "MENU" Button */
#menu-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 1px;
  padding: 10px 20px;
  border-radius: 30px;

  /* DEFAULT STATE: Transparent background, Transparent border */
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

/* STATE 1: HOVER (Intention) 
   When hovering the icon (but it's not open or pinned yet),
   show the border and rotate dots, but keep background clear.
*/
#menu-icon:hover {
  border-color: var(--text-color);
}
#menu-icon:hover .dots {
  transform: rotate(90deg);
}

/* STATE 2: ACTIVE (Action)
   When Open OR Pinned:
   1. Fill Background
   2. Change Text Color
   3. Ensure dots are rotated
*/
#sidebar-nav.open #menu-icon,
#sidebar-nav.pinned #menu-icon {
  background: var(--text-color);
  color: var(--bg-color);
  border-color: var(--text-color);
}

/* Rotating Dots Animation */
.dots {
  display: flex;
  gap: 4px;
  transition: transform 0.3s ease;
}

.dot {
  width: 4px;
  height: 4px;
  background-color: currentColor;
  border-radius: 50%;
}

#sidebar-nav.open .dots,
#sidebar-nav.pinned .dots {
  transform: rotate(90deg);
}

/* --- 1. Main Navigation Wrapper --- */
#sidebar-nav {
  position: fixed;
  right: 40px;
  top: 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  z-index: 100;
  gap: 12px; /* Gap between header row and the popup box */
}

/* KEEP YOUR PINNED LINE LOGIC IF YOU WANT IT */
/* ... (Your existing #sidebar-nav::before code) ... */

/* --- 2. The Header Row (User, Logo, Pin, Menu) --- */
.nav-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

/* Header Icons (User, Pin, etc) styling */
.header-icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  transition: background 0.2s ease, transform 0.2s ease;
}

.header-icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: scale(1.1);
}

/* Dark mode image invert for the logo */
body.dark-mode .header-icon-btn img {
  filter: invert(1);
}

body.dark-mode .brand-logo-container img {
  filter: invert(1);
}

body.dark-mode .imageColorFlip img {
  filter: invert(1);
}

/* The Menu Trigger (Capsule Style) */
#menu-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 8px 16px;
  border-radius: 30px;

  /* Transparent default */
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

#menu-icon:hover {
  border-color: var(--text-color);
}

#sidebar-nav.open #menu-icon,
#sidebar-nav.pinned #menu-icon {
  background: var(--text-color);
  color: var(--bg-color);
  border-color: var(--text-color);
}

/* Dots Animation */
.dots {
  display: flex;
  gap: 4px;
  transition: transform 0.3s ease;
}
.dot {
  width: 4px;
  height: 4px;
  background-color: currentColor;
  border-radius: 50%;
}
#sidebar-nav.open .dots,
#sidebar-nav.pinned .dots {
  transform: rotate(90deg);
}

/* --- 3. The Menu Module (The Pop-Up Box) --- */
.menu-module {
  /* Dimensions & Layout */
  width: 260px; /* Fixed width for the sleek SaaS look */
  background-color: var(--bg-color);

  /* The Lusion/Notion Look: Border + Shadow */
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.1); /* The "Pop" Shadow */

  padding: 10px 0;

  /* Animation State: Hidden by default */
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
  transform-origin: top right;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Show Menu Logic - Tied to your JS classes */
#sidebar-nav.open .menu-module,
#sidebar-nav.pinned .menu-module {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* THICK BORDER WHEN PINNED */
#sidebar-nav.pinned .menu-module {
  border-width: 2px; /* Make it thick */
  border-color: var(--text-color); /* Ensure color is strong */
  box-shadow: none; /* Optional: Remove shadow if you want a flat, "locked-in" look */
}

/* --- 4. Menu Content Styling --- */
.menu-group {
  padding: 5px 0;
}

.group-label {
  display: block;
  padding: 0 16px;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #888; /* Lighter grey for headers */
  letter-spacing: 1px;
}

.menu-module ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-module li {
  margin: 0;
}

.menu-module a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  text-decoration: none;
  color: var(--text-color);
  font-size: 14px; /* Notion Size */
  transition: background 0.2s;
}

.menu-module a:hover {
  background: rgba(0, 0, 0, 0.05); /* Subtle grey hover */
}

.link-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Dividers between groups */
.divider {
  height: 1px;
  background-color: rgba(0, 0, 0, 0.1);
  margin: 5px 0;
}

/* Dark Mode Tweaks for the Module */
body.dark-mode .menu-module {
  box-shadow: 6px 6px 0px rgba(255, 255, 255, 0.1); /* White shadow in dark mode */
  border-color: #444;
  border-color: rgba(255, 255, 255, 0.2);
}
body.dark-mode .divider {
  background-color: rgba(255, 255, 255, 0.1);
}
body.dark-mode .header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* button rool functionality */
/* --- 3. The Rolling Text Effect --- */
.roll-text {
  display: block;
  position: relative;
  overflow: hidden;
  height: 1.2em; /* Height of one line of text */
}

.roll-text span {
  display: block;
  transition: transform 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-group a:hover .original {
  transform: translateY(-100%);
}

.menu-group a:hover .hover-clone {
  transform: translateY(-100%);
}

/* --- 4. The Active Dot --- */
.indicator-dot {
  width: 6px;
  height: 6px;
  background-color: var(--text-color);
  border-radius: 50%;
  display: none;
}

.menu-group li.active .indicator-dot {
  display: block;
}

/* =========================================
   NEW HOME PAGE STYLES (LUSION AESTHETIC)
   ========================================= */
.brand-logo-container {
  position: fixed;
  top: 40px;
  left: 40px;
  z-index: 101; /* Above page container, same level as nav elements */
}

.brand-logo {
  height: 50px; /* Adjust based on your actual logo */
  width: auto;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center;
}

/* 2. Hover State (Mouse Over) */
.brand-logo:hover {
  transform: scale(1.15); /* Scale up by 15% */
}

/* --- 2. The Page Container & The Slide Effect --- */
#page-container {
  /* This container wraps everything that isn't fixed */
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center; /* Center content horizontally */

  /* The Magic Slide Transition */
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* WHEN MENU IS OPEN (Class added to BODY via JS):
   Shift the entire page container to the left.
   Calculation: The menu is about 260px wide + 40px margin = 300px space on right.
   To keep content visually centered in the remaining space, shift left by half that width (~150px).
*/
body.menu-is-open #page-container {
  transform: translateX(-150px);
}

/* --- 3. Hero Section Typography & Layout --- */
.hero-section {
  /* Full height minus header/footer space */
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: center; /* Center vertically */
  align-items: center; /* Center horizontally */
  text-align: center;
  padding: 120px 20px 60px 20px; /* Top padding to clear fixed headers */
  max-width: 1200px;
}

/* Notion-style Greeting */
.greeting-label {
  font-size: 16px;
  font-weight: 500;
  color: #666;
  margin-bottom: 24px;
}

/* Massive Lusion Headline */
.hero-title {
  font-size: clamp(4rem, 8vw, 8rem); /* Responsive massive font */
  font-weight: 800; /* Extra Bold */
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
  color: var(--text-color);
}

/* Combined Description */
.hero-description {
  font-size: 18px;
  line-height: 1.6;
  max-width: 600px;
  color: #555;
  margin-bottom: 60px;
}

body.dark-mode .hero-description {
  color: #aaa;
}

/* --- 4. Play Reel Button Centerpiece --- */
.video-reel-container {
  position: relative;
  width: 100%;
  max-width: 220px;
  height: 75px; /* Fixed height for the banner look */
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 47px;
  overflow: hidden;
  /* Temporary background gradient until you have video */
  background: var(--bg-surface);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

body.dark-mode .video-reel-container {
  background: var(--bg-surface);
  box-shadow: none;
  border: 1px solid #333;
}

.play-reel-btn {
  position: relative;
  z-index: 2;
  background: var(--bg-color);
  color: var(--text-color);
  border: 1px solid transparent;
  padding: 16px 32px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease; /* Added border-color transition */
}

.play-reel-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
  border: solid white;
}

/* Dark Mode: Replace Shadow with Border */
body.dark-mode .play-reel-btn {
  border-color: white; /* Defines the edge against the black bg */
  box-shadow: none; /* Remove invisible shadow */
}

/* --- 5. Scroll Indicators Footer --- */
.scroll-footer {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 1px;
  position: absolute; /* Position at bottom of hero viewport */
  bottom: 0;
  left: 0;
}

.plus-marker {
  font-size: 24px;
  font-weight: 300;
}

/* =========================================
   BELOW THE FOLD STYLES (Placeholders)
   ========================================= */
.content-section {
  width: 100%;
  max-width: 1200px;
  padding: 120px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.section-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.section-subtitle {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 60px;
}

/* Preview Section Styles */
.tracker-preview-mockup {
  width: 100%;
  max-width: 900px;
  background: var(--bg-color);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Dark Mode: Make the tracker border visible */
body.dark-mode .tracker-preview-mockup {
  border-color: #333; /* Stronger grey border */
  box-shadow: none;
}

.mockup-box {
  height: 400px;
  background: var(--bg-surface); /* Placeholder for video/img */
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 12px;
  margin-bottom: 30px;
  font-weight: 600;
  color: #999;
}
body.dark-mode .mockup-box {
  background: var(--bg-surface);
  color: #666;
  border: 1px solid #333;
}

.enter-module-btn {
  padding: 16px 40px;
  background: var(--text-color);
  color: var(--bg-color);
  border: none;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.3s ease;
}
.enter-module-btn:hover {
  opacity: 0.9;
}

/* Featured Work Grid Styles (Lusion 2-col) */
.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  width: 100%;
}

.featured-block {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
  cursor: pointer;
}

.featured-image {
  width: 100%;
  aspect-ratio: 4 / 3; /* Lusion-like aspect ratio */
  background-color: var(--bg-surface); /* Placeholder color */
  border-radius: 24px;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}

body.dark-mode .featured-image {
  background-color: var(--bg-surface);
  border: 1px solid #333; /* Edge definition */
}

.featured-block:hover .featured-image {
  transform: scale(0.98); /* Subtle shrink on hover like Lusion */
}

.tags {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #888;
}

.featured-info h3 {
  font-size: 2rem;
  font-weight: 600;
  margin-top: 8px;
}

/* Responsive adjustments for grid */
@media (max-width: 768px) {
  .featured-grid {
    grid-template-columns: 1fr; /* Stack on mobile */
  }
  .brand-logo-container,
  #sidebar-nav {
    top: 20px;
  }
  .brand-logo-container {
    left: 20px;
  }
  #sidebar-nav {
    right: 20px;
  }
  .scroll-footer {
    padding: 20px;
  }
}

/* User Avatar Circle */
.user-avatar {
  width: 24px;
  height: 24px;
  background-color: var(--text-color); /* Black (or white in dark mode) */
  color: var(--bg-color); /* White (or black in dark mode) */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
  transition: transform 0.2s ease;
}

/* Hover effect */
.header-icon-btn:hover .user-avatar {
  transform: scale(1.1);
}

/* --- SWAP CONTAINER --- */
/* This holds both buttons in the same 36x36px space */
.icon-swap-container {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- SHARED BUTTON STYLES --- */
#visibility-btn,
#pin-btn {
  position: absolute; /* Stack them on top of each other */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- STATE 1: DEFAULT (Menu Closed) --- */
/* Eye is Visible */
#visibility-btn {
  opacity: 1;
  transform: scale(1) rotate(0deg);
  pointer-events: auto;
  z-index: 2;
}
/* Pin is Hidden */
#pin-btn {
  opacity: 0;
  transform: scale(0.5) rotate(-15deg); /* Start small and rotated */
  pointer-events: none;
  z-index: 1;
}

/* --- STATE 2: MENU OPEN (Swap!) --- */
/* Eye Hides */
#sidebar-nav.open #visibility-btn,
#sidebar-nav.pinned #visibility-btn {
  opacity: 0;
  transform: scale(0.5) rotate(15deg);
  pointer-events: none;
}
/* Pin Appears */
#sidebar-nav.open #pin-btn,
#sidebar-nav.pinned #pin-btn {
  opacity: 1;
  transform: scale(1) rotate(0deg);
  pointer-events: auto;
}

/* --- STATE 3: UI HIDDEN (Zen Mode) --- */
/* When .ui-hidden is active, we FORCE the Eye button to be visible 
   (specifically the closed eye svg inside it) regardless of menu state */
body.ui-hidden #sidebar-nav #visibility-btn {
  opacity: 1 !important;
  transform: scale(1) !important;
  pointer-events: auto !important;
}

/* Hide everything else */
body.ui-hidden .brand-logo-container,
body.ui-hidden #sidebar-nav .header-icon-btn:not(#visibility-btn), /* Hides Pin/User/etc */
body.ui-hidden #sidebar-nav #menu-icon {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px);
  transition: all 0.5s ease;
}

/* --- SVG INNER TRANSITIONS --- */
/* Smoothly swap Eye Open / Eye Closed inside the visibility button */
#visibility-btn svg {
  position: absolute;
  transition: all 0.4s ease;
}

/* Default: Open Eye Visible */
.icon-eye-open {
  opacity: 1;
  transform: scale(1);
}
.icon-eye-closed {
  opacity: 0;
  transform: scale(0.5);
}

/* Hidden Mode: Closed Eye Visible */
body.ui-hidden .icon-eye-open {
  opacity: 0;
  transform: scale(0.5);
}
body.ui-hidden .icon-eye-closed {
  opacity: 1;
  transform: scale(1);
}

/* --- Pin Icon Inner Transitions (Keep your existing logic) --- */
#pin-btn svg {
  position: absolute;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.icon-pin {
  opacity: 1;
  transform: translateY(0);
}
.icon-unpin {
  opacity: 0;
  transform: translateY(10px);
}

#sidebar-nav.pinned .icon-pin {
  opacity: 0;
  transform: translateY(-10px);
}
#sidebar-nav.pinned .icon-unpin {
  opacity: 1;
  transform: translateY(0);
}

/* --- Menu Theme Toggle Row --- */
.theme-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px; /* Matches your other menu items */
  color: var(--text-color);
  font-size: 14px;
}

/* The Button Container */
.theme-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
}

/* The Pill Track */
.theme-toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background-color: #e0e0e0; /* Light mode track color */
  border-radius: 20px;
  border: 1px solid transparent;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  overflow: hidden;
}

/* Icons inside the track (Sun/Moon background icons) */
.toggle-icon {
  position: absolute;
  z-index: 1;
  color: #888;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: color 0.3s ease;
}

/* Pin Sun to the left center */
.toggle-icon.sun {
  left: 5px; /* (20px circle width - 12px icon) / 2 = 4px + 1px border offset = 5px */
}

/* Pin Moon to the right center */
.toggle-icon.moon {
  left: 25px; /* 5px left + 20px travel distance = 25px */
}

/* The Sliding Circle */
.toggle-circle {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 20px;
  height: 20px;
  background-color: transparent;
  border: 1px solid black;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.3s ease;
  z-index: 2;
}

/* --- ACTIVE STATE (Dark Mode) --- */
.theme-toggle-switch.active {
  background-color: #333; /* Dark mode track color */
}

.theme-toggle-switch.active .toggle-circle {
  transform: translateX(20px); /* Slide to the right */
  background-color: transparent; /* Dark mode circle color */
  border: 1px solid white;
}

/* Dark Mode Overrides for the Row text/icon */
body.dark-mode .theme-toggle-switch {
  border: 1px solid #555;
}

/* Optional: Make icons brighter when active if you want */
body.dark-mode .toggle-icon {
  color: #aaa;
}

/* --- SETTINGS MODAL (System Control Panel) --- */
.settings-modal {
  max-width: 500px; /* Wider than the attack plan modal */
  border: 1px solid rgba(0, 0, 0, 0.1);
}

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

.close-btn {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #888;
  line-height: 1;
}

.settings-section {
  margin-bottom: 25px;
}

.sub-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  margin-bottom: 6px;
}

.primary-btn {
  width: 100%;
  padding: 14px;
  background: var(--text-color); /* Adaptive Black/White */
  color: var(--bg-color); /* Adaptive White/Black */
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}
.primary-btn:hover {
  opacity: 0.9;
}

.secondary-btn {
  padding: 10px 20px;
  background: transparent;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
}
.secondary-btn:hover {
  border-color: var(--text-color);
}

/* --- DARK MODE SETTINGS --- */
body.dark-mode .settings-modal {
  border-color: #333;
}
body.dark-mode .settings-section {
  border-top-color: #333 !important;
}
body.dark-mode .sub-label {
  color: #888;
}
body.dark-mode .modal-input.disabled {
  background: #222;
  color: #666;
  border-color: #333;
}

/* --- GLOBAL MODAL MECHANICS --- */

/* 1. The Container (Hidden by default, covers whole screen) */
.modal-overlay {
  display: none; /* THIS IS KEY - Hides it on load */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* Dimmed background */
  backdrop-filter: blur(5px); /* That modern blur effect */
  z-index: 1000; /* sits on top of everything */
  justify-content: center;
  align-items: center;
}

/* 2. The Animation (Smooth slide up) */
.modal-content {
  background: #fff;
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 500px; /* Default width */
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.3s ease-out;
  position: relative;
}

.input-group {
  margin-bottom: 20px;
}

.modal-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  color: #888;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.modal-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 5px;
  /* Ensure defaults are set for Light Mode */
  background: #fff;
  color: #333;
}

/* 3. Dark Mode support for the modal */
body.dark-mode .modal-content {
  background: #111;
  border: 1px solid #333;
  color: #fff;
}

body.dark-mode .modal-input {
  background: #222;
  border-color: #444;
  color: #fff;
}

/* 4. Animations */
@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* --- TOAST NOTIFICATION --- */
#toast-container {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  transform: translate(-50%, 20px);
}

#toast-container.toast-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-content {
  background-color: #333;
  color: white;
  padding: 12px 24px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Success State */
.toast-success .toast-content {
  background-color: #10b981;
  color: white;
}
/* Error State */
.toast-error .toast-content {
  background-color: #ef4444;
  color: white;
}

/* --- REEL MODAL STYLES --- */
.reel-content {
  position: relative;
  /* 9:16 Aspect Ratio Logic */
  width: 90vh;
  max-width: 400px; /* Limit width like a phone */
  height: 80vh;

  background: black;
  border-radius: 20px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  animation: popIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

/* Close Button (Top Right) */
.close-reel-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.close-reel-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Controls (Bottom) */
.reel-controls {
  position: absolute;
  bottom: 30px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 30px;
  z-index: 20;
}

.control-btn {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s;
}
.control-btn:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.3);
}

/* Animation */
@keyframes popIn {
  from {
    transform: scale(0.9) translateY(20px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* MOBILE OPTIMIZATION */
@media (max-width: 600px) {
  .reel-content {
    width: 100%;
    height: 100%;
    max-width: none;
    border-radius: 0;
  }
  .close-reel-btn {
    top: 40px;
  } /* Clear notch */
}

/* --- TRANSACTION BADGES --- */
.badge-base {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  display: inline-block;
}

/* 1. Interest (Red) */
.badge-interest {
  background-color: #fee2e2;
  color: #991b1b;
}

/* 2. Payment (Green) */
.badge-payment {
  background-color: #ecfdf5;
  color: #065f46;
}

/* 3. Purchase/Default (Grey) */
.badge-default {
  background-color: #f3f4f6;
  color: #111;
}

/* Dark Mode Overrides for Badges */
body.dark-mode .badge-interest {
  background-color: #450a0a;
  color: #fca5a5;
}
body.dark-mode .badge-payment {
  background-color: #064e3b;
  color: #6ee7b7;
}
body.dark-mode .badge-default {
  background-color: #333;
  color: #ccc;
}

/* --- iOS INSTALL PROMPT --- */
.ios-prompt {
  position: fixed;
  bottom: 40px; /* Position above the Safari toolbar */
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 360px;
  z-index: 5000;
  animation: slideUp 0.5s ease-out;
}

.ios-prompt-content {
  background-color: var(--bg-color); /* Adaptive background */
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* The little arrow pointing down */
.ios-arrow {
  width: 20px;
  height: 20px;
  background-color: var(--bg-color); /* Match background */
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  z-index: -1; /* Behind the box so the border merges */
}

/* Dark Mode Overrides */
body.dark-mode .ios-prompt-content {
  border-color: #333;
}
body.dark-mode .ios-arrow {
  border-color: #333;
}
