/* ==================================================================
   Digital Vault — Main Stylesheet
   White + Pink theme with Dark mode. Single file, CSS variables.
   ================================================================== */

/* ---------- Google Font ---------- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ---------- Theme Variables ---------- */
:root {
  --primary:       #E91E8C;
  --primary-light: #FF6BB5;
  --primary-pale:  #FFF0F7;
  --accent:        #FF1493;
  --white:         #FFFFFF;
  --bg:            #FFF5FA;
  --card-bg:       #FFFFFF;
  --text-dark:     #1A0A12;
  --text-mid:      #5C3D52;
  --text-light:    #9E7A8E;
  --border:        #F0D6E8;
  --shadow:        rgba(233,30,140,0.10);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --shadow-card:  0 4px 24px rgba(233,30,140,0.10);
  --shadow-hover: 0 8px 32px rgba(233,30,140,0.20);

  --header-h: 64px;
  --sidebar-w: 250px;
  --maxw: 1280px;
}

[data-theme="dark"] {
  --primary:       #FF4FA8;
  --primary-light: #FF8AC6;
  --primary-pale:  #2A1620;
  --accent:        #FF1493;
  --white:         #1E1218;
  --bg:            #0F0A0D;
  --card-bg:       #1E1218;
  --text-dark:     #F5D6E8;
  --text-mid:      #D3A9BF;
  --text-light:    #9E7A8E;
  --border:        #3D1F2E;
  --shadow:        rgba(0,0,0,0.4);
  --shadow-card:  0 4px 24px rgba(0,0,0,0.4);
  --shadow-hover: 0 8px 32px rgba(0,0,0,0.55);
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
a { color: inherit; text-decoration: none; }
img, svg { vertical-align: middle; }
ul { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

.icon { display: inline-block; flex-shrink: 0; }

/* ---------- Layout helpers ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius-md); border: none;
  font-weight: 600; cursor: pointer; transition: all .2s ease; font-size: .95rem;
  background: var(--primary-pale); color: var(--primary);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff; box-shadow: var(--shadow-card);
}
.btn-primary:hover { box-shadow: var(--shadow-hover); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-mid); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: .85rem; }
.btn-danger { background: #fdecef; color: #d6336c; }
[data-theme="dark"] .btn-danger { background: #3a1822; color: #ff7aa3; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600;
}
.badge-premium { background: linear-gradient(135deg,#FFD86B,#FF9F1C); color: #5b3b00; }
.badge-free { background: var(--primary-pale); color: var(--primary); }
.badge-active { background: #e3f8ec; color: #1a9e5c; }
.badge-inactive { background: #fbe3e3; color: #cc3a3a; }

/* ==================================================================
   HEADER
   ================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .2s ease;
}
.site-header.scrolled { box-shadow: var(--shadow-card); }
.header-top {
  display: flex; align-items: center; gap: 18px;
  height: var(--header-h);
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; color: var(--text-dark); }
.logo span { background: linear-gradient(135deg,var(--primary-light),var(--primary)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.header-search { flex: 1; max-width: 440px; position: relative; }
.header-search input {
  width: 100%; padding: 10px 14px 10px 40px; border-radius: var(--radius-md);
  border: 1.5px solid var(--border); background: var(--bg); color: var(--text-dark);
  outline: none; transition: border .2s;
}
.header-search input:focus { border-color: var(--primary); }
.header-search .search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-light); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-hover); overflow: hidden; display: none; z-index: 50;
  max-height: 360px; overflow-y: auto;
}
.search-results.show { display: block; }
.search-results a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: var(--text-dark); }
.search-results a:hover { background: var(--primary-pale); }
.search-results .sr-empty { padding: 14px; color: var(--text-light); text-align: center; }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-pale); color: var(--primary); border: none; cursor: pointer; transition: all .2s;
}
.icon-btn:hover { background: var(--primary); color: #fff; }

.avatar {
  width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,var(--primary-light),var(--primary)); color: #fff; font-weight: 600; cursor: pointer;
}
.user-menu { position: relative; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-hover); padding: 8px; display: none; z-index: 60;
}
.dropdown.show { display: block; }
.dropdown a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-dark); }
.dropdown a:hover { background: var(--primary-pale); color: var(--primary); }
.dropdown .dd-head { padding: 8px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown .dd-head strong { display: block; }
.dropdown .dd-head small { color: var(--text-light); }

/* main nav */
.header-nav { border-top: 1px solid var(--border); }
.nav-list { display: flex; align-items: center; gap: 4px; height: 48px; }
.nav-list > li > a { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-md); color: var(--text-mid); font-weight: 500; }
.nav-list > li > a:hover, .nav-list > li.active > a { background: var(--primary-pale); color: var(--primary); }
.has-mega { position: relative; }
.mega {
  position: absolute; top: calc(100% + 6px); left: 0; width: 640px;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hover); padding: 18px; display: none;
  grid-template-columns: repeat(3,1fr); gap: 8px 20px; z-index: 70;
}
.has-mega:hover .mega { display: grid; }
.mega h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-light); margin: 6px 0; grid-column: 1/-1; }
.mega a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--text-dark); font-size: .9rem; }
.mega a:hover { background: var(--primary-pale); color: var(--primary); }
.mega a .icon { color: var(--primary); }

