/* ==========================================================================
   Helper — Shared Tokens, Resets, Components, Motion
   Used across pages. No behavior changes.
   ========================================================================== */

/* Themed text selection  */
::selection {
  background: #a3b18a;
  color: #000000;
}
::-moz-selection {
  background: #a3b18a;
  color: #1b1b1b;
}

/* Ensure inputs/textarea selections match too */
input::selection,
textarea::selection {
  background: rgba(163, 177, 138, 0.35);
  color: #1b1b1b;
}

:root {
  --bg: #1b1b1b;
  --paper: #232323;
  --ink: #e9e9e9;
  --muted: #cfcfcf;
  --accent: #a3b18a;
  --line: #e9e9e924;
  --ring: #a3b18a47;

  --r: 18px;
  --ease: cubic-bezier(0.25, 0.6, 0.2, 1);
  --shadow: 0 18px 80px rgba(0, 0, 0, 0.45);

  --d-fade: 500ms;
  --d-slide: 600ms;
  --d-scale: 520ms;

  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 22px;

  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica Neue, Arial;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  /* overflow-x: hidden; */
}
body {
  overflow-x: hidden;
}
a,
button {
  font: inherit;
}

/* Generic layout helpers shared by many screens */
.field {
  position: relative;
}
input {
  width: 100%;
  background: #202020;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 46px 14px 16px;
  font-size: 14px;
  outline: none;
  transition: border-color 180ms var(--ease), box-shadow 200ms var(--ease),
    transform 120ms var(--ease);
}
input:focus {
  border-color: var(--ring);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  transform: translateY(-1px);
}
input.valid-soft {
  box-shadow: 0 0 0 2px rgba(163, 177, 138, 0.22);
  border-color: rgba(163, 177, 138, 0.38);
  transition: box-shadow 600ms var(--ease), border-color 600ms var(--ease);
}

/* Generic label / helpers */
label {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}
.label-icon {
  margin-right: 6px;
}

/* =========================================
   FocusFlow — Leaf seal  Brand
   ========================================= */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  isolation: isolate;
  will-change: transform, filter;
  transition: transform 300ms var(--ease), filter 300ms var(--ease);
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.16));
}
.brand:hover {
  transform: translateY(-1px);
  filter: saturate(1.04);
}
.brand h1 {
  margin: 0;
  line-height: 1;
  font-size: clamp(20px, 2.4vw, 24px);
  font-weight: 900;
  letter-spacing: 0.2px;
  color: var(--ink);
  text-shadow: 0 0.5px 0 rgba(255, 255, 255, 0.12),
    0 1.2px 8px rgba(0, 0, 0, 0.22);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}
.brand h1::after {
  content: "";
  display: block;
  height: 1px;
  width: 40%;
  margin-top: 6px;
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    rgba(163, 177, 138, 0) 100%
  );
  border-radius: 1px;
  transform-origin: left center;
  transform: scaleX(0.92);
  opacity: 0.85;
  animation: ff-brand-breathe 3.8s ease-in-out infinite;
}
.brand::after {
  content: "";
  position: absolute;
  left: -8px;
  right: -8px;
  top: -6px;
  bottom: -6px;
  border-radius: 16px;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    60% 60% at 30% 50%,
    rgba(163, 177, 138, 0.08),
    transparent 60%
  );
  transition: opacity 320ms var(--ease);
  z-index: -1;
}
.brand:hover::after,
.brand:focus-within::after {
  opacity: 1;
}
.brand .seal {
  flex: 0 0 auto;
  filter: saturate(1.02);
}

@keyframes ff-brand-breathe {
  0%,
  100% {
    transform: scaleX(0.92) translateZ(0);
    opacity: 0.85;
  }
  50% {
    transform: scaleX(1.02) translateZ(0);
    opacity: 0.95;
  }
}

.seal {
  --size: 20px;
  --accent-1: var(--accent);
  --accent-2: #8fa07b;
  --ink-dk: #141414;
  position: relative;
  width: var(--size);
  height: var(--size);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}
