/*
  Algorithm.Company — Admin styling (cyber premium glass)
  Scoped to: body.alg-admin-body
  Goal: make admin tooling screens feel like the Identity/Manage glass UI
  without breaking existing Bootstrap layouts.
*/

body.alg-admin-body{
  background: transparent;
}

/* A soft backdrop under admin content so white pages don't look bare */
body.alg-admin-body .container.app-body{
  position: relative;
}

/* Generic glass panel you can drop onto any wrapper */
.ad-glass{
  background: rgba(16, 18, 34, 0.50);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px;
  box-shadow:
    0 18px 55px rgba(0,0,0,0.28),
    0 0 0 1px rgba(0,0,0,0.20) inset;
  overflow: hidden;
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))){
  .ad-glass{
    background: rgba(16, 18, 34, 0.34);
    -webkit-backdrop-filter: blur(14px) saturate(1.18);
    backdrop-filter: blur(14px) saturate(1.18);
  }
}

/* Admin page title block */
body.alg-admin-body h1,
body.alg-admin-body h2,
body.alg-admin-body h3{
  color: rgba(245,245,245,.96);
  text-shadow: 0 2px 0 rgba(0,0,0,0.45);
}

body.alg-admin-body .text-muted,
body.alg-admin-body .muted{
  color: rgba(245,245,245,.72) !important;
}

/* Make common Bootstrap surfaces look glassy, but only in admin */
body.alg-admin-body .card{
  background: rgba(16, 18, 34, 0.46);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px;
  box-shadow: 0 18px 55px rgba(0,0,0,0.24);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))){
  body.alg-admin-body .card{
    background: rgba(16, 18, 34, 0.32);
    -webkit-backdrop-filter: blur(12px) saturate(1.15);
    backdrop-filter: blur(12px) saturate(1.15);
  }
}

body.alg-admin-body .card .card-header{
  background: rgba(0,0,0,0.18);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Tables */
body.alg-admin-body .table{
  color: rgba(245,245,245,.92);
}

body.alg-admin-body .table thead th{
  border-bottom-color: rgba(255,255,255,0.14) !important;
}
body.alg-admin-body .table td,
body.alg-admin-body .table th{
  border-color: rgba(255,255,255,0.10) !important;
}

body.alg-admin-body .table-hover tbody tr:hover{
  background: rgba(0,255,255,0.04);
}

/* Forms */
body.alg-admin-body .form-control,
body.alg-admin-body .form-select{
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  color: rgba(245,245,245,.95);
}
body.alg-admin-body .form-control::placeholder{
  color: rgba(245,245,245,.58);
}
body.alg-admin-body .form-control:focus,
body.alg-admin-body .form-select:focus{
  border-color: rgba(0,255,255,0.45);
  box-shadow:
    0 0 0 .2rem rgba(0,255,255,0.12),
    0 0 0 1px rgba(255,0,255,0.10);
}

/* Alerts */
body.alg-admin-body .alert{
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
}

/* Buttons: keep your existing premium gradient button styles intact.
   These are light-touch refinements for standard bootstrap buttons only. */
body.alg-admin-body .btn.btn-outline-secondary,
body.alg-admin-body .btn.btn-outline-light{
  border-radius: 999px;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ scroll-behavior: auto !important; }
}

/* --- Admin hero: subtle animated cyber border --- */
body.alg-admin-body .ad-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

    body.alg-admin-body .ad-hero::before {
        content: "";
        position: absolute;
        inset: -2px;
        background: linear-gradient(120deg, rgba(0,255,255,0.0), rgba(0,255,255,0.55), rgba(255,0,255,0.55), rgba(255,140,0,0.35), rgba(0,255,255,0.0) );
        background-size: 240% 240%;
        opacity: .75;
        filter: blur(.6px);
        animation: adminCyberBorder 10s ease-in-out infinite;
        z-index: 0;
        pointer-events: none;
    }

    body.alg-admin-body .ad-hero::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient( to bottom, rgba(255,255,255,0.0), rgba(255,255,255,0.06), rgba(255,255,255,0.0) );
        transform: translateY(-120%);
        opacity: .55;
        animation: adminScan 6.5s linear infinite;
        z-index: 1;
        pointer-events: none;
    }

    body.alg-admin-body .ad-hero > * {
        position: relative;
        z-index: 2;
    }

