/* =============================================================================
   Admin Content Manager — Styles
   These styles are isolated to the admin UI and do not affect the public site.
============================================================================= */

/* ── Admin Trigger Button (fixed gear icon, bottom-right) ─────────────────── */
.admin-trigger {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 900;
    width: 2.625rem;
    height: 2.625rem;
    border-radius: 50%;
    border: 1px solid rgba(12, 47, 102, 0.18);
    background: rgba(255, 250, 241, 0.92);
    color: #536884;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    box-shadow: 0 2px 10px rgba(12, 47, 102, 0.1);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.admin-trigger:hover,
.admin-trigger:focus-visible {
    background: #0c2f66;
    color: #fff;
    outline: none;
    box-shadow: 0 6px 20px rgba(12, 47, 102, 0.25);
    transform: scale(1.08);
}

.admin-trigger svg {
    width: 1rem;
    height: 1rem;
    display: block;
}

/* ── Sign-In Overlay ──────────────────────────────────────────────────────── */
.admin-signin-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    border: none;
    padding: 1rem;
    background: rgba(8, 36, 79, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.admin-signin-overlay::backdrop {
    background: transparent;
}

.admin-signin-box {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    padding: 2.5rem 2rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 28px 70px rgba(8, 36, 79, 0.32);
    animation: adminPopIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.admin-signin-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.125rem;
}

.admin-signin-logo img {
    width: 3.25rem;
    height: 3.25rem;
    object-fit: contain;
    border-radius: 50%;
}

.admin-signin-title {
    margin: 0 0 0.3rem !important;
    font-family: "Cormorant Garamond", Georgia, serif !important;
    font-size: 1.85rem !important;
    font-weight: 700 !important;
    color: #0c2f66 !important;
    text-align: center;
    line-height: 1.1 !important;
    max-width: none !important;
}

.admin-signin-sub {
    margin: 0 0 1.75rem !important;
    font-size: 0.875rem;
    color: #63738b;
    text-align: center;
}

/* Close button (×) */
.admin-modal-close {
    position: absolute;
    top: 0.875rem;
    right: 0.875rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #63738b;
    font-size: 1.375rem;
    line-height: 1;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
}

.admin-modal-close:hover,
.admin-modal-close:focus-visible {
    background: #f4ead8;
    color: #0c2f66;
    outline: none;
}

/* ── Shared Admin Form Fields ─────────────────────────────────────────────── */
.admin-signin-box .adf,
.admin-signin-box .adf + .adf {
    margin-bottom: 0.875rem;
}

.adf {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.adf label {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #20324f;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* "edited" badge next to modified field labels */
.adf__tag {
    display: inline-block;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: #c9981f;
    color: #211805;
    border-radius: 4px;
    padding: 0.1em 0.45em;
    line-height: 1.6;
}

.adf input[type="text"],
.adf input[type="password"],
.adf textarea {
    padding: 0.6rem 0.8rem;
    border: 1.5px solid #dce5f0;
    border-radius: 8px;
    background: #f8fbfe;
    color: #20324f;
    font-family: "Nunito Sans", Arial, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.55;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    outline: none;
    resize: vertical;
    width: 100%;
    box-sizing: border-box;
}

.adf input[type="text"]:focus,
.adf input[type="password"]:focus,
.adf textarea:focus {
    border-color: #0c2f66;
    box-shadow: 0 0 0 3px rgba(12, 47, 102, 0.11);
    background: #fff;
}

.adf + .adf,
.adf--spaced {
    margin-bottom: 1.25rem;
}

/* Modified field indicator */
.adf--m {
    border-left: 3px solid #c9981f;
    padding-left: 0.625rem;
    margin-left: -0.625rem;
}

/* ── Error message ────────────────────────────────────────────────────────── */
.admin-error {
    background: #fff2f2;
    border: 1.5px solid #f5c6c6;
    border-radius: 7px;
    padding: 0.6rem 0.875rem;
    font-size: 0.875rem;
    color: #c0392b;
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* ── Admin Buttons ────────────────────────────────────────────────────────── */
.admin-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    background: #0c2f66;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 0.65rem 1.375rem;
    font-family: "Nunito Sans", Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.admin-btn-primary:hover:not(:disabled) {
    background: #08244f;
    box-shadow: 0 4px 14px rgba(12, 47, 102, 0.22);
}

.admin-btn-primary:disabled {
    opacity: 0.6;
    cursor: default;
}

.admin-btn-full {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
}

.admin-btn-outline {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.38);
    color: #fff;
    border-radius: 8px;
    padding: 0.55rem 1rem;
    font-family: "Nunito Sans", Arial, sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.admin-btn-outline:hover,
.admin-btn-outline:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.7);
    outline: none;
}

.admin-btn-ghost {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.72);
    padding: 0.55rem 0.875rem;
    font-family: "Nunito Sans", Arial, sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
}

.admin-btn-ghost:hover,
.admin-btn-ghost:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.admin-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 7px;
    transition: color 0.15s, background 0.15s;
}

.admin-btn-icon:hover,
.admin-btn-icon:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    outline: none;
}

