/* 
 * TwistedPad Complete CSS
 * Color theme + Full Header/Sidebar/Footer
 * Everything else uses Bootstrap 5
 */

/* ===== COLOR THEME ===== */
:root {
  --bg: #0b0c10;
  --panel: #11131a;
  --panel2: #171a23;
  --bgSoft: rgba(255,255,255,.02);
  --text: #e8eaf2;
  --muted: #a5a8b8;
  --border: rgba(255,255,255,.10);
  --accent: #ff2f2f;
  --accent2: rgba(255,47,47,.25);
  --accentBorder: rgba(255,47,47,.55);
  --accentBorderSoft: rgba(255,47,47,.35);
  --accentSoft: rgba(255,47,47,.12);
  --accentSoft2: rgba(255,47,47,.16);
  --accentGlow: rgba(255,47,47,.15);
  --danger: #ff5a5a;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 14px;
  --radius2: 18px;
  --pad: 16px;
  --max: 100%;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

/* ===== BODY & BASE ===== */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: cover !important;
  background-attachment: fixed !important;
  background: 
    radial-gradient(900px 500px at 15% -10%, rgba(255,47,47,.18), transparent 60%),
    radial-gradient(900px 500px at 95% 10%, rgba(255,47,47,.10), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0, rgba(255,255,255,.03) 1px, transparent 1px, transparent 44px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.02) 0, rgba(255,255,255,.02) 1px, transparent 1px, transparent 44px),
    var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

.main { 
  padding: 22px 0 38px; 
  flex: 1; 
}

/* ===== APP LAYOUT ===== */
.app-shell {
  display: flex;
  flex: 1;
  min-height: 0;
}

.app-content {
  flex: 1;
  min-width: 0;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
}

.nav-backdrop {
  display: none;
}

body.sidebar-open .nav-backdrop {
  display: block;
}

/* ===== TOPBAR ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11,12,16,.80);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 5px;
  gap: 12px;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 10px;
}

.topbar__title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52vw;
}

.topbar__brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 10px;
  border-radius: 12px;
  background: transparent;
}
input[readonly] {
    color: #e23c3c;
}
.topbar__brand img {
  height: 33px;
  width: auto;
  object-fit: contain;
  opacity: .95;
}
                            input {
                                padding: 8px;
                                background: #0a0a0a75;
                                border: 1px solid #323232!important;
                                border-radius: 4px;
                                color: #fff;
                                font-size: 13px;
                            }

                            input:focus {
                                outline: none;
                                border-color: #ff2f2f!important;
                            }
/* ===== BRAND ===== */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--accentGlow);
}

.brand__name {
  font-weight: 800;
  letter-spacing: .2px;
  font-size: 22px;
}

.brand__sub {
  color: var(--muted);
  font-size: 12px;
}

.brand__img {
  height: 32px;
  width: auto;
}

/* ===== USER MENU ===== */
.user-menu {
  position: relative;
}

.user-menu__btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-menu__btn:hover {
  border-color: var(--accent);
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar--sm {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  object-fit: cover;
}

.menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 100;
}

.user-menu.is-open .menu {
  display: block;  /* Only visible when .is-open class is added by JS */
}