@keyframes adminCyberBorder {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes adminScan {
    0% {
        transform: translateY(-120%);
    }

    100% {
        transform: translateY(120%);
    }
}

/* ============================
   Cyber Premium Additions
   Safe: only applies on body.alg-admin-body
   ============================ */

body.alg-admin-body {
    /* darker, richer base so glass looks premium */
    background: radial-gradient(1200px 800px at 10% 10%, rgba(0,255,255,.10), transparent 60%), radial-gradient(1000px 700px at 90% 20%, rgba(255,0,255,.10), transparent 55%), radial-gradient(900px 700px at 70% 95%, rgba(255,140,0,.08), transparent 55%), linear-gradient(180deg, rgba(8,12,18,.10), rgba(8,12,18,.25));
}

/* A reusable neon edge overlay */
.ad-neon {
    position: relative;
    isolation: isolate;
}

    .ad-neon::before {
        content: "";
        position: absolute;
        inset: -2px;
        border-radius: inherit;
        background: linear-gradient(120deg, rgba(0,255,255,.0), rgba(0,255,255,.55), rgba(255,0,255,.55), rgba(255,140,0,.35), rgba(0,255,255,.0) );
        background-size: 220% 220%;
        opacity: .85;
        z-index: 0;
        pointer-events: none;
        animation: adNeonMove 10s ease-in-out infinite;
        filter: blur(.6px);
    }

    .ad-neon::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        background: radial-gradient(600px 220px at 20% 10%, rgba(255,255,255,.08), transparent 60%), linear-gradient(to bottom, rgba(255,255,255,.05), rgba(255,255,255,0));
        z-index: 0;
        pointer-events: none;
    }

@keyframes adNeonMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Make your .ad-glass feel more premium (no breaking changes) */
.ad-glass {
    position: relative;
    z-index: 1;
}

body.alg-admin-body .ad-glass {
    box-shadow: 0 22px 70px rgba(0,0,0,0.32), 0 0 0 1px rgba(255,255,255,0.08) inset, 0 0 18px rgba(0,255,255,0.10), 0 0 22px rgba(255,0,255,0.08);
}

/* Consistent “hero” header panel for admin pages */
.ad-hero {
    padding: 18px 18px;
    border-radius: 18px;
}

    .ad-hero .ad-hero-title {
        margin: 0;
        font-weight: 900;
        letter-spacing: .5px;
    }

    .ad-hero .ad-hero-sub {
        margin-top: .35rem;
        color: rgba(245,245,245,.78);
    }

    .ad-hero .ad-hero-actions {
        display: flex;
        gap: .5rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

/* Make standard buttons a bit more premium (won’t override your rainbow buttons) */
body.alg-admin-body .btn.btn-primary,
body.alg-admin-body .btn.btn-success,
body.alg-admin-body .btn.btn-danger,
body.alg-admin-body .btn.btn-warning,
body.alg-admin-body .btn.btn-info {
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(0,0,0,.22);
}

body.alg-admin-body .btn.btn-outline-secondary,
body.alg-admin-body .btn.btn-outline-light {
    border-color: rgba(255,255,255,0.22);
}

/* Make tables/cards pop more */
body.alg-admin-body .card,
body.alg-admin-body .table-responsive {
    border-radius: 18px;
    overflow: hidden;
}

body.alg-admin-body .table-hover tbody tr:hover {
    background: rgba(0,255,255,0.05);
    box-shadow: inset 0 0 0 9999px rgba(255,0,255,0.02);
}

/* Better readability on “white pages” that still exist */
body.alg-admin-body .bg-white,
body.alg-admin-body .bg-light {
    background: rgba(16,18,34,.38) !important;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ad-neon::before {
        animation: none !important;
    }
}

/* -------------------------------------------------------
   Cyber premium accents (ADMIN ONLY)
   Safe: purely visual, no layout-breaking overrides
--------------------------------------------------------*/
body.alg-admin-body {
    color: rgba(245,245,245,.94);
}

/* Accent variables */
body.alg-admin-body {
    --ad-cyan: rgba(0,255,255,.75);
    --ad-mag: rgba(255,0,255,.65);
    --ad-amb: rgba(255,140,0,.55);
    --ad-ink: rgba(245,245,245,.96);
}

/* Stronger glass + animated-ish accent border (static, no animation) */
.ad-glass {
    position: relative;
    isolation: isolate;
}

    .ad-glass::before {
        content: "";
        position: absolute;
        inset: -2px;
        border-radius: inherit;
        background: linear-gradient(120deg, rgba(0,255,255,.00), rgba(0,255,255,.55), rgba(255,0,255,.48), rgba(255,140,0,.30), rgba(0,255,255,.00) );
        opacity: .85;
        z-index: 0;
        pointer-events: none;
        filter: blur(.25px);
    }

    .ad-glass::after {
        /* inner dark layer to keep text readable */
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        background: rgba(10,12,18,.35);
        z-index: 0;
        pointer-events: none;
    }

    .ad-glass > * {
        position: relative;
        z-index: 1;
    }

/* Hero block (title + toolbar) */
.ad-hero {
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}

    .ad-hero h1, .ad-hero h2 {
        margin: 0;
        letter-spacing: .3px;
    }

    .ad-hero .ad-sub {
        color: rgba(245,245,245,.74);
    }

/* Toolbar buttons: keep your gradient buttons, but add glow on hover */
body.alg-admin-body .btn:hover {
    box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset, 0 0 14px rgba(0,255,255,.10), 0 0 18px rgba(255,0,255,.08);
}

/* Make “outline” buttons feel premium on admin */
body.alg-admin-body .btn-outline-secondary,
body.alg-admin-body .btn-outline-primary,
body.alg-admin-body .btn-outline-danger {
    border-color: rgba(255,255,255,.20);
    color: rgba(245,245,245,.92);
    background: rgba(255,255,255,.04);
}

    body.alg-admin-body .btn-outline-secondary:hover,
    body.alg-admin-body .btn-outline-primary:hover,
    body.alg-admin-body .btn-outline-danger:hover {
        background: rgba(255,255,255,.08);
        border-color: rgba(0,255,255,.30);
    }

/* Campaigns page support (if campaigns.css is neutral) */
body.alg-admin-body .campaigns-card {
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(16,18,34,.34);
    box-shadow: 0 18px 55px rgba(0,0,0,0.22);
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    body.alg-admin-body .campaigns-card {
        -webkit-backdrop-filter: blur(14px) saturate(1.18);
        backdrop-filter: blur(14px) saturate(1.18);
    }
}

body.alg-admin-body .campaigns-table thead th {
    color: rgba(245,245,245,.86);
}

/* Reduce “white page” look for big forms */
body.alg-admin-body .form-text {
    color: rgba(245,245,245,.65) !important;
}

/* -------------------------------------------------------
   Admin: ensure buttons are readable (site.css makes .btn 90% opacity)
------------------------------------------------------- */
body.alg-admin-body .btn{
  opacity: 1 !important;
}

/* Outline buttons: make them visible on glass / light areas */
body.alg-admin-body .btn-outline-secondary,
body.alg-admin-body .btn-outline-primary,
body.alg-admin-body .btn-outline-light{
  color: rgba(245,245,245,.94) !important;
  border-color: rgba(255,255,255,.28) !important;
  background: rgba(16,18,34,.18);
}

body.alg-admin-body .btn-outline-secondary:hover,
body.alg-admin-body .btn-outline-primary:hover,
body.alg-admin-body .btn-outline-light:hover{
  color: #fff !important;
  border-color: rgba(0,255,255,.55) !important;
  box-shadow:
    0 0 0 .2rem rgba(0,255,255,.10),
    0 0 18px rgba(255,0,255,.10);
}

/* Give card headers a cyber strip */
body.alg-admin-body .card .card-header {
    position: relative;
    overflow: hidden;
}

    body.alg-admin-body .card .card-header::before {
        content: "";
        position: absolute;
        inset: -2px;
        background: linear-gradient(120deg, rgba(0,255,255,.0), rgba(0,255,255,.25), rgba(255,0,255,.22), rgba(255,140,0,.16), rgba(0,255,255,.0) );
        opacity: .9;
        pointer-events: none;
    }

    body.alg-admin-body .card .card-header > * {
        position: relative;
        z-index: 1;
    }

/* ---------------- Admin sections (Create/Edit forms) ---------------- */
body.alg-admin-body .ad-section {
    margin-top: 16px;
}

    body.alg-admin-body .ad-section > .ad-glass {
        padding: 0;
    }

body.alg-admin-body .ad-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,.10);
    background: linear-gradient(90deg, rgba(0,255,255,.14), rgba(255,0,255,.12), rgba(255,140,0,.08) );
}

