/* ═══════════════════════════════════════════════════════════════
   ADCW Admin — Premium Dark Theme
   Palette: Deep Indigo × Molten Gold × Soft Orchid
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Vazirmatn:wght@300;400;500;600;700;900&display=swap');

/* ── Custom Properties ─────────────────────────────────────────── */
:root {
    --gold:          #d4a843;
    --gold-light:    #edd990;
    --gold-glow:     rgba(212, 168, 67, 0.25);
    --gold-subtle:   rgba(212, 168, 67, 0.08);

    --deep:          #0b0917;
    --surface:       #110e21;
    --panel:         #18142e;
    --card:          #1f1a38;
    --hover:         #261f42;
    --border:        #2a2447;
    --border-bright: #3d3560;

    --text:          #e2d9f8;
    --text-soft:     #b0a3d4;
    --text-muted:    #6b5f9e;

    --orchid:        #9b6fd4;
    --orchid-dim:    rgba(155, 111, 212, 0.15);

    --emerald:       #3ecf8e;
    --emerald-dim:   rgba(62, 207, 142, 0.12);

    --rose:          #e05555;
    --rose-dim:      rgba(224, 85, 85, 0.12);

    --radius-sm:     6px;
    --radius:        12px;
    --radius-lg:     18px;

    --font-body:     'Vazirmatn', Tahoma, sans-serif;
    --font-display:  'Cinzel', Georgia, serif;

    --transition:    all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Global WordPress overrides ────────────────────────────────── */
#wpwrap {
    background: var(--deep) !important;
}

#wpcontent,
#wpbody-content {
    background: var(--deep) !important;
    color: var(--text) !important;
}

/* ── Wrapper ────────────────────────────────────────────────────── */
.adcw-wrap {
    max-width: 1060px;
    margin: 28px auto;
    padding: 0 20px 80px;
    direction: rtl;
    font-family: var(--font-body);
}

/* ══════════════════════════════════════════════════════════════════
   HERO HEADER
══════════════════════════════════════════════════════════════════ */
.adcw-header {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 38px 44px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
}

/* glowing orbs */
.adcw-header::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -40px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(212,168,67,.18) 0%, transparent 65%);
    pointer-events: none;
}

.adcw-header::after {
    content: '';
    position: absolute;
    bottom: -70px;
    left: -50px;
    width: 260px;
    height: 260px;
    background: radial-gradient(circle, rgba(155,111,212,.14) 0%, transparent 65%);
    pointer-events: none;
}

/* subtle diagonal line overlay */
.adcw-header-bg {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
            -55deg,
            transparent,
            transparent 40px,
            rgba(255,255,255,.012) 40px,
            rgba(255,255,255,.012) 41px
    );
    pointer-events: none;
}

.adcw-header-icon {
    position: relative;
    z-index: 1;
    font-size: 52px;
    line-height: 1;
    filter: drop-shadow(0 0 18px var(--gold-glow));
    flex-shrink: 0;
}

.adcw-header-text {
    position: relative;
    z-index: 1;
}

.adcw-header-text h1 {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--gold-light) !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
    border: none !important;
    letter-spacing: 1px;
    text-shadow: 0 0 30px var(--gold-glow);
}

.adcw-header-text p {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 300;
    margin: 0;
    letter-spacing: .2px;
}

/* decorative corner line */
.adcw-header-corner {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), transparent);
    border-radius: 0 3px 0 0;
}

/* ══════════════════════════════════════════════════════════════════
   NOTICE
══════════════════════════════════════════════════════════════════ */
.adcw-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    margin-bottom: 22px;
    background: var(--emerald-dim);
    border: 1px solid rgba(62, 207, 142, .3);
    border-radius: var(--radius);
    color: var(--emerald);
    font-weight: 600;
    font-size: 14px;
    animation: noticeIn .35s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes noticeIn {
    from { opacity: 0; transform: translateY(-10px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ══════════════════════════════════════════════════════════════════
   TAB NAVIGATION
══════════════════════════════════════════════════════════════════ */
.adcw-tabs-nav {
    display: flex;
    gap: 3px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px;
    margin-bottom: 22px;
    overflow-x: auto;
    scrollbar-width: none;
}

.adcw-tabs-nav::-webkit-scrollbar { display: none; }

.adcw-tab-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding: 11px 22px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: .2px;
    overflow: hidden;
}

.adcw-tab-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    background: linear-gradient(135deg, rgba(212,168,67,.1), rgba(155,111,212,.06));
    transition: opacity .2s;
    border-radius: var(--radius-sm);
}

.adcw-tab-btn:hover {
    color: var(--text);
    border-color: var(--border-bright);
}

.adcw-tab-btn:hover::before { opacity: 1; }

.adcw-tab-btn.active {
    background: linear-gradient(135deg, #231c40, #2e2652);
    color: var(--gold-light);
    border-color: rgba(212,168,67,.25);
    box-shadow:
            0 4px 20px rgba(0,0,0,.35),
            inset 0 1px 0 rgba(212,168,67,.15),
            0 0 0 1px rgba(212,168,67,.08);
}

.adcw-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 2px;
    background: var(--gold);
    border-radius: 2px 2px 0 0;
    box-shadow: 0 0 8px var(--gold-glow);
}

.tab-icon { font-size: 15px; }

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: rgba(255,255,255,.08);
    color: var(--text-soft);
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    transition: var(--transition);
}