.menu__header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.menu__name {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.menu__meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.menu__section {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.menu__section:last-child {
  border-bottom: none;
}

.menu__section a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
}

.menu__section a:hover {
  background: rgba(255,255,255,.04);
}

.menu__section a i {
  width: 16px;
  text-align: center;
  color: var(--muted);
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 260px;
  flex: 0 0 260px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar__header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 18px;
}

.sidebar__logo {
  height: 32px;
  width: auto;
}

.sidebar__brandtext {
  white-space: nowrap;
}

.sidebar__collapse {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.sidebar__collapse:hover {
  background: rgba(255,255,255,.04);
  color: var(--text);
}

/* Sidebar Search */
.sidebar__search {
  padding: 10px 12px 0;
}

.sidebar__searchForm {
  position: relative;
  display: flex;
  align-items: center;
}

.sidebar__searchIcon {
  position: absolute;
  left: 12px;
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}

.sidebar__searchInput {
  width: 100%;
  padding: 10px 54px 10px 36px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
  color: var(--text);
  outline: none;
  font-size: 13px;
}

.sidebar__searchInput::placeholder {
  color: var(--muted);
}

.sidebar__searchInput:focus {
  border-color: rgba(255,47,47,.35);
  box-shadow: 0 0 0 3px rgba(255,47,47,.10);
}

.sidebar__kbd {
  position: absolute;
  right: 10px;
  font-size: 10px;
  letter-spacing: .6px;
  color: var(--muted);
  padding: 3px 7px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  pointer-events: none;
}

/* Sidebar Navigation */
.sidebar__nav {
  padding: 10px 10px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.sidebar__section {
  margin-bottom: 24px;
}

.sidebar__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  padding: 8px 12px;
  margin-bottom: 4px;
}

.sidebar__link,
.sidebar__quickLink {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.sidebar__link:hover,
.sidebar__quickLink:hover {
  background: rgba(255,255,255,.04);
  color: var(--text);
}

.sidebar__link.is-active {
  background: var(--accentSoft);
  color: var(--accent);
  font-weight: 600;
}

.sidebar__link i,
.sidebar__quickLink i {
  width: 18px;
  text-align: center;
  flex: 0 0 18px;
}

.sidebar__text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Sidebar Mini Items (Recent, etc) */
.sidebar__mini {
  margin-top: 8px;
  padding: 0 4px;
}

.sidebar__miniLabel {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 8px 10px 6px;
}

.sidebar__miniList {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar__miniItem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 14px;
  color: var(--muted);
}

.sidebar__miniItem:hover {
  color: var(--text);
  background: rgba(255,255,255,.04);
}

.sidebar__miniItem i {
  width: 18px;
  text-align: center;
  flex: 0 0 18px;
}

/* Sidebar Footer */
.sidebar__footer {
  border-top: 1px solid var(--border);
  padding: 12px;
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.sidebar__userMeta {
  min-width: 0;
  flex: 1;
}

.sidebar__userName {
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.sidebar__userTier {
  margin-top: 4px;
  font-size: 11px;
}

.sidebar__userCredits {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar__userCredits i {
  opacity: .9;
}

.credits-num {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: .2px;
}

.sidebar__quick {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar__quickLink {
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.04);
}

.sidebar__quickLink:hover {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.08);
}

/* ===== FOOTER ===== */

.footer{
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,.25);
  padding: 12px 0;
  margin-top: auto;
}
.footer__inner{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 14px;
}
.footer__brand{ font-weight: 750; }
.footer__links{ display:flex; gap: 14px; flex-wrap: wrap; }
.footer__links a{ color: var(--muted); }
.footer__links a:hover{ color: var(--text); }

/* ===== TIER BADGES ===== */
.tier-badge {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
}

.tier-free {
  color: #c7cad7;
}

.tier-plus
 {
    color: #ffd6d6;
    border-color: rgb(47 193 255 / 35%);
    background: rgb(47 149 255 / 10%);
}

.tier-pro {
  color: #ffe3e3;
  border-color: var(--accentBorderSoft);
  background: rgba(255,47,47,.10);
}
.tier-elite,
.tier-creator,
.tier-team {
  color: #ffe3e3;
  border-color: var(--accentBorder);
  background: var(--accentSoft2);
}

/* ===== COLLAPSED SIDEBAR (Desktop) ===== */
body.sidebar-collapsed .sidebar {
  width: 72px;
  flex-basis: 72px;
}

body.sidebar-collapsed .app-content {
  margin-left: 72px;
}


body.sidebar-collapsed .sidebar__link,
body.sidebar-collapsed .sidebar__quickLink {
  justify-content: center;
  padding: 10px;
}

/* ===== RESPONSIVE - MOBILE (760px) ===== */
@media (max-width: 760px) {
  .topbar__right {
    gap: 6px;
  }

  .footer__inner {
    flex-direction: column;
  }
}

/* ===== RESPONSIVE - MOBILE SIDEBAR (900px) ===== */
@media (max-width: 900px) {
  .nav-toggle {
    display: block;
  }

  .app-content {
    margin-left: 0;
  }

  body.sidebar-collapsed .app-content {
    margin-left: 0;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    z-index: 1000;
    transform: translateX(-110%);
    transition: transform .18s ease;
    box-shadow: var(--shadow);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(0,0,0,.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
  }

  body.sidebar-open .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /* Do not collapse on mobile */
  body.sidebar-collapsed .sidebar {
    width: 260px;
    flex-basis: 260px;
  }

  body.sidebar-collapsed .sidebar__brandtext,
  body.sidebar-collapsed .sidebar__label,
  body.sidebar-collapsed .sidebar__text,
  body.sidebar-collapsed .sidebar__userMeta {
    display: block;
  }

  body.sidebar-collapsed .sidebar__link,
  body.sidebar-collapsed .sidebar__quickLink {
    justify-content: flex-start;
  }
}

/* ===== UTILITY CLASSES ===== */
.text-muted {
  color: var(--muted) !important;
}

.text-danger {
  color: var(--danger) !important;
}

.muted {
  color: var(--muted);
}

.h1 {
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
}

.h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.h5 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.p {
  margin: 0 0 14px;
  line-height: 1.6;
}

.hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0;
}

.lead {
  font-size: 1.125rem;
  font-weight: 400;
}

.display-4 {
  font-size: 2.5rem;
  font-weight: 800;
}

.display-6 {
  font-size: 2rem;
  font-weight: 700;
}

.fw-bold {
  font-weight: 700;
}

.small {
  font-size: 0.875rem;
}

/* Sidebar */
.sidebar{
  width: 260px;
  flex: 0 0 260px;
  position: fixed;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--border);
  background: rgba(11, 12, 16, .88);
  backdrop-filter: blur(10px);
  z-index: 60;
  display: flex;
  flex-direction: column;
}
.sidebar__header{
  display:flex;
  align-items:center;
  justify-content: space-between;
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar__brand{
  display:flex;
  align-items:center;
  gap: 10px;
  color: var(--text);
  min-width: 0;
}
.sidebar__logo{
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.sidebar__brandtext{
  font-weight: 800;
  letter-spacing: .5px;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}
.sidebar__collapse{
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  cursor: pointer;
}
.sidebar__collapse:hover{
  background: rgba(255,255,255,.05);
  color: var(--text);
}

.sidebar__search{
  padding: 10px 12px 0;
}
.sidebar__searchForm{
  position: relative;
  display:flex;
  align-items:center;
}
.sidebar__searchIcon{
  position:absolute;
  left: 12px;
  color: var(--muted);
  font-size: 13px;
  pointer-events:none;
}
.sidebar__searchInput{
  width: 100%;
  padding: 10px 54px 10px 36px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
  color: var(--text);
  outline: none;
  font-size: 13px;
}
.sidebar__searchInput::placeholder{ color: var(--muted); }
.sidebar__searchInput:focus{
  border-color: rgba(255,47,47,.35);
  box-shadow: 0 0 0 3px rgba(255,47,47,.10);
}
.sidebar__kbd{
  position:absolute;
  right: 10px;
  font-size: 10px;
  letter-spacing: .6px;
  color: var(--muted);
  padding: 3px 7px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  pointer-events:none;
}

.sidebar__mini{ margin-top: 8px; padding: 0 4px; }
.sidebar__miniLabel{
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 8px 10px 6px;
}
.sidebar__miniList{ display:flex; flex-direction: column; gap: 4px; }
.sidebar__miniItem{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 14px;
  color: var(--muted);
}
.sidebar__miniItem:hover{ color: var(--text); background: rgba(255,255,255,.04); }
.sidebar__miniItem i{ width: 18px; text-align:center; flex: 0 0 18px; }

.sidebar__nav{
  padding: 10px 10px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}
.sidebar__section{ margin-bottom: 12px; }
.sidebar__label{
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 8px 10px;
}
.sidebar__link,
.sidebar__quickLink{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  color: var(--muted);
}
.sidebar__link:hover,
.sidebar__quickLink:hover{
  color: var(--text);
  background: rgba(255,255,255,.04);
}
.sidebar__link.is-active{
  color: var(--text);
  background: rgba(255,47,47,.10);
  border: 1px solid var(--accentBorderSoft);
}
.sidebar__link i,
.sidebar__quickLink i{
  width: 18px;
  text-align:center;
  flex: 0 0 18px;
}
.sidebar__text{
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.sidebar__footer{ border-top: 1px solid var(--border); padding: 12px; }
.sidebar__user{ display:flex; align-items:center; gap: 10px; margin-bottom: 10px; }
.avatar--sm{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  object-fit: cover;
}
.sidebar__userMeta{ min-width: 0; }
.sidebar__userName{
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}
.sidebar__userTier{ margin-top: 4px; }
.sidebar__userCredits{
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  display:flex;
  align-items:center;
  gap: 6px;
}
.sidebar__userCredits i{ opacity: .9; }
.credits-num{
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: .2px;
}
.sidebar__quick{ display:flex; flex-direction: column; gap: 6px; }
.sidebar__quickLink{
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.04);
}
.sidebar__quickLink:hover{ background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.08); }

/* Collapsed sidebar (desktop) */
body.sidebar-collapsed .sidebar{ width: 72px; flex-basis: 72px; }
body.sidebar-collapsed .app-content{ margin-left: 72px; }
body.sidebar-collapsed .sidebar__brandtext,
body.sidebar-collapsed .sidebar__label,
body.sidebar-collapsed .sidebar__text,
body.sidebar-collapsed .sidebar__userMeta,
body.sidebar-collapsed .sidebar__search,
body.sidebar-collapsed .sidebar__mini{ display:none; }
body.sidebar-collapsed .sidebar__collapse i{ transform: rotate(180deg); }
body.sidebar-collapsed .sidebar__link,
body.sidebar-collapsed .sidebar__quickLink{ justify-content: center; }
body.sidebar-collapsed .sidebar__nav{ padding-left: 6px; padding-right: 6px; }
body.sidebar-collapsed .sidebar__footer{ padding: 10px 6px; }
body.sidebar-collapsed .sidebar__user{ justify-content: center; }

/* Mobile drawer behavior */
@media (max-width: 900px){
  .nav-toggle{ display:block; }

  .app-content{ margin-left: 0; }
  body.sidebar-collapsed .app-content{ margin-left: 0; }

  .sidebar{
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-110%);
    transition: transform .18s ease;
    box-shadow: var(--shadow);
  }
  body.sidebar-open .sidebar{ transform: translateX(0); }

  .nav-backdrop{
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(0,0,0,.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
  }
  body.sidebar-open .nav-backdrop{ opacity: 1; pointer-events: auto; }

  /* Do not collapse on mobile */
  body.sidebar-collapsed .sidebar{ width: 260px; flex-basis: 260px; }
  body.sidebar-collapsed .sidebar__brandtext,
  body.sidebar-collapsed .sidebar__label,
  body.sidebar-collapsed .sidebar__text,
  body.sidebar-collapsed .sidebar__userMeta{ display:block; }
  body.sidebar-collapsed .sidebar__link,
  body.sidebar-collapsed .sidebar__quickLink{ justify-content:flex-start; }
}
/* User menu dropdown */
.user-menu{
  position: relative;
  display:flex;
  align-items:center;
}
.user-menu__btn{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  box-shadow: none;
}
.user-menu__btn:hover{ background: rgba(255,255,255,.06); }
.user-menu__label{ font-size: 13px; opacity: .9; white-space: nowrap; }

.avatar{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  display:block;
}

.menu{
  position:absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 240px;
  background: rgba(20,22,30,.96);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
  padding: 8px;
  display:none;
  z-index: 1002;
  backdrop-filter: blur(10px);
}
.user-menu.is-open .menu{ display:block; }

.menu__header{
  padding: 10px 10px 8px;
}
.menu__name{ font-weight: 700; }
.menu__meta{ font-size: 12px; opacity: .8; margin-top: 2px; }

.menu__section{
  border-top: 1px solid rgba(255,255,255,.06);
  margin-top: 6px;
  padding-top: 6px;
}
.menu a{
  display:block;
  padding: 10px 10px;
  border-radius: 10px;
  color: var(--text);
  text-decoration:none;
}
.menu a:hover{ background: rgba(255,255,255,.05); }
.menu__danger{ color: #ffb3b3 !important; }
.menu__danger:hover{ background: rgba(255,90,90,.10) !important; }



.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.02);
  color: var(--text);
  font-size: 12px;
}
.badge--accent{
  border-color: var(--accentBorder);
  background: var(--accentSoft);
  color: #ffe0e0;
}




.btn{
  display:inline;
  align-items:center;
  justify-content:center;
  gap:10px;
  font-size: .70rem;
  font-weight: 500;
  letter-spacing: 1px;
  padding: 9px 19px;
  border-radius: .25rem;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--text);
  cursor:pointer;
  user-select:none;
  box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
}
.btn:hover{
  border-color: var(--accentBorder);
  box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075), 0 0 0 5px var(--accentSoft);
}
.btn--primary{
  background: linear-gradient(180deg, rgba(255,47,47,.95), rgba(255,47,47,.65));
  border-color: rgba(255,47,47,.65);
}
.btn--primary:hover{
  box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075), 0 0 0 6px var(--accentSoft2);
}
.btn--sm{ padding: 7px 14px; border-radius: .25rem; font-size: .65rem; }

