/* ═══════════════════════════════════════════════════
   BRAND CAMPAIGNS PAGE — brand/campaigns.php
   Uses CSS variables: --primary #F97316, --border #E5E7EB
═══════════════════════════════════════════════════ */

@keyframes rh-fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}
@keyframes rh-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}

/* ── Page header ── */
.b-page-head {
    background: #fff;
    border: 1.5px solid #E5E7EB;
    border-radius: 1.1rem;
    padding: 1rem 1.2rem;
    margin-bottom: 1.1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    animation: rh-fadeUp .28s ease;
}
.b-page-head h1 { font-weight: 900; font-size: 1.1rem; color: #111827; margin: 0; }
.b-page-head p  { font-size: .81rem; color: #6B7280; margin: .18rem 0 0; }

/* ── Alert ── */
.b-alert {
    border-radius: .75rem;
    padding: .65rem .95rem;
    font-size: .83rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .9rem;
    animation: rh-fadeUp .22s ease;
}
.ba-success { background: #D1FAE5; border: 1.5px solid #6EE7B7; color: #065F46; }
.ba-danger  { background: #FEE2E2; border: 1.5px solid #FECACA; color: #991B1B; }

/* ── Common buttons ── */
.btn-bh-primary {
    background: #F97316;
    color: #fff;
    border: none;
    border-radius: .65rem;
    padding: .48rem 1.1rem;
    font-size: .82rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    cursor: pointer;
    font-family: inherit;
    transition: background .15s, transform .15s;
    box-shadow: 0 3px 10px rgba(249,115,22,.25);
    white-space: nowrap;
}
.btn-bh-primary:hover { background: #EA580C; transform: translateY(-1px); }

.btn-bh-outline {
    background: #fff;
    border: 1.5px solid #E5E7EB;
    color: #374151;
    border-radius: .55rem;
    padding: .4rem .9rem;
    font-size: .8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    transition: all .15s;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
}
.btn-bh-outline:hover { border-color: #F97316; color: #F97316; }

.btn-bh-danger {
    background: #FEF2F2;
    border: 1.5px solid #FECACA;
    color: #991B1B;
    border-radius: .55rem;
    padding: .38rem .8rem;
    font-size: .78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
    white-space: nowrap;
}
.btn-bh-danger:hover { background: #FEE2E2; border-color: #F87171; }

.btn-bh-warning {
    background: #FFFBEB;
    border: 1.5px solid #FDE68A;
    color: #92400E;
    border-radius: .55rem;
    padding: .38rem .8rem;
    font-size: .78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
    white-space: nowrap;
}
.btn-bh-warning:hover { background: #FEF3C7; border-color: #F59E0B; }

.btn-bh-success {
    background: #F0FDF4;
    border: 1.5px solid #86EFAC;
    color: #065F46;
    border-radius: .55rem;
    padding: .38rem .8rem;
    font-size: .78rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
    white-space: nowrap;
}
.btn-bh-success:hover { background: #D1FAE5; border-color: #34D399; }

/* ── Toolbar / filter bar ── */
.b-toolbar {
    background: #fff;
    border: 1.5px solid #E5E7EB;
    border-radius: 1rem;
    padding: .7rem .9rem;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    animation: rh-fadeUp .3s ease;
}

.b-filter-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.b-chip {
    display: inline-flex;
    align-items: center;
    gap: .28rem;
    padding: .28rem .8rem;
    border-radius: 50px;
    font-size: .78rem;
    font-weight: 700;
    border: 1.5px solid #E5E7EB;
    background: #fff;
    color: #6B7280;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.b-chip:hover  { border-color: #F97316; color: #F97316; background: #FFF7ED; }
.b-chip.active { border-color: #F97316; background: #F97316; color: #fff; }
.b-chip .cc {
    background: rgba(255,255,255,.25);
    border-radius: 99px;
    padding: .02rem .35rem;
    font-size: .66rem;
}
.b-chip:not(.active) .cc { background: #F3F4F6; color: #6B7280; }

.b-result-meta { margin-left: auto; font-size: .78rem; color: #9CA3AF; white-space: nowrap; font-weight: 500; }
.b-result-meta strong { color: #374151; }

/* ── Campaign grid ── */
.bc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* ── Campaign card ── */
.bc-card {
    background: #fff;
    border: 1.5px solid #E5E7EB;
    border-radius: 1.1rem;
    overflow: hidden;
    animation: rh-fadeUp .32s ease both;
    display: flex;
    flex-direction: column;
}
.bc-card:nth-child(2) { animation-delay: .05s; }
.bc-card:nth-child(3) { animation-delay: .10s; }
.bc-card:nth-child(4) { animation-delay: .15s; }
.bc-card:nth-child(5) { animation-delay: .20s; }
.bc-card:nth-child(6) { animation-delay: .25s; }

/* card thumb */
.bc-thumb {
    height: 130px;
    position: relative;
    overflow: hidden;
    background: #F3F4F6;
}
.bc-thumb-bg {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.8rem;
}
.bc-thumb-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.32) 0%, transparent 55%);
}
.bc-status-wrap { position: absolute; top: .6rem; right: .6rem; }
.bc-id-badge {
    position: absolute; top: .6rem; left: .6rem;
    background: rgba(0,0,0,.45);
    color: #fff;
    font-size: .66rem; font-weight: 800;
    border-radius: 99px;
    padding: .16rem .52rem;
    backdrop-filter: blur(4px);
}

/* card body */
.bc-body { padding: .9rem 1rem; flex: 1; display: flex; flex-direction: column; }
.bc-title {
    font-weight: 800; font-size: .88rem; line-height: 1.38;
    color: #111827; margin-bottom: .5rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.bc-meta-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .6rem; }
.bc-meta-chip {
    display: inline-flex; align-items: center; gap: .25rem;
    background: #F3F4F6; border-radius: .35rem;
    padding: .16rem .48rem; font-size: .7rem; color: #4B5563; font-weight: 600;
}
.bc-meta-chip .bi { font-size: .66rem; }

/* card actions */
.bc-actions {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    padding: .75rem 1rem;
    border-top: 1px solid #F3F4F6;
    background: #FAFAFA;
}

/* ── Status badges ── */
.bc-badge {
    display: inline-flex; align-items: center; gap: .24rem;
    padding: .18rem .58rem; border-radius: 99px;
    font-size: .68rem; font-weight: 700; white-space: nowrap;
}
.bcb-draft     { background: #F3F4F6; color: #6B7280; }
.bcb-published { background: #D1FAE5; color: #065F46; }
.bcb-closed    { background: #FEE2E2; color: #991B1B; }
.bcb-paused    { background: #FEF9C3; color: #92400E; }
.bcb-pending   { background: #DBEAFE; color: #1D4ED8; }

/* ── Skeleton loading ── */
.rh-skeleton {
    background: linear-gradient(90deg, #F3F4F6 25%, #EBEBEB 50%, #F3F4F6 75%);
    background-size: 1200px 100%;
    animation: rh-shimmer 1.4s infinite;
    border-radius: .5rem;
}

/* ── Empty state ── */
.bc-empty {
    grid-column: 1 / -1;
    background: #fff;
    border: 1.5px dashed #E5E7EB;
    border-radius: 1rem;
    text-align: center;
    padding: 3rem 1.5rem;
    animation: rh-fadeUp .35s ease;
}
.bc-empty .emo { font-size: 2.5rem; margin-bottom: .8rem; }
.bc-empty h5 { font-weight: 800; margin-bottom: .4rem; }
.bc-empty p { color: #6B7280; font-size: .88rem; margin: 0; }

/* ── Create form section ── */
.b-section-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1.5px solid #E5E7EB;
    border-radius: 1rem;
    padding: .8rem 1.1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    animation: rh-fadeUp .3s ease;
}
.b-section-toggle h2 { font-weight: 800; font-size: .95rem; color: #111827; margin: 0; }
.b-section-toggle:hover { border-color: #F97316; }

.b-form-card {
    background: #fff;
    border: 1.5px solid #E5E7EB;
    border-radius: 1.25rem;
    overflow: hidden;
    animation: rh-fadeUp .32s ease both;
    margin-bottom: 1.5rem;
}
.b-form-head {
    background: linear-gradient(90deg, #FFF7ED, #fff);
    padding: .85rem 1.3rem;
    border-bottom: 1.5px solid #F3F4F6;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.b-form-head h2 { font-weight: 800; font-size: .9rem; color: #111827; margin: 0; }
.b-form-body { padding: 1.4rem; }

/* inputs */
.flabel {
    font-weight: 700; font-size: .78rem;
    text-transform: uppercase; letter-spacing: .5px;
    color: #6B7280; display: block; margin-bottom: .32rem;
}
.flabel .req { color: #F97316; }
.flabel .hint { font-weight: 500; color: #9CA3AF; text-transform: none; letter-spacing: 0; margin-left: .3rem; }
.finp {
    width: 100%; background: #F9FAFB;
    border: 1.5px solid #E5E7EB; border-radius: .6rem;
    padding: .52rem .82rem; font-size: .86rem;
    font-family: inherit; color: #111827;
    transition: border-color .16s, box-shadow .16s;
}
.finp:focus { outline: none; border-color: #F97316; box-shadow: 0 0 0 3px rgba(249,115,22,.1); background: #fff; }
.finp::placeholder { color: #D1D5DB; }
textarea.finp { resize: vertical; min-height: 90px; }
select.finp {
    cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .75rem center;
}
.f-section {
    display: flex; align-items: center; gap: .6rem;
    margin: 1.1rem 0 .7rem;
    font-size: .7rem; font-weight: 800; color: #9CA3AF;
    text-transform: uppercase; letter-spacing: 1px;
}
.f-section::before, .f-section::after { content: ''; flex: 1; height: 1px; background: #F3F4F6; }
.char-count { float: right; font-size: .72rem; color: #9CA3AF; font-weight: 600; }

.type-opts { display: flex; gap: .5rem; flex-wrap: wrap; }
.type-opt input { display: none; }
.type-opt label {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .38rem .9rem; border-radius: 50px;
    font-size: .8rem; font-weight: 700;
    border: 1.5px solid #E5E7EB; color: #6B7280;
    cursor: pointer; transition: all .15s;
}
.type-opt input:checked + label { border-color: #F97316; background: #FFF7ED; color: #C2410C; }
.type-opt label:hover { border-color: #F97316; color: #F97316; }

.b-form-foot {
    padding: 1rem 1.4rem;
    border-top: 1.5px solid #F3F4F6;
    background: #F9FAFB;
    display: flex; align-items: center; gap: .65rem; flex-wrap: wrap;
}
.btn-submit {
    background: #F97316; color: #fff; border: none;
    border-radius: .65rem; padding: .6rem 1.5rem;
    font-size: .9rem; font-weight: 800;
    display: inline-flex; align-items: center; gap: .4rem;
    transition: all .16s; box-shadow: 0 3px 12px rgba(249,115,22,.28);
    cursor: pointer; font-family: inherit;
}
.btn-submit:hover { background: #EA580C; transform: translateY(-1px); box-shadow: 0 5px 18px rgba(249,115,22,.35); }
.btn-submit:disabled { background: #D1D5DB; box-shadow: none; transform: none; cursor: not-allowed; color: #6B7280; }
.btn-secondary {
    background: #fff; border: 1.5px solid #E5E7EB; color: #374151;
    border-radius: .65rem; padding: .58rem 1.2rem;
    font-size: .86rem; font-weight: 700;
    display: inline-flex; align-items: center; gap: .4rem;
    transition: all .15s; text-decoration: none;
    cursor: pointer; font-family: inherit;
}
.btn-secondary:hover { border-color: #F97316; color: #F97316; }

/* ── Edit modal ── */
.b-modal-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 1050;
    align-items: center; justify-content: center;
}
.b-modal-backdrop.open { display: flex; }
.b-modal {
    background: #fff;
    border-radius: 1.25rem;
    width: min(540px, calc(100vw - 2rem));
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    animation: rh-fadeUp .22s ease;
}
.b-modal-head {
    padding: 1rem 1.3rem;
    border-bottom: 1.5px solid #F3F4F6;
    display: flex; align-items: center; justify-content: space-between;
}
.b-modal-head h3 { font-weight: 800; font-size: .95rem; color: #111827; margin: 0; }
.b-modal-body { padding: 1.3rem; }
.b-modal-foot {
    padding: .9rem 1.3rem;
    border-top: 1.5px solid #F3F4F6;
    background: #F9FAFB;
    display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end;
}

@media (max-width: 640px) {
    .bc-grid { grid-template-columns: 1fr; }
    .b-form-foot { flex-direction: column; align-items: stretch; }
    .btn-submit, .btn-secondary { justify-content: center; }
    .b-toolbar { flex-direction: column; align-items: stretch; }
    .b-result-meta { margin-left: 0; }
}