.adcw-tab-btn.active .tab-badge {
    background: var(--gold);
    color: var(--deep);
}

/* ══════════════════════════════════════════════════════════════════
   TAB PANELS
══════════════════════════════════════════════════════════════════ */
.adcw-tab-panel {
    display: none;
}

.adcw-tab-panel.active {
    display: block;
    animation: panelIn .28s cubic-bezier(.4,0,.2,1) both;
}

@keyframes panelIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════════
   SECTION CARDS
══════════════════════════════════════════════════════════════════ */
.adcw-section {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,.2);
    transition: border-color .2s;
}

.adcw-section:hover {
    border-color: var(--border-bright);
}

.adcw-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(90deg, rgba(212,168,67,.05) 0%, transparent 60%);
}

.adcw-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .3px;
}

.adcw-section-title .s-icon { font-size: 18px; }

.adcw-section-body {
    padding: 26px 28px;
}

/* ══════════════════════════════════════════════════════════════════
   ITEM CARDS (Repeater)
══════════════════════════════════════════════════════════════════ */
.adcw-item-card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 14px;
    overflow: hidden;
    transition: var(--transition);
}

.adcw-item-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--gold), var(--orchid));
    opacity: 0;
    transition: opacity .2s;
}

.adcw-item-card:hover {
    border-color: var(--border-bright);
    box-shadow: 0 6px 28px rgba(0,0,0,.3);
    transform: translateY(-1px);
}

.adcw-item-card:hover::before { opacity: 1; }

.adcw-item-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,.025);
}

.item-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-soft);
}

.item-title::before {
    content: '';
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 6px var(--gold-glow);
    flex-shrink: 0;
}

.adcw-item-card-body {
    padding: 22px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ══════════════════════════════════════════════════════════════════
   FORM FIELDS
══════════════════════════════════════════════════════════════════ */
.adcw-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.adcw-field.full-width {
    grid-column: 1 / -1;
}

.adcw-field label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .7px;
}

.adcw-field input[type="text"],
.adcw-field input[type="url"],
.adcw-field input[type="email"],
.adcw-field textarea,
.adcw-wrap input[type="text"],
.adcw-wrap textarea {
    background: rgba(255,255,255,.04) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text) !important;
    font-family: var(--font-body) !important;
    font-size: 13px !important;
    padding: 10px 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    transition: var(--transition) !important;
    outline: none !important;
    box-shadow: none !important;
    line-height: 1.5 !important;
}

.adcw-field input:focus,
.adcw-field textarea:focus,
.adcw-wrap input[type="text"]:focus,
.adcw-wrap textarea:focus {
    border-color: rgba(212,168,67,.45) !important;
    background: rgba(212,168,67,.04) !important;
    box-shadow: 0 0 0 3px rgba(212,168,67,.07), inset 0 1px 3px rgba(0,0,0,.15) !important;
}

.adcw-field textarea {
    min-height: 90px;
    resize: vertical;
}

/* placeholder */
.adcw-field input::placeholder,
.adcw-field textarea::placeholder {
    color: var(--text-muted);
    opacity: .6;
    font-weight: 300;
}

/* ══════════════════════════════════════════════════════════════════
   COLOR PICKERS
══════════════════════════════════════════════════════════════════ */
.adcw-color-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    grid-column: 1 / -1;
}

.adcw-color-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex: 1;
    min-width: 120px;
}

.adcw-color-field label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .7px;
}

/* Override WP color picker chrome */
.adcw-wrap .wp-picker-container {
    display: inline-block;
}

.adcw-wrap .wp-picker-container .wp-color-result.button {
    background: var(--card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: none !important;
    height: 38px !important;
    transition: var(--transition) !important;
}

.adcw-wrap .wp-picker-container .wp-color-result.button:hover {
    border-color: var(--border-bright) !important;
    box-shadow: 0 0 0 2px rgba(212,168,67,.12) !important;
}

.adcw-wrap .wp-picker-container .wp-color-result-text {
    color: var(--text-soft) !important;
    font-family: var(--font-body) !important;
    font-size: 12px !important;
}

/* ══════════════════════════════════════════════════════════════════
   MEDIA UPLOADER
══════════════════════════════════════════════════════════════════ */
.adcw-media-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.adcw-media-preview {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(255,255,255,.03);
    flex-shrink: 0;
    transition: border-color .2s;
}

.adcw-media-preview:has(img) {
    border-style: solid;
    border-color: rgba(212,168,67,.2);
}

.adcw-media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.adcw-media-preview .placeholder {
    font-size: 20px;
    opacity: .3;
}

/* ══════════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════════ */
.adcw-btn,
button.adcw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1;
    letter-spacing: .2px;
    white-space: nowrap;
    box-sizing: border-box;
}