/* Button variants */
.btn--ghost{ background: transparent; }
.btn[disabled], .btn:disabled{ opacity: .55; cursor: not-allowed; box-shadow: none; }





/* OAuth buttons */
.oauth{
  display:flex;
  flex-direction: column;
  gap: 10px;
}
.btn--oauth{
  justify-content: center;
  width: 100%;
}
.btn--google{
  border-color: rgba(255,255,255,.18);
}
.btn--discord{
  border-color: rgba(255,255,255,.18);
}
.oauth__divider{
  position: relative;
  margin: 14px 0;
  height: 1px;
  background: var(--border);
}
.oauth__divider span{
  position:absolute;
  left:50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 0 10px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(17,19,26,.96);
}
.card__inner{ padding: 18px; }
.input, textarea, select{
    width: 100%;
    padding: 12px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    outline: none;
}

.card{
    background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
    border: 1px solid var(--border);
    border-radius: var(--radius2);
    box-shadow: var(--shadow);
    color: var(--text);padding: 10px
}
table{
    width:100%!important;
    border-collapse: collapse;
}
.table th, .table td{
    text-align:left;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text);background: var(--bg);
}
.table th{ color: #cfd2df; font-weight: 650;background: var(--bg); }
.table td strong{ color: var(--text); }
/* Support ticket thread */
.ticket-thread{
  display:flex;
  flex-direction:column;
  gap: 10px;
  margin-top: 14px;
}
.ticket-msg{
  border: 1px solid var(--border);
  background: rgba(255,255,255,.02);
  border-radius: 14px;
  padding: 12px 14px;
  max-width: 860px;
}
.ticket-msg--staff{
  margin-left: auto;
  border-color: rgba(255,47,47,.30);
  background: rgba(255,47,47,.08);
}
.ticket-msg__meta{
  display:flex;
  align-items:center;
  gap: 10px;
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.ticket-msg__meta .badge{ font-size: .65rem; }
.ticket-msg__body{
  white-space: pre-wrap;
  line-height: 1.45;
  color: var(--text);
}
.ticket-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin: 12px;
}
.grid{
  display:grid;
  gap: 14px;
}
.hero{
  padding: 22px 0 8px;
}
.price-card{ position: relative; overflow: hidden; }
.price-card--featured{
  border-color: var(--accentBorder);
  box-shadow: 0 0 0 1px rgba(255,47,47,.18), var(--shadow);
}
.price-tag{
  display:flex;
  align-items: baseline;
  gap: 10px;
  margin: 12px 0 12px;
}
.price-tag .price{
  font-size: 34px;
  font-weight: 850;
  letter-spacing: -.8px;
  line-height: 1;
  color: var(--text);
}
.price-tag .per{
  color: var(--muted);
  font-size: 13px;
}
.muted-title{
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: 10px;
}
.feature-list{
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
}
.feature-list li{ margin: 8px 0; }

.alert{
  border-radius: var(--radius);
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.02);
  margin: 0 0 14px;
}
.alert--success{ border-color: rgba(50,205,140,.35); background: rgba(50,205,140,.10); }
.alert--error{ border-color: rgba(255,90,90,.35); background: rgba(255,90,90,.10); }
.alert--promo{ border-color: var(--accentBorder); background: var(--accentSoft); }
.alert--warning{ border-color: rgba(255,200,60,.35); background: rgba(255,200,60,.10); }


