/* ==========================================================================
   Furlders UI — Purple + Pink
   (Bootstrap-friendly; pairs with your style.css)
   ========================================================================== */

/* === Design tokens ======================================================= */
:root{
  /* Brand */
  --brand:       #FE4FB4;   /* primary pink */
  --brand-600:   #EC399F;   /* deeper pink for gradients/shadows */
  --ink:         #0F0E47;   /* dark inky purple for focus/borders */

  /* Purples (for primary buttons / alt emphasis) */
  --primary-700: #272757;
  --primary-600: #0F0E47;

  /* Soft surfaces / borders for cards on colored backgrounds */
  --soft:   rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.18);

  /* “Cute” outline pill palette */
  --btn-outline-border: #FFD3EC; /* light pink border */
  --btn-outline-text:   #D73C93; /* readable pink text */
  --btn-outline-hover:  #FFC7E7; /* hover border */
  --btn-outline-bg:     #FFE8F5; /* hover/focus bg */

  /* Focus ring for brand */
  --ring: rgba(254,79,180,.25);  /* #FE4FB4 @ 25% */

  /* Typo */
  --font-sans: "Poppins", system-ui, -apple-system, Segoe UI, Roboto,
               "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-display: "Pacifico", cursive;

  /* Rounding */
  --radius: 12px;

  /* Header height (runtime-adjusted by header-init.js) */
  --header-h: 72px;
}