/* ── Dashboard (full-screen overlay) ─────────────────────────────────────── */
.admin-dashboard {
    position: fixed;
    inset: 0;
    z-index: 1000;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border: none;
    padding: 0;
    margin: 0;
    background: #eef2f8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-dashboard::backdrop {
    background: transparent;
}

body.admin-is-open {
    overflow: hidden;
}

/* Top bar */
.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: 3.75rem;
    background: #0c2f66;
    color: #fff;
    flex-shrink: 0;
    gap: 1rem;
    box-shadow: 0 2px 10px rgba(8, 36, 79, 0.22);
}

.admin-topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    white-space: nowrap;
}

.admin-topbar-brand img {
    width: 1.75rem;
    height: 1.75rem;
    object-fit: contain;
    border-radius: 50%;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Gold Save button inside topbar */
.admin-topbar .admin-btn-primary {
    background: #c9981f;
}

.admin-topbar .admin-btn-primary:hover:not(:disabled) {
    background: #8b650f;
}

/* ── Dashboard body (scrollable) ──────────────────────────────────────────── */
.admin-dash-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ── Language Tabs ────────────────────────────────────────────────────────── */
.adtabs {
    display: flex;
    gap: 0.125rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid #d0daea;
}

.adtabs__btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: "Nunito Sans", Arial, sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #63738b;
    padding: 0.6rem 1.25rem;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -2px;
    border-radius: 6px 6px 0 0;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    white-space: nowrap;
}

.adtabs__btn:hover {
    color: #0c2f66;
    background: rgba(12, 47, 102, 0.05);
}

.adtabs__btn--on {
    color: #0c2f66;
    border-bottom-color: #0c2f66;
}

/* ── Accordion Sections ───────────────────────────────────────────────────── */
.adsec {
    background: #ffffff;
    border: 1.5px solid #d8e3ee;
    border-radius: 11px;
    margin-bottom: 0.625rem;
    overflow: hidden;
}

.adsec__head {
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-family: "Nunito Sans", Arial, sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #0c2f66;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    -webkit-user-select: none;
    user-select: none;
    transition: background 0.15s;
    gap: 1rem;
}

.adsec__head::-webkit-details-marker {
    display: none;
}

.adsec__head::after {
    content: '';
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid #8098b4;
    border-bottom: 2px solid #8098b4;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.adsec[open] > .adsec__head::after {
    transform: rotate(-135deg) translateY(-2px);
}

.adsec__head:hover {
    background: #f4f8fc;
}

.adsec__body {
    padding: 1.25rem;
    display: grid;
    gap: 1rem;
    border-top: 1.5px solid #d8e3ee;
    background: #fafcfe;
}

/* ── Animation ────────────────────────────────────────────────────────────── */
@keyframes adminPopIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .admin-topbar {
        padding: 0 0.875rem;
        height: 3.25rem;
    }

    .admin-topbar-brand span {
        display: none;
    }

    .admin-topbar-actions {
        gap: 0.25rem;
    }

    .admin-btn-outline {
        display: none;
    }

    .admin-btn-ghost {
        padding: 0.5rem 0.5rem;
        font-size: 0.8rem;
    }

    .admin-dash-body {
        padding: 1rem;
    }

    .admin-signin-box {
        padding: 2rem 1.25rem 1.5rem;
    }

    .admin-trigger {
        bottom: 1rem;
        right: 1rem;
        width: 2.25rem;
        height: 2.25rem;
    }
}

/* ── Site Settings / Gallery Uploader ─────────────────────────────────── */
.adsec--global {
    border-left: 3px solid var(--gold);
}

.adf__hint {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.45;
}