/* hamburger */
.hamburger { display: none; }

/* ==================================================================
   LAYOUT: sidebar + main
   ================================================================== */
.layout { display: flex; gap: 26px; align-items: flex-start; max-width: var(--maxw); margin: 26px auto; padding: 0 20px; }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; position: sticky; top: calc(var(--header-h) + 70px); }
.main { flex: 1; min-width: 0; }
.sidebar-box { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 18px; box-shadow: var(--shadow-card); }
.sidebar-box h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .6px; color: var(--text-light); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.sidebar-search { position: relative; }
.sidebar-search input { width: 100%; padding: 9px 12px 9px 36px; border-radius: var(--radius-md); border: 1.5px solid var(--border); background: var(--bg); outline: none; }
.sidebar-search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-light); }
.cat-list li a, .pop-list li a { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-mid); font-size: .9rem; }
.cat-list li a:hover, .pop-list li a:hover { background: var(--primary-pale); color: var(--primary); }
.cat-count { background: var(--primary-pale); color: var(--primary); border-radius: 999px; padding: 1px 9px; font-size: .72rem; font-weight: 600; }
.pop-list li a { gap: 8px; justify-content: flex-start; }
.pop-list .icon { color: var(--primary); }

/* ==================================================================
   HOMEPAGE
   ================================================================== */
.hero {
  background: linear-gradient(135deg, var(--primary-pale), var(--bg));
  padding: 60px 0; overflow: hidden;
}
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 2.8rem; line-height: 1.15; font-weight: 700; margin-bottom: 16px; }
.hero h1 span { background: linear-gradient(135deg,var(--primary-light),var(--primary)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 1.1rem; color: var(--text-mid); margin-bottom: 26px; max-width: 480px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-art { display: flex; align-items: center; justify-content: center; }
.hero-art svg { width: 100%; max-width: 400px; height: auto; filter: drop-shadow(0 14px 40px var(--shadow)); animation: float 5s ease-in-out infinite; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-16px)} }

.stats-bar { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin: -34px auto 0; position: relative; z-index: 2; }
.stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; text-align: center; box-shadow: var(--shadow-card); }
.stat-card .num { font-size: 1.9rem; font-weight: 700; color: var(--primary); }
.stat-card .label { color: var(--text-mid); font-size: .9rem; }

.section { padding: 50px 0; }
.section-head { text-align: center; margin-bottom: 34px; }
.section-head h2 { font-size: 2rem; font-weight: 700; }
.section-head p { color: var(--text-mid); margin-top: 6px; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 16px; }
.cat-pill {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px 16px; text-align: center; cursor: pointer; transition: all .2s; box-shadow: var(--shadow-card);
}
.cat-pill:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--primary-light); }
.cat-pill .ci { width: 54px; height: 54px; border-radius: var(--radius-md); margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; background: var(--primary-pale); color: var(--primary); }
.cat-pill h4 { font-size: 1rem; }
.cat-pill small { color: var(--text-light); }

.tools-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(230px,1fr)); gap: 18px; }
.tool-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px; transition: all .2s; box-shadow: var(--shadow-card); position: relative; display: flex; flex-direction: column;
}
.tool-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); border-color: var(--primary-light); }
.tool-card .tc-icon { width: 52px; height: 52px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,var(--primary-pale),var(--bg)); color: var(--primary); margin-bottom: 14px; }
.tool-card h3 { font-size: 1.08rem; margin-bottom: 6px; }
.tool-card p { color: var(--text-mid); font-size: .88rem; flex: 1; margin-bottom: 14px; }
.tool-card .tc-badge { position: absolute; top: 16px; right: 16px; }
.tool-card .tc-foot { display: flex; align-items: center; justify-content: space-between; }

.steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
.step { text-align: center; padding: 26px; }
.step .si { width: 80px; height: 80px; margin: 0 auto 16px; border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center; background: var(--primary-pale); color: var(--primary); }
.step .snum { font-weight: 700; color: var(--primary-light); }
.step h4 { font-size: 1.15rem; margin: 6px 0; }
.step p { color: var(--text-mid); font-size: .92rem; }

.premium-box {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; border-radius: var(--radius-xl); padding: 44px; display: grid;
  grid-template-columns: 1.2fr .8fr; gap: 30px; align-items: center; box-shadow: var(--shadow-hover);
}
.premium-box h2 { font-size: 2rem; margin-bottom: 14px; }
.premium-box ul { display: grid; gap: 10px; margin-top: 16px; }
.premium-box li { display: flex; align-items: center; gap: 10px; }
.premium-box li .icon { background: rgba(255,255,255,.2); border-radius: 50%; padding: 3px; }
.premium-price { text-align: center; background: rgba(255,255,255,.14); border-radius: var(--radius-lg); padding: 30px; }
.premium-price .amt { font-size: 3rem; font-weight: 700; }
.premium-price .per { opacity: .85; }
.premium-price .btn { background: #fff; color: var(--primary); margin-top: 18px; }

/* ==================================================================
   TOOL PAGES
   ================================================================== */
.tool-container { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--shadow-card); }
.tool-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.tool-header .tool-icon { width: 60px; height: 60px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,var(--primary-pale),var(--bg)); color: var(--primary); }
.tool-header h1 { font-size: 1.7rem; }
.tool-header p { color: var(--text-mid); }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 500; margin-bottom: 7px; font-size: .92rem; }
.field input[type=text], .field input[type=number], .field input[type=email], .field input[type=password], .field input[type=url], .field select, .field textarea {
  width: 100%; padding: 11px 14px; border-radius: var(--radius-md); border: 1.5px solid var(--border);
  background: var(--bg); color: var(--text-dark); outline: none; transition: border .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.field textarea { min-height: 140px; resize: vertical; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.result-box { margin-top: 22px; padding: 20px; background: var(--primary-pale); border-radius: var(--radius-md); border: 1px solid var(--border); }
.checkbox-row { display: flex; flex-wrap: wrap; gap: 16px; }
.checkbox-row label { display: flex; align-items: center; gap: 7px; font-weight: 400; }
output, .live-out { font-weight: 600; color: var(--primary); }

.copy-list { display: grid; gap: 10px; }
.copy-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); }
.copy-item span { word-break: break-word; }
.copy-btn { cursor: pointer; }

/* premium lock overlay */
.lock-overlay { text-align: center; padding: 50px 20px; }
.lock-overlay .lk { width: 90px; height: 90px; margin: 0 auto 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--primary-pale); color: var(--primary); }
.lock-overlay h2 { font-size: 1.6rem; margin-bottom: 10px; }
.lock-overlay p { color: var(--text-mid); max-width: 420px; margin: 0 auto 22px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); gap: 14px; }
.mini-stat { text-align: center; padding: 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); }
.mini-stat .num { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.mini-stat .label { font-size: .82rem; color: var(--text-mid); }

/* ==================================================================
   AUTH PAGES
   ================================================================== */
.auth-wrap { min-height: calc(100vh - var(--header-h)); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 420px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 36px; box-shadow: var(--shadow-card); }
.auth-card h1 { text-align: center; font-size: 1.6rem; margin-bottom: 6px; }
.auth-card .sub { text-align: center; color: var(--text-mid); margin-bottom: 24px; }
.auth-card .alt { text-align: center; margin-top: 18px; color: var(--text-mid); }
.auth-card .alt a { color: var(--primary); font-weight: 600; }
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-light); font-size: .85rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.form-foot { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; font-size: .88rem; }
.form-foot a { color: var(--primary); }

/* ==================================================================
   ALERTS / TOASTS
   ================================================================== */