/* Primary – Gold CTA */
.adcw-btn-primary {
    background: linear-gradient(135deg, #c49530, var(--gold));
    color: #0f0c1a !important;
    border-color: transparent;
    box-shadow: 0 4px 18px rgba(212,168,67,.3), inset 0 1px 0 rgba(255,255,255,.18);
    font-weight: 700;
}

.adcw-btn-primary:hover {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    box-shadow: 0 6px 26px rgba(212,168,67,.45), inset 0 1px 0 rgba(255,255,255,.22);
    transform: translateY(-1px);
    color: #0f0c1a !important;
}

.adcw-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(212,168,67,.25);
}

/* Add (dashed) */
.adcw-btn-add {
    width: 100%;
    padding: 14px;
    background: rgba(62,207,142,.06);
    border: 1px dashed rgba(62,207,142,.3);
    border-radius: var(--radius);
    color: var(--emerald);
    font-size: 13px;
    font-weight: 600;
    margin-top: 6px;
    transition: var(--transition);
}

.adcw-btn-add:hover {
    background: rgba(62,207,142,.12);
    border-color: rgba(62,207,142,.6);
    box-shadow: 0 0 20px rgba(62,207,142,.08);
    transform: none;
}

/* Danger */
.adcw-btn-danger {
    background: var(--rose-dim);
    border: 1px solid rgba(224,85,85,.2);
    color: var(--rose);
    padding: 6px 12px;
    font-size: 12px;
}

.adcw-btn-danger:hover {
    background: rgba(224,85,85,.2);
    border-color: var(--rose);
    box-shadow: 0 0 12px rgba(224,85,85,.15);
}

/* Media / ghost */
.adcw-btn-media {
    background: rgba(255,255,255,.06);
    border: 1px solid var(--border);
    color: var(--text-soft);
    padding: 8px 14px;
    font-size: 12px;
}

.adcw-btn-media:hover {
    background: rgba(255,255,255,.1);
    border-color: var(--border-bright);
    color: var(--text);
}

/* ══════════════════════════════════════════════════════════════════
   SAVE BAR (Sticky)
══════════════════════════════════════════════════════════════════ */
.adcw-save-bar {
    position: sticky;
    bottom: 16px;
    z-index: 99;
    margin-top: 28px;
    padding: 16px 28px;
    background: rgba(17, 14, 33, .92);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 -4px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(212,168,67,.06);
}

.adcw-save-bar-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
}

.adcw-save-bar-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--emerald);
    box-shadow: 0 0 8px rgba(62,207,142,.7);
    animation: dotPulse 2.2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 8px rgba(62,207,142,.7); }
    50%       { opacity: .45; transform: scale(.65); box-shadow: 0 0 4px rgba(62,207,142,.3); }
}

/* ══════════════════════════════════════════════════════════════════
   DIVIDER
══════════════════════════════════════════════════════════════════ */
.adcw-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 22px 0;
}

/* ══════════════════════════════════════════════════════════════════
   SCROLLBAR
══════════════════════════════════════════════════════════════════ */
.adcw-wrap ::-webkit-scrollbar { width: 5px; height: 5px; }
.adcw-wrap ::-webkit-scrollbar-track { background: transparent; }
.adcw-wrap ::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }
.adcw-wrap ::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════════
   CARD REMOVE ANIMATION (JS triggers opacity/transform)
══════════════════════════════════════════════════════════════════ */
.adcw-item-card.removing {
    opacity: 0 !important;
    transform: translateX(20px) scale(.96) !important;
    transition: all .22s ease !important;
    pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════════ */
@media (max-width: 860px) {
    .adcw-item-card-body {
        grid-template-columns: 1fr;
    }
    .adcw-field.full-width {
        grid-column: auto;
    }
    .adcw-color-row {
        flex-direction: column;
    }
}

@media (max-width: 660px) {
    .adcw-wrap { padding: 0 12px 80px; }

    .adcw-header {
        flex-direction: column;
        text-align: center;
        padding: 28px 20px;
    }

    .adcw-tabs-nav {
        flex-direction: column;
        gap: 4px;
    }

    .adcw-tab-btn {
        justify-content: center;
        padding: 12px 16px;
    }

    .adcw-tab-btn.active::after { display: none; }

    .adcw-section-body { padding: 18px 16px; }
    .adcw-section-header { padding: 14px 16px; }
    .adcw-item-card-head { padding: 11px 14px; }
    .adcw-item-card-body { padding: 16px 14px; }

    .adcw-save-bar {
        flex-direction: column;
        text-align: center;
        bottom: 10px;
        padding: 14px 18px;
    }

    .adcw-btn-primary { width: 100%; }
}

@media (max-width: 420px) {
    .adcw-header-text h1 { font-size: 18px; }
    .adcw-header-icon { font-size: 38px; }
}