.seal--leaf {
  position: relative;
  isolation: isolate;
  background: radial-gradient(
    140% 140% at 100% 0%,
    var(--accent-1) 0%,
    var(--accent-2) 62%,
    #586346 100%
  );
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(0, 0, 0, 0.22),
    inset 0 6px 10px rgba(255, 255, 255, 0.06);
}
.seal--leaf::before {
  content: "";
  position: absolute;
  inset: 2.5px;
  border-radius: 52% 42% 52% 42%/48% 44% 52% 44%;
  background: linear-gradient(
        130deg,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0.22) 50%,
        rgba(255, 255, 255, 0) 60%
      )
      no-repeat,
    radial-gradient(
      60% 60% at 25% 75%,
      rgba(255, 255, 255, 0.1),
      transparent 60%
    );
  background-size: 200% 200%, 100% 100%;
  background-position: -60% 0%, center;
  mix-blend-mode: screen;
  filter: saturate(1.05);
  animation: ff-leaf-morph 2.8s ease-in-out infinite,
    ff-leaf-sheen 2.6s ease-in-out infinite;
  will-change: transform, background-position;
}
.seal--leaf::after {
  content: "🌿";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
  line-height: 1;
  filter: drop-shadow(0 0.2px 0 rgba(255, 255, 255, 0.25));
  opacity: 0.95;
  transform-origin: 50% 60%;
  animation: ff-leaf-sway 2.2s ease-in-out infinite;
}
.brand:hover .seal--leaf,
.brand:focus-within .seal--leaf {
  filter: saturate(1.1);
}
.brand:hover .seal--leaf::before,
.brand:focus-within .seal--leaf::before {
  animation-duration: 2.2s, 2s;
}
.brand:hover .seal--leaf::after,
.brand:focus-within .seal--leaf::after {
  animation-duration: 1.8s;
}

@keyframes ff-leaf-morph {
  0%,
  100% {
    transform: scale(0.96) skewX(0) rotate(0);
    opacity: 0.92;
  }
  50% {
    transform: scale(1.06) skewX(-5deg) rotate(2deg);
    opacity: 0.98;
  }
}
@keyframes ff-leaf-sheen {
  0%,
  30% {
    background-position: -60% 0%, center;
  }
  50% {
    background-position: 50% 0%, center;
  }
  100% {
    background-position: 160% 0%, center;
  }
}
@keyframes ff-leaf-sway {
  0% {
    transform: translateY(0) rotate(-6deg) scale(1);
    opacity: 0.95;
  }
  50% {
    transform: translateY(-0.6px) rotate(6deg) scale(1.04);
    opacity: 1;
  }
  100% {
    transform: translateY(0) rotate(-6deg) scale(1);
    opacity: 0.95;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand,
  .brand h1,
  .brand h1::after {
    animation: none !important;
    transition: none !important;
  }
  .brand::after {
    opacity: 0 !important;
  }
  .seal--leaf::before,
  .seal--leaf::after {
    animation: none !important;
  }
}

.helper {
  margin-top: var(--space-1);
  font-size: 13px;
  color: var(--muted);
}
.caps {
  margin-top: 8px;
  font-size: 12px;
  color: #ffdede;
}

/* Buttons */
.btn,
.t,
.key,
.oauth a {
  appearance: none;
  cursor: pointer;
  transition: transform 180ms var(--ease), box-shadow 180ms var(--ease);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}
.btn {
  background: #202020;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  user-select: none;
  min-height: 36px;
  min-width: 64px;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px #0000003d;
}
.btn.primary {
  background: var(--accent);
  color: #1b1b1b;
  border: none;
  font-weight: 800;
}

/* Eye toggle (shared component) */
.eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #202020;
  display: grid;
  place-items: center;
}
.eye:hover {
  transform: translateY(-50%) translateY(-1px);
}
.eye svg {
  width: 20px;
  height: 20px;
}
.eye .iris {
  transition: transform 180ms var(--ease), opacity 180ms var(--ease);
}
.eye .slash {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  transition: stroke-dashoffset 220ms var(--ease), opacity 220ms var(--ease);
}
.eye[data-state="visible"] .iris {
  transform: scale(0.9);
  opacity: 0.9;
}
.eye[data-state="visible"] .slash {
  stroke-dashoffset: 0;
  opacity: 1;
}

/* Strength UI (shared) */
.strength {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  min-height: 28px;
  animation: fadeSlideIn var(--d-slide) var(--ease) both;
}
.meter {
  display: flex;
  gap: 4px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #202020;
  transition: background 200ms var(--ease), border-color 200ms var(--ease);
}
.dot.on {
  background: var(--accent);
  border-color: rgba(0, 0, 0, 0.25);
}
.note-s {
  font-size: 12px;
  color: var(--muted);
}
.breathe {
  display: inline-block;
  animation: gentleScale var(--d-scale) ease-in-out infinite;
}