.alert { padding: 12px 16px; border-radius: var(--radius-md); margin-bottom: 16px; display: flex; align-items: center; gap: 10px; font-size: .92rem; }
.alert-success { background: #e3f8ec; color: #1a7a4a; }
.alert-error { background: #fbe3e8; color: #c0354f; }
.alert-info { background: var(--primary-pale); color: var(--primary); }
[data-theme="dark"] .alert-success { background: #16301f; color: #6fe0a3; }
[data-theme="dark"] .alert-error { background: #3a1822; color: #ff8aa3; }

#toast-wrap { position: fixed; top: 80px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--card-bg); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius-md); padding: 12px 18px; box-shadow: var(--shadow-hover); min-width: 240px; display: flex; align-items: center; gap: 10px; animation: slidein .25s ease; }
.toast.success { border-left-color: #1a9e5c; }
.toast.error { border-left-color: #d6336c; }
@keyframes slidein { from{transform:translateX(120%);opacity:0} to{transform:translateX(0);opacity:1} }

/* ==================================================================
   ADS
   ================================================================== */
.ad-container { margin: 24px 0; text-align: center; min-height: 60px; background: var(--bg); border: 1px dashed var(--border); border-radius: var(--radius-md); padding: 10px; overflow: hidden; }
.ad-container small { color: var(--text-light); font-size: .7rem; display: block; }

/* ==================================================================
   FOOTER
   ================================================================== */
.site-footer { background: var(--card-bg); border-top: 1px solid var(--border); margin-top: 50px; padding: 44px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3,1fr); gap: 30px; }
.footer-brand .logo { margin-bottom: 12px; }
.footer-brand p { color: var(--text-mid); max-width: 280px; }
.footer-col h4 { font-size: .95rem; margin-bottom: 14px; }
.footer-col a { display: block; color: var(--text-mid); padding: 5px 0; font-size: .9rem; }
.footer-col a:hover { color: var(--primary); }
.social-row { display: flex; gap: 10px; margin-top: 16px; }
.social-row a { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--primary-pale); color: var(--primary); transition: all .2s; }
.social-row a:hover { background: var(--primary); color: #fff; }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 30px; padding-top: 20px; text-align: center; color: var(--text-light); font-size: .88rem; }

/* ==================================================================
   ADMIN
   ================================================================== */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 240px; background: var(--card-bg); border-right: 1px solid var(--border); padding: 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0; }
.admin-sidebar .logo { margin-bottom: 26px; }
.admin-nav a { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-radius: var(--radius-md); color: var(--text-mid); font-weight: 500; margin-bottom: 4px; }
.admin-nav a:hover, .admin-nav a.active { background: var(--primary-pale); color: var(--primary); }
.admin-main { flex: 1; padding: 30px; min-width: 0; }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; flex-wrap: wrap; gap: 12px; }
.admin-head h1 { font-size: 1.6rem; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 18px; margin-bottom: 28px; }
.admin-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-card); display: flex; align-items: center; gap: 16px; }
.admin-card .ac-ico { width: 54px; height: 54px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; background: var(--primary-pale); color: var(--primary); }
.admin-card .num { font-size: 1.7rem; font-weight: 700; }
.admin-card .label { color: var(--text-mid); font-size: .88rem; }

.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-card); margin-bottom: 22px; }
.card h2, .card h3 { margin-bottom: 16px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: .9rem; }
th { color: var(--text-light); text-transform: uppercase; font-size: .75rem; letter-spacing: .5px; }
tr:hover td { background: var(--primary-pale); }
.table-wrap { overflow-x: auto; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tab-btn { padding: 10px 18px; border: none; background: transparent; cursor: pointer; color: var(--text-mid); font-weight: 500; border-bottom: 2px solid transparent; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* toggle switch */
.switch { position: relative; display: inline-block; width: 48px; height: 26px; }
.switch input { display: none; }
.switch .slider { position: absolute; inset: 0; background: var(--border); border-radius: 999px; cursor: pointer; transition: .2s; }
.switch .slider::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(22px); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }

/* ==================================================================
   MOBILE BOTTOM NAV
   ================================================================== */
.bottom-nav { display: none; }
.search-modal { display: none; }

/* ==================================================================
   RESPONSIVE
   ================================================================== */
@media (max-width: 1200px) {
  .sidebar { display: none; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .mega { width: 480px; grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 992px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .premium-box { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  .header-nav { display: none; }
  .header-search { display: none; }
  .hamburger { display: inline-flex; }
  .hero h1 { font-size: 2rem; }
  .footer-grid { grid-template-columns: 1fr; }
  body { padding-bottom: 70px; }
  .admin-sidebar { position: fixed; left: -260px; z-index: 200; transition: left .25s; box-shadow: var(--shadow-hover); }
  .admin-sidebar.open { left: 0; }
  .admin-main { padding: 18px; }

  /* bottom nav visible */
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
    background: var(--card-bg); border-top: 1px solid var(--border); box-shadow: 0 -4px 20px var(--shadow);
    justify-content: space-around; padding: 6px 0;
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 12px; border-radius: var(--radius-md); color: var(--text-mid); font-size: .68rem; }
  .bottom-nav a.active { background: var(--primary-pale); color: var(--primary); }

  .search-modal { position: fixed; inset: 0; background: var(--bg); z-index: 300; padding: 20px; }
  .search-modal.show { display: block; }
  .search-modal .sm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
  .search-modal input { flex: 1; padding: 12px 16px; border-radius: var(--radius-md); border: 1.5px solid var(--border); background: var(--card-bg); outline: none; }
}
@media (max-width: 480px) {
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.7rem; }
  .auth-card { padding: 24px; }
  .premium-box { padding: 26px; }
}

/* mobile slide-in nav menu */
.mobile-menu { position: fixed; top: 0; left: -300px; width: 280px; height: 100vh; background: var(--card-bg); z-index: 250; padding: 20px; transition: left .25s; overflow-y: auto; box-shadow: var(--shadow-hover); }
.mobile-menu.open { left: 0; }
.mobile-menu .mm-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.mobile-menu a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: var(--radius-md); color: var(--text-dark); }
.mobile-menu a:hover { background: var(--primary-pale); color: var(--primary); }
.mobile-menu h4 { font-size: .78rem; text-transform: uppercase; color: var(--text-light); margin: 16px 0 6px; }
.overlay-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 240; display: none; }
.overlay-bg.show { display: block; }