/* === Base / Global ======================================================= */
body{
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.brand-title{
  font-family: var(--font-display);
  color: var(--brand);
}

/* Keep content below fixed header on EVERY page */
main.page-container{
  padding-top: calc(var(--header-h) + 8px);
}

/* Links: keep inherited color; add gentle hover tint */
a{ color: inherit; text-decoration-color: rgba(255,255,255,.35); }
a:hover{ color: var(--brand); }

/* Navbar active state (subtle pink hint) */
.nav-link.active{ font-weight: 600; color: #FFB8DC !important; }

/* === Page title block (shared across pages) ============================== */
.page-head{
  margin: 6px 0 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.page-title{
  margin: 0;
  color: #fff;
  font-weight: 800;
  line-height: 1.15;
  font-size: clamp(22px, 3.2vw, 40px);
}
.page-title::after{
  content:"";
  display:block;
  width:72px; height:3px; border-radius:3px;
  margin:.5rem auto 0;
  background: linear-gradient(180deg, var(--brand), var(--brand-600));
}
.page-subtitle{
  color: rgba(255,255,255,.85);
  margin-top:.35rem;
  font-size: .98rem;
}

/* === Sections / Cards ==================================================== */
.section-soft{
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card.link-card{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.12);
}
.card.link-card .card-title{ font-weight: 600; }

/* Ensure folder/link images always render correctly */
.folder-card img,
.card .card-img-top,
.card img{
  display:block;
  width:100%;
  height:auto;
  object-fit:cover;
  position:relative;
  z-index:2;
}
.card::before, .card::after,
.folder-card::before, .folder-card::after{ content:none !important; }

/* Optional “image band” helper */
.card .card-img-band{
  min-height:160px;
  background-size:cover;
  background-position:center;
}

/* Lightweight grid helpers (used by legacy link grids) */
.links-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap:14px;
}
.link-card{
  border:1px solid #e6e6e6;
  border-radius:12px;
  padding:12px;
  background:#fff;
}
.link-card h3{ margin:0 0 6px; font-size:16px; line-height:1.3; }
.link-card p { margin:6px 0 10px; color:#444; font-size:14px; }
.link-meta   { display:flex; gap:10px; color:#777; font-size:12px; }
.thumb       { width:100%; height:140px; object-fit:cover; border-radius:8px; background:#f6f6f6; margin-bottom:10px; }
.skeleton    { animation:pulse 1.2s ease-in-out infinite; background:linear-gradient(90deg,#f1f1f1,#ececec,#f1f1f1); background-size:200% 100%; }
@keyframes pulse{ 0%{background-position:0% 0} 100%{background-position:200% 0} }

/* === Accordion polish (All Folders page) ================================= */
#accordionExample .accordion-button,
#accordionExample .accordion-button *{
  font-family: var(--font-sans) !important;
  font-weight: 600;
  font-size: .87em;
}
#accordionExample .accordion-button{
  color:#fff;
  background: rgba(255,255,255,.10);
  border-bottom: 1px solid rgba(255,255,255,.20);
}
#accordionExample .accordion-button:not(.collapsed){
  background: rgba(255,255,255,.14);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.24);
}
#accordionExample .accordion-item{
  background: transparent;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: .6rem;
  overflow: hidden;
}

/* === Buttons (Bootstrap-friendly) ======================================= */
/* Primary = purple */
.btn-primary{
  --bs-btn-bg: var(--primary-700);
  --bs-btn-border-color: var(--primary-700);
  --bs-btn-hover-bg: var(--primary-600);
  --bs-btn-hover-border-color: var(--primary-600);
  --bs-btn-color: #fff;
}
/* Outline purple */
.btn-outline-primary{
  --bs-btn-color: var(--primary-700);
  --bs-btn-border-color: var(--primary-700);
  --bs-btn-hover-bg: var(--primary-700);
  --bs-btn-hover-border-color: var(--primary-700);
  --bs-btn-hover-color: #fff;
}

/* “Cute” outline pill (used for Share / Rename / etc.) */
.btn.btn-ghost{
  color: var(--btn-outline-text);
  background: #fff;
  border: 2px solid var(--btn-outline-border);
  border-radius: 999px;
  padding: .4rem .9rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
}
.btn.btn-ghost:hover,
.btn.btn-ghost:focus{
  background: var(--btn-outline-bg);
  border-color: var(--btn-outline-hover);
  color: var(--brand-600);
  outline: none;
}
.btn.btn-ghost:active{
  background: rgba(254,79,180,.12);
  border-color: var(--brand);
}

/* Filled pink CTA (e.g., “Open”) */
.btn.btn-accent{
  color:#fff;
  background: linear-gradient(180deg, var(--brand), var(--brand-600));
  border: 0;
  border-radius: 999px;
  padding: .4rem .95rem;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(254,79,180,.28);
}
.btn.btn-accent:hover{ filter: brightness(1.05); transform: translateY(-1px); }
.btn.btn-accent:active{ filter: brightness(.98); transform: translateY(0); }

/* Destructive pink (with readable black text) */
.btn.btn-delete{
  background: var(--brand);
  border-color: var(--brand);
  color:#000;
  border-width:2px;
  border-style:solid;
  border-radius:999px;
  font-weight:600;
  padding:.375rem .9rem;
  line-height:1.2;
}
.btn.btn-delete:hover,
.btn.btn-delete:focus{
  background:#ff64c8;
  border-color:#ff64c8;
  color:#000;
  box-shadow: 0 0 0 .2rem var(--ring);
}

/* Focus ring: brand pink everywhere */
.form-control:focus,
.form-select:focus,
.btn:focus,
.btn:focus-visible{
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 .25rem var(--ring) !important;
  outline:0;
}

/* === Forms ============================================================== */
.form-control, .form-select{
  border-radius: 10px;
  border-color: var(--border);
  background-clip: padding-box;
}

/* === Modals (opt-in with .furlders-modal) =============================== */
.modal.furlders-modal .modal-content{
  background:#fff;
  color:#000;
  border:2px solid var(--brand);
  border-radius:16px;
  box-shadow:0 16px 48px rgba(0,0,0,.35);
}
.modal.furlders-modal .modal-header{
  border-bottom:1px solid var(--brand);
}
.modal.furlders-modal .modal-footer{
  border-top:1px solid var(--brand);
}
.modal.furlders-modal .btn-close{ filter:none; }  /* black close icon */

/* Inputs inside themed modals */
.modal.furlders-modal .form-control,
.modal.furlders-modal .form-select{
  color:#000;
  background:#fff;
  border:1px solid #d7d7db;
}
.modal.furlders-modal .form-control::placeholder{ color:#6c757d; }

/* Danger buttons inside themed modals */
.modal.furlders-modal .btn.btn-danger{
  background:var(--brand);
  border-color:var(--brand);
  color:#000;
}
.btn-primary {
    background:var(--brand);
  border-color:var(--brand);
  color:#000;
}
.modal.furlders-modal .btn.btn-danger:hover,
.modal.furlders-modal .btn.btn-danger:focus{
  background:#ff64c8; border-color:#ff64c8; color:#000;
  box-shadow:0 0 0 .2rem var(--ring);
}

/* === Toasts ============================================================= */
.toast-container .toast{
  background:#fff !important;
  color:#000 !important;
  border:1px solid var(--brand);
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}
.toast-container .toast .btn-close{ filter:none; }

/* === Badges / Chips ===================================================== */
.badge-accent, .chip-accent{
  background: #FFB8DC;
  color: #272757;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 999px;
  padding: .25rem .5rem;
}
/* Nav active = same pink for every item */
:root { --active-underline: #FFB8DC; }

/* Shared button tokens */
:root{
  --btn-pill-radius: 9999px;
  --btn-pad-y: .35rem;
  --btn-pad-x: .8rem;
}

/* Ghost action (neutral) */
.btn-ghost {
  background: rgba(15,14,71,.06);
  border: 0;
  border-radius: var(--btn-pill-radius);
  padding: var(--btn-pad-y) var(--btn-pad-x);
  line-height: 1;
}
.btn-ghost:hover { background: rgba(15,14,71,.12); }

/* Destructive action */
.btn-delete {
  background: var(--brand,#FE4FB4);
  color: #fff;
  border: 0;
  border-radius: var(--btn-pill-radius);
  padding: var(--btn-pad-y) var(--btn-pad-x);
  line-height: 1;
}
.btn-delete:hover { filter: brightness(1.05); }

/* Optional: make all small buttons consistent */
.btn.btn-sm,
.btn-ghost.btn-sm,
.btn-delete.btn-sm {
  border-radius: var(--btn-pill-radius);
  padding: .3rem .7rem;
}
/* Shared Furlders button styles */
.btn-ghost {
  background: rgba(15,14,71,.06);
  border: 0;
  border-radius: 9999px;
  padding: .35rem .8rem;
  line-height: 1;
}
.btn-ghost:hover { background: rgba(15,14,71,.12); }

.btn-delete {
  background: var(--brand,#FE4FB4);
  color:#fff;
  border:0;
  border-radius: 9999px;
  padding: .35rem .8rem;
  line-height: 1;
}
.btn-delete:hover { filter: brightness(1.05); }

.btn-outline-secondary {
  background:#FE4FB4;
  color:#fff;
  border:0;
  border-radius:9999px;
  padding:.35rem .8rem;
}
.btn-outline-secondary:hover { background:#EC399F; color:#fff; }

/* ==== Tokens (tweak once, applies everywhere) ==== */
:root{
  --brand: #FE4FB4;          /* pink */
  --brand-600: #EC399F;
  --page-max: 1120px;        /* content width */
  --header-h: 84px;          /* visual header height incl. shadow */
  --page-pad-x: 20px;        /* left/right padding */
  --page-pad-y: 28px;        /* space below header before title */
  --title-underline-h: 4px;  /* underline thickness */
  --title-underline-gap: 10px; /* gap between text and underline */
}

/* ==== Layout shell ==== */
.site-header { min-height: var(--header-h); } /* the actual header element */
.page-wrap    { 
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--page-pad-y) var(--page-pad-x);
}

/* If header is fixed/sticky, give the page breathing room: */
body.has-fixed-header .page-wrap { margin-top: calc(var(--header-h)); }

/* ==== Title with pink underline ==== */
.page-title {
  margin: 0 0 calc(var(--title-underline-gap) + 18px) 0; /* underline gap + extra space to content */
  font-weight: 700;
  line-height: 1.15;
  /* responsive size: adjust to your taste */
  font-size: clamp(28px, 3.2vw + 12px, 48px);
  position: relative;
}
.page-title::after{
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: calc(-1 * var(--title-underline-gap));
  height: var(--title-underline-h);
  background: var(--brand);
  border-radius: 999px;
}

/* ==== Section rhythm (cards, accordions, lists) ==== */
.section + .section { margin-top: 24px; }
.section > .section-title { margin-bottom: 12px; }

/* ==== Button shape unifier (so actions match on every page) ==== */
.btn-ghost {
  background: rgba(15,14,71,.06);
  border: 0; border-radius: 9999px;
  padding: .35rem .8rem; line-height: 1;
}
.btn-ghost:hover { background: rgba(15,14,71,.12); }

.btn-delete {
  background: var(--brand);
  color:#fff; border:0; border-radius:9999px;
  padding:.35rem .8rem; line-height:1;
}
.btn-delete:hover { filter: brightness(1.05); }

/* Optional: ensure all small buttons have same pill radius */
.btn.btn-sm, .btn-ghost.btn-sm, .btn-delete.btn-sm { padding: .45rem .7rem;
border-radius: 10px;
line-height: 1; 
font-size: 1.15em;}

/* Brand primary buttons: purple, including hover/active/focus */
.btn-primary{
  --bs-btn-color: #fff;
  --bs-btn-bg: #2A2751;             /* brand purple */
  --bs-btn-border-color: #2A2751;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #211F40;       /* a bit darker */
  --bs-btn-hover-border-color: #211F40;
  --bs-btn-active-bg: #1B1936;
  --bs-btn-active-border-color: #1B1936;
  --bs-btn-focus-shadow-rgb: 42,39,81; /* focus ring tint */
}

/* Outline variant too (if your header uses it) */
.btn-outline-primary{
  --bs-btn-color: #2A2751;
  --bs-btn-border-color: #2A2751;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #2A2751;
  --bs-btn-hover-border-color: #2A2751;
  --bs-btn-active-bg: #211F40;
  --bs-btn-active-border-color: #211F40;
  --bs-btn-focus-shadow-rgb: 42,39,81;
}
:root { --header-h: 64px; } /* default; JS below will correct this */
body.has-fixed-header { padding-top: var(--header-h); }

/* Optional: tighten page title since we’re adding header padding */
.page-title { margin-top: 0 !important; }