body.alg-admin-body .ad-section-title {
    margin: 0;
    font-weight: 800;
    letter-spacing: .2px;
    color: rgba(245,245,245,.96);
}

body.alg-admin-body .ad-section-body {
    padding: 14px;
}

body.alg-admin-body .ad-help {
    color: rgba(245,245,245,.72);
}

body.alg-admin-body .ad-chip {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .25rem .55rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(0,0,0,.10);
    color: rgba(245,245,245,.90);
    font-size: .82rem;
}

/* Section header strip (gradient top bar) */
.ad-section-header {
    padding: 14px 18px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: .3px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient( 90deg, rgba(0,255,255,.18), rgba(255,0,255,.18), rgba(255,165,0,.18) );
}

/* Small badge on header */
.ad-badge {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    font-size: .75rem;
}

/* Improve preview cards */
#ad-galleryPreview .card,
#galleryPreview .card {
    background: rgba(16, 18, 34, 0.55);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 14px;
    overflow: hidden;
}

#galleryPreview .card-img-top {
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

body.alg-admin-body .emailassets-scroll {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

body.alg-admin-body code.snip {
    display: block;
    white-space: nowrap;
    overflow: auto;
    max-width: 100%;
    padding: .35rem .5rem;
    border-radius: 10px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.10);
}

/* Allow horizontal scrolling inside admin tables even if site.css hides overflow-x */
body.alg-admin-body .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}

    /* Prevent the table from trying to squeeze columns into nothing */
    body.alg-admin-body .table-responsive > .table {
        min-width: 1100px;
    }

body.alg-admin-body .outbox-table {
    min-width: 1200px;
}

.feat-item {
    margin: 10px 0;
}

.feat-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(0,0,0,.20);
    box-shadow: 0 14px 40px rgba(0,0,0,.22);
}

.feat-handle {
    cursor: grab;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06);
}

.feat-img {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,.14);
}

.feat-name {
    font-weight: 700;
}