/* ==================================================================
   ANIMATED NAV BUTTONS (sidebar + admin)
   Matches the user's SVG button: solid pink diagonal gradient,
   gentle opacity pulse, continuous shine sweep, pulsing icon circle,
   white bold text, and a bouncing arrow.
   ================================================================== */
.nav-btn {
  position: relative; display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 11px 16px; margin-bottom: 10px;
  border: none; border-radius: 16px;
  background: linear-gradient(135deg, #ff7be5 0%, #ff2d95 100%);
  color: #fff; font-weight: 700; font-size: .92rem; cursor: pointer;
  overflow: hidden; isolation: isolate;
  box-shadow: 0 6px 18px rgba(255,45,149,.28);
  transition: transform .2s ease, box-shadow .25s ease;
  animation: nav-pulse 2s ease-in-out infinite;
}
[data-theme="dark"] .nav-btn { box-shadow: 0 6px 18px rgba(0,0,0,.45); }

/* gentle opacity pulse (like the SVG rect opacity 1;0.95;1) */
@keyframes nav-pulse { 0%,100% { opacity: 1; } 50% { opacity: .95; } }

.nav-btn:hover { transform: translateY(-2px) scale(1.01); box-shadow: 0 10px 26px rgba(255,45,149,.42); }
.nav-btn.active { box-shadow: 0 0 0 2px rgba(255,255,255,.55) inset, 0 8px 22px rgba(255,45,149,.4); }

/* pulsing translucent icon circle with solid white core */
.nav-btn .nav-ico {
  position: relative; z-index: 2; width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.25); color: #fff;
  animation: nav-ico-pulse 1.8s ease-in-out infinite;
}
@keyframes nav-ico-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,255,255,.35); }
  50%     { box-shadow: 0 0 0 6px rgba(255,255,255,0); }
}
.nav-btn .nav-ico svg { width: 17px; height: 17px; }