/* Chips & links shared */
.match {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.match.ok {
  color: #cfe7c7;
}
.match.bad {
  color: #ffdede;
}
.link {
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

/* Focus outlines (accessible yet quiet) */
button:focus,
a:focus,
input:focus {
  outline: 2px solid rgba(163, 177, 138, 0.28);
  outline-offset: 3px;
}

.question-edit-compact {
    width: 100%;
}

.edit-meta {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

.difficulty-select {
    background: var(--bg);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    min-width: 80px;
}

.edit-buttons {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.btn-save, .btn-cancel {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    display: grid;
    place-items: center;
    cursor: pointer;
    font-size: 12px;
}

.btn-save {
    background: var(--accent);
    color: #1b1b1b;
}

.btn-cancel {
    background: var(--paper);
    color: var(--muted);
    border: 1px solid var(--line);
}

/* Animations shared */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes gentleScale {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes shake {
  0% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(3px);
  }
  50% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(2px);
  }
  100% {
    transform: translateX(0);
  }
}

/* petals css */

.petal, .landing-petal {
    position: absolute;
    width: 20px;
    height: 20px;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.leaf-svg {
    width: 100%;
    height: 100%;
    color: var(--accent); /* Use theme accent color */
    transform-origin: center;
    animation: leaf-rotate linear forwards;
}

/* Leaf color variations using theme palette */
.leaf-1 { color: var(--leaf-primary); }
.leaf-2 { color: var(--leaf-secondary); }
.leaf-3 { color: var(--leaf-tertiary); }
.leaf-4 { color: var(--leaf-dark); }

@keyframes leaf-rotate {
    0% {
        transform: rotate(0deg) scale(0.8);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

/* Keep the existing petal-fall animation but adjust for leaves */
@keyframes petal-fall {
    0% {
        opacity: 0;
        transform: translateY(-30px) translateX(0px) rotate(0deg) scale(0.7);
    }
    10% {
        opacity: 0.9;
        transform: translateY(0px) translateX(10px) rotate(45deg) scale(1);
    }
    30% {
        opacity: 0.8;
        transform: translateY(100px) translateX(-5px) rotate(90deg) scale(1);
    }
    60% {
        opacity: 0.7;
        transform: translateY(250px) translateX(8px) rotate(180deg) scale(0.9);
    }
    90% {
        opacity: 0.4;
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) translateX(15px) rotate(360deg) scale(0.6);
    }
}

@keyframes landing-petal-fall {
    0% {
        opacity: 0;
        transform: translateY(-30px) translateX(0px) rotate(0deg) scale(0.7);
    }
    10% {
        opacity: 0.8;
        transform: translateY(0px) translateX(10px) rotate(45deg) scale(1);
    }
    30% {
        opacity: 0.7;
        transform: translateY(100px) translateX(-5px) rotate(90deg) scale(1);
    }
    60% {
        opacity: 0.6;
        transform: translateY(250px) translateX(8px) rotate(180deg) scale(0.9);
    }
    90% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) translateX(15px) rotate(360deg) scale(0.6);
    }
}


/* Desktop-only utility class */
.desktop-only {
  display: block;
}

.mobile-hidden {
  display: none;
}

@media (max-width: 1100px) {
  .desktop-only {
    display: none !important;
  }
  
  .mobile-hidden {
    display: none !important;
  }
}

/* ==========================================================================
   Custom Scrollbar Styling - Global
   Available across all pages
   ========================================================================== */

/* Custom scrollbar for WebKit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 3px;
    transition: background 200ms var(--ease);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* Custom scrollbar for specific containers with different widths */
.questions-list::-webkit-scrollbar {
    width: 6px;
}

.todo-list::-webkit-scrollbar {
    width: 4px;
}

.dropdown-content::-webkit-scrollbar {
    width: 4px;
}

.dropdown-content::-webkit-scrollbar-track {
    background: var(--paper);
}

/* Firefox scrollbar styling */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--line) var(--bg);
}

/* Smooth scrolling for all scrollable elements */
html {
    scroll-behavior: smooth;
}

/* Enhanced smooth scrolling for content areas */
.questions-list,
.todo-list,
.todo-list-container,
.dropdown-content {
    scroll-behavior: smooth;
}

/* Mobile-optimized scrollbars */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 3px; /* Thinner on mobile */
    }
    
    * {
        scrollbar-width: thin;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    html,
    .questions-list,
    .todo-list,
    .todo-list-container,
    .dropdown-content {
        scroll-behavior: auto;
    }
    
    ::-webkit-scrollbar-thumb {
        transition: none;
    }
}