/* Alerts — icon/body/close layout (used by animated flash + announcements) */
.alert.alert--rich{
  display:flex;
  gap: 10px;
  align-items:flex-start;
}
.alert__icon{
  flex: 0 0 auto;
  width: 22px;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  margin-top: 2px;
  opacity: .95;
}
.alert__body{
  flex: 1 1 auto;
  min-width: 0;
}
.alert__close{
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.65);
  padding: 4px 6px;
  border-radius: 8px;
  cursor: pointer;
}
.alert__close:hover{ background: rgba(255,255,255,.06); color: rgba(255,255,255,.9); }




.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.col-12{ grid-column: span 12; }
.col-8{ grid-column: span 8; }
.col-6{ grid-column: span 6; }
.col-4{ grid-column: span 4; }
/* Pricing */
.pricing-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 16px 0 18px;
}
@media (max-width: 1020px){
  .pricing-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px){
  .pricing-grid{ grid-template-columns: 1fr; }
}
.index-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 16px 0 18px;
}
.hero__cta{
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}










/*----------------gallery-----------------------------------*/

/* ==================== IMAGE GALLERY MODAL CSS ==================== */

/* Modal Overlay */
.gallery-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  backdrop-filter: blur(4px);
}

/* Modal Content */
.gallery-modal-content {
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 12px;
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Header */
.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #333;
  background: #222;
  border-radius: 12px 12px 0 0;
}