.nav-btn .nav-label { position: relative; z-index: 2; flex: 1; color: #fff; }

/* count chip */
.nav-btn .nav-count {
  position: relative; z-index: 2; margin-left: auto;
  background: rgba(255,255,255,.28); color: #fff;
  border-radius: 999px; padding: 1px 9px; font-size: .72rem; font-weight: 700;
}

/* bouncing arrow on the right (like the SVG translate 0;5;0) */
.nav-btn .nav-arrow {
  position: relative; z-index: 2; width: 16px; height: 16px; flex-shrink: 0; margin-left: 4px;
  color: #fff; opacity: .9; animation: nav-arrow 1s ease-in-out infinite;
}
.nav-btn .nav-count + .nav-arrow { margin-left: 8px; }
@keyframes nav-arrow { 0%,100% { transform: translateX(0); } 50% { transform: translateX(5px); } }

/* continuous shine sweep (like the white rect moving across) */
.nav-btn::after {
  content: ''; position: absolute; top: 0; left: 0; width: 60px; height: 100%; z-index: 1;
  background: rgba(255,255,255,.15);
  border-radius: 10px;
  transform: translateX(-140px);
  animation: nav-shine 2.5s linear infinite;
}
@keyframes nav-shine { 0% { transform: translateX(-140px); } 100% { transform: translateX(360px); } }

/* admin logout keeps the pink style but with a subtle red tint option */
.admin-nav .nav-btn { margin-bottom: 8px; }
.admin-nav .nav-btn.logout {
  background: linear-gradient(135deg, #ff6a8a 0%, #e23a5e 100%);
  box-shadow: 0 6px 18px rgba(226,58,94,.3);
}

/* respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .nav-btn, .nav-btn .nav-ico, .nav-btn .nav-arrow, .nav-btn::after { animation: none !important; }
}


/* admin nav buttons reuse .nav-btn but solid icon tone */
.admin-nav .nav-btn { margin-bottom: 6px; }
.admin-nav .nav-btn.logout .nav-ico { background: #fdecef; color: #d6336c; }
[data-theme="dark"] .admin-nav .nav-btn.logout .nav-ico { background: #3a1822; color: #ff7aa3; }

/* ==================================================================
   MOBILE / DRAWER HARDENING
   ================================================================== */
body.no-scroll { overflow: hidden; }

/* admin mobile overlay */
.admin-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 190; display: none; }
.admin-overlay.show { display: block; }

@media (max-width: 768px) {
  /* ensure the slide-in menu sits above everything and animates smoothly */
  .mobile-menu { left: -320px; width: 84%; max-width: 320px; transition: left .3s cubic-bezier(.4,0,.2,1); -webkit-overflow-scrolling: touch; }
  .mobile-menu.open { left: 0; }
  .overlay-bg { -webkit-tap-highlight-color: transparent; }
  .hamburger { display: inline-flex !important; }
}

/* On desktop the slide drawer & its overlay must never block clicks */
@media (min-width: 769px) {
  .mobile-menu, .overlay-bg, .admin-overlay { display: none !important; }
}

/* ==================================================================
   GENERIC ENTRANCE ANIMATIONS (cards, alerts, landing reveals)
   ================================================================== */
@keyframes anim-pop {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes anim-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.anim-pop  { animation: anim-pop .5s cubic-bezier(.34,1.2,.64,1) both; }
.anim-fade { animation: anim-fade .5s ease both; }

@media (prefers-reduced-motion: reduce) {
  .anim-pop, .anim-fade { animation: none !important; }
}

/* ==================================================================
   SIDEBAR: centered logo, icon-only buttons, collapse feature
   ================================================================== */
.sidebar { transition: width .25s ease; }

/* top: centered logo + collapse button */
.sidebar-top { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 16px; position: relative; }
.sidebar-logo { display: flex; align-items: center; justify-content: center; width: 100%; }
.sidebar-logo svg { display: block; }
.sidebar-collapse-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--card-bg); color: var(--primary); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.sidebar-collapse-btn:hover { background: var(--primary); color: #fff; border-color: transparent; }
.sidebar-collapse-btn svg { transition: transform .25s ease; }

/* icon-only buttons: hide labels & counts & arrows, center the icon */
.sidebar.icon-only .nav-btn-iconly { justify-content: center; padding: 11px; gap: 0; }
.sidebar.icon-only .nav-btn-iconly .nav-label,
.sidebar.icon-only .nav-btn-iconly .nav-count,
.sidebar.icon-only .nav-btn-iconly .nav-arrow { display: none; }
.sidebar.icon-only .nav-btn-iconly .nav-ico { margin: 0; }

/* ---- Collapsed state (narrow rail) ---- */
.sidebar.collapsed { width: 76px; }
.sidebar.collapsed .sidebar-box { padding: 10px; }
.sidebar.collapsed .sidebar-logo svg { width: 32px; height: 32px; }
.sidebar.collapsed .sidebar-ad { display: none; }            /* hide ad when narrow */
.sidebar.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }  /* arrow flips */

/* nicer tooltip via title attr already works; add a subtle hover cue */
.sidebar.icon-only .nav-btn-iconly { position: relative; }

/* ==================================================================
   MASTER BUTTON — matches the project's animated SVG button
   (pink gradient, drop shadow, opacity pulse, moving shine,
    pulsing left icon circle, white text, bouncing right arrow)
   ================================================================== */
.master-btn {
  position: relative; display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 50px; padding: 0 18px 0 50px;
  border: none; border-radius: 16px; cursor: pointer; overflow: hidden;
  background: linear-gradient(135deg, #ff7be5 0%, #ff2d95 100%);
  box-shadow: 0 4px 12px rgba(255,45,149,.5);
  color: #fff; font-weight: 700; font-size: 1rem; text-align: left;
  animation: mb-opacity 2s ease-in-out infinite;
}
@keyframes mb-opacity { 0%,100% { opacity: 1; } 50% { opacity: .92; } }
.master-btn:hover { color: #fff; }

/* left pulsing icon circle */
.master-btn .mb-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; z-index: 2;
}
.master-btn .mb-icon::before {
  content: ''; position: absolute; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.25); animation: mb-pulse 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 3px rgba(255,255,255,.6));
}
.master-btn .mb-icon::after {
  content: ''; position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #fff; z-index: 1;
}
@keyframes mb-pulse { 0%,100% { width: 28px; height: 28px; } 50% { width: 34px; height: 34px; } }

/* center text */
.master-btn .mb-text {
  flex: 1; z-index: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center;
}

/* right bouncing arrow */
.master-btn .mb-arrow { z-index: 2; flex-shrink: 0; width: 20px; height: 20px; animation: mb-arrow 1s ease-in-out infinite; }
@keyframes mb-arrow { 0%,100% { transform: translateX(0); } 50% { transform: translateX(4px); } }

/* moving shine sweep */
.master-btn::after {
  content: ''; position: absolute; top: 0; left: 0; width: 80px; height: 100%; z-index: 1;
  background: rgba(255,255,255,.18); border-radius: 10px;
  transform: translateX(-140px); animation: mb-shine 2.5s linear infinite;
}
@keyframes mb-shine { 0% { transform: translateX(-140px); } 100% { transform: translateX(420px); } }

.master-btn:hover { box-shadow: 0 8px 22px rgba(255,45,149,.6); }

/* small variant for tool cards */
.master-btn.master-sm { min-height: 44px; font-size: .92rem; padding: 0 14px 0 46px; }

@media (prefers-reduced-motion: reduce) {
  .master-btn, .master-btn .mb-icon::before, .master-btn .mb-arrow, .master-btn::after { animation: none !important; }
}

/* ==================================================================
   CATEGORY COLLAPSE (homepage tool groups, default collapsed)
   ================================================================== */
.cat-group { margin-bottom: 18px; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--card-bg); box-shadow: var(--shadow-card); }
.cat-group-head {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px 18px;
  background: var(--card-bg); border: none; cursor: pointer; text-align: left; color: var(--text-dark);
}
.cat-group-head:hover { background: var(--primary-pale); }
.cat-group-head .ci { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--primary-pale); color: var(--primary); flex-shrink: 0; }
.cat-group-head h2 { font-size: 1.2rem; flex: 1; }
.cat-group-head .cg-count { background: var(--primary-pale); color: var(--primary); border-radius: 999px; padding: 2px 11px; font-size: .76rem; font-weight: 700; }
.cat-group-head .cg-arrow { color: var(--primary); transition: transform .3s ease; flex-shrink: 0; }
.cat-group.open .cat-group-head .cg-arrow { transform: rotate(180deg); }
.cat-group-body { max-height: 0; overflow: hidden; transition: max-height .4s ease; }
.cat-group.open .cat-group-body { max-height: 6000px; }
.cat-group-body-inner { padding: 18px; }

/* Fullscreen toggle: show "enter" icon by default, JS swaps to "exit" */
[data-fullscreen-toggle] .icon-fs-off { display: none; }