.adf__status {
    min-height: 1.2rem;
    color: var(--navy);
    font-weight: 600;
}

input[type="file"]#adf-gallery-upload {
    width: 100%;
    padding: 0.75rem;
    background: var(--cream);
    border: 1.5px dashed var(--line);
    border-radius: var(--radius);
    font: inherit;
    color: var(--ink);
    cursor: pointer;
}

input[type="file"]#adf-gallery-upload:hover {
    border-color: var(--gold);
    background: rgba(201, 152, 31, 0.06);
}

.thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.thumb-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    overflow: hidden;
    background: var(--cream-deep);
    box-shadow: var(--shadow-soft);
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    border: none;
    background: rgba(12, 47, 102, 0.85);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, transform 0.18s ease;
}

.thumb-del:hover,
.thumb-del:focus-visible {
    background: #c0392b;
    transform: scale(1.1);
    outline: none;
}
/* Thumbnail reorder + number badge */
.thumb-num {
    position: absolute;
    top: 4px;
    left: 4px;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.35rem;
    border-radius: 0.7rem;
    background: rgba(12, 47, 102, 0.85);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.4rem;
    text-align: center;
}

.thumb-moves {
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.thumb-move {
    pointer-events: auto;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    border: none;
    background: rgba(12, 47, 102, 0.85);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, transform 0.18s ease;
}

.thumb-move:hover:not(:disabled),
.thumb-move:focus-visible:not(:disabled) {
    background: var(--gold);
    color: var(--navy);
    transform: scale(1.1);
    outline: none;
}

.thumb-move:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
/* Drag-and-drop reorder states */
.thumb-item {
    cursor: grab;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}
.thumb-item:active { cursor: grabbing; }
.thumb-item.is-dragging {
    opacity: 0.4;
    transform: scale(0.96);
}
.thumb-item.is-drop-target {
    outline: 3px dashed var(--gold, #d4a747);
    outline-offset: 2px;
    transform: scale(1.03);
}
.thumb-item img { pointer-events: none; }
/* ── Styled confirm dialog ───────────────────────────────────────── */
.pwm-confirm {
    border: none;
    background: transparent;
    padding: 0;
    max-width: 480px;
    width: 92vw;
}
.pwm-confirm::backdrop {
    background: rgba(8, 17, 36, 0.72);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.pwm-confirm__box {
    background: #fff;
    border-radius: 14px;
    padding: 1.75rem 1.6rem 1.4rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
    text-align: center;
    animation: pwm-confirm-in 0.18s ease-out;
}
@keyframes pwm-confirm-in {
    from { transform: translateY(10px) scale(0.97); opacity: 0; }
    to   { transform: translateY(0)    scale(1);    opacity: 1; }
}
.pwm-confirm__icon {
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    margin: 0 auto 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    font-weight: 800;
    background: #e9efff;
    color: #1f3a8a;
}
.pwm-confirm--danger .pwm-confirm__icon {
    background: #fde2e2;
    color: #b91c1c;
}
.pwm-confirm__title {
    margin: 0 0 0.55rem;
    font-size: 1.25rem;
    color: #0c2f66;
    font-weight: 700;
}
.pwm-confirm__msg {
    margin: 0 0 1.3rem;
    color: #3a4a66;
    font-size: 0.97rem;
    line-height: 1.5;
    white-space: pre-line;
}
.pwm-confirm__actions {
    display: flex;
    gap: 0.7rem;
    justify-content: center;
    flex-wrap: wrap;
}
.pwm-confirm__btn {
    appearance: none;
    border: none;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
    min-width: 8.5rem;
}
.pwm-confirm__btn:hover { transform: translateY(-1px); }
.pwm-confirm__btn:focus-visible {
    outline: 3px solid rgba(212, 167, 71, 0.55);
    outline-offset: 2px;
}
.pwm-confirm__btn--cancel {
    background: #eef1f7;
    color: #1a2440;
}
.pwm-confirm__btn--cancel:hover { background: #e1e6f0; }
.pwm-confirm__btn--primary {
    background: #0c2f66;
    color: #fff;
}
.pwm-confirm__btn--primary:hover { background: #143b80; }
.pwm-confirm__btn--danger {
    background: #b91c1c;
    color: #fff;
    box-shadow: 0 2px 8px rgba(185, 28, 28, 0.35);
}
.pwm-confirm__btn--danger:hover { background: #991717; }