.gallery-header h3 {
  margin: 0;
  color: white;
  font-size: 18px;
  font-weight: 600;
}

.gallery-close {
  background: none;
  border: none;
  color: #888;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.gallery-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Tabs */
.gallery-tabs {
  display: flex;
  gap: 4px;
  padding: 16px 24px 0;
  border-bottom: 1px solid #333;
  background: #1a1a1a;
  overflow-x: auto;
  flex-wrap: wrap;
}

.gallery-tab {
  background: transparent;
  border: none;
  color: #888;
  padding: 8px 16px;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.gallery-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ccc;
}

.gallery-tab.active {
  background: #007bff;
  color: white;
}

/* Body */
.gallery-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.gallery-empty {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  font-size: 14px;
}

/* Gallery Item */
.gallery-item {
  position: relative;
  aspect-ratio: 1;
  border: 2px solid #333;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  background: #0a0a0a;
}

.gallery-item-default {
  border-color: #ffc107;
  box-shadow: 0 0 10px rgba(255, 193, 7, 0.2);
}

.gallery-item:hover {
  border-color: #007bff;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  z-index: 10;
}

.gallery-item-default:hover {
  border-color: #007bff;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.gallery-default-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(255, 193, 7, 0.9);
  color: #000;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  z-index: 2;
  pointer-events: none;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: repeating-conic-gradient(#444 0% 25%, #333 0% 50%) 50% / 20px 20px;
}

.gallery-item-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  color: white;
  padding: 8px 6px 6px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.gallery-item-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.gallery-item:hover .gallery-item-actions {
  opacity: 1;
}

.gallery-delete {
  background: rgba(220, 53, 69, 0.9);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
}

.gallery-delete:hover {
  background: #dc3545;
  transform: scale(1.1);
}

/* Footer */
.gallery-footer {
  padding: 16px 24px;
  border-top: 1px solid #333;
  background: #222;
  border-radius: 0 0 12px 12px;
}

.gallery-add-custom {
  display: flex;
  gap: 8px;
  align-items: center;
}

.gallery-add-custom input[type="text"] {
  background: #1a1a1a;
  border: 1px solid #333;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  transition: border-color 0.2s;
}

.gallery-add-custom input[type="text"]:focus {
  outline: none;
  border-color: #007bff;
}

.gallery-add-custom input[type="text"]::placeholder {
  color: #666;
}

/* Button in gallery footer */
.gallery-add-custom .btn {
  padding: 8px 16px;
  font-size: 13px;
  white-space: nowrap;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.gallery-add-custom .btn:hover {
  background: #0056b3;
}

/* Gallery trigger button (the button in editor that opens gallery) */
.gallery-trigger-btn {
  background: #333 !important;
  color: #ccc !important;
  border: 1px solid #444 !important;
  padding: 6px 12px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}

.gallery-trigger-btn:hover {
  background: #444 !important;
  color: white !important;
  border-color: #007bff !important;
}

.gallery-trigger-btn i {
  font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  .gallery-modal-content {
    width: 95%;
    max-height: 90vh;
  }
  
  .gallery-tabs {
    padding: 12px 16px 0;
  }
  
  .gallery-body {
    padding: 16px;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }
  
  .gallery-footer {
    padding: 12px 16px;
  }
  
  .gallery-add-custom {
    flex-direction: column;
  }
  
  .gallery-add-custom input[type="text"],
  .gallery-add-custom .btn {
    width: 100%;
  }
}

/* Scrollbar styling for gallery body */
.gallery-body::-webkit-scrollbar {
  width: 8px;
}

.gallery-body::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.gallery-body::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

.gallery-body::-webkit-scrollbar-thumb:hover {
  background: #444;
}

.page-header,.card__header {
    margin-bottom: 20px;
}
.badge--success {
    color: #ffd6d6;
    border-color: rgb(83 255 47 / 35%);
    background: rgb(47 255 151 / 10%);
}
.badge--danger
 {
    color: #ffd6d6;
    border-color: rgb(255 148 47 / 35%);
    background: rgb(255 174 47 / 10%);
}

/* =========================================================
   Profile page helpers (u.php / profile.php)
   ========================================================= */
.profile-hero{
  display:flex;
  align-items:center;
  gap: 14px;
  flex-wrap:wrap;
}
.profile-hero__avatar{
  width: 78px;
  height: 78px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.02);
  object-fit: cover;
  flex: 0 0 auto;
}
.profile-hero__top{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap:wrap;
}
.profile-hero__name{
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.2px;
}
.profile-hero__meta{
  display:flex;
  align-items:center;
  gap: 8px;
  flex-wrap:wrap;
  margin-top: 10px;
}
code {
    font-size: 14px;
    color: #dc6161;
    word-wrap: break-word;
    font-weight: bolder;
}
.profile-socials{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
}
.page-head {
    margin-bottom: 10px;
}
.hr{margin: 5px 0px 5px 0px!important;}
.profile-hero__stats,.row .btn,.row input{margin-bottom:5px}