/* ================================================================
   SANCTUARY ADMIN — UI Enhancement CSS
   Kolombarium Parantijati Ordo Karmel
   ================================================================ */

/* ── PAGE TRANSITION ─────────────────────────────────────────── */
body { opacity: 0; transition: opacity 0.25s ease; }
body.loaded { opacity: 1; }

/* ── NAVBAR ACTIVE LINK ──────────────────────────────────────── */
.navbar-premium .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,.1);
}
.navbar-premium .nav-link.active::after {
    transform: scaleX(1);
}

/* ── BREADCRUMB ──────────────────────────────────────────────── */
.breadcrumb {
    background: none;
    padding: 0;
    margin: 0 0 20px;
    font-size: .8rem;
}
.breadcrumb-item a { color: var(--c-gold); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item.active { color: var(--c-muted); }
.breadcrumb-item + .breadcrumb-item::before { color: #d1d5db; }

/* ── CARD HOVER LIFT ─────────────────────────────────────────── */
.card-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 36px rgba(60,0,0,.12) !important;
}

/* ── SKELETON LOADING ────────────────────────────────────────── */
@keyframes shimmer {
    0%   { background-position: -1000px 0; }
    100% { background-position:  1000px 0; }
}
.skeleton {
    background: linear-gradient(90deg, #f0eef8 25%, #e8e6f5 50%, #f0eef8 75%);
    background-size: 1000px 100%;
    animation: shimmer 1.6s infinite;
    border-radius: 8px;
}

/* ── TOAST NOTIFICATIONS ─────────────────────────────────────── */
#toast-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: 12px;
    padding: 14px 18px;
    min-width: 280px;
    max-width: 360px;
    box-shadow: 0 8px 32px rgba(0,0,0,.14);
    border-left: 4px solid #3c0000;
    animation: toastIn .3s cubic-bezier(.34,1.56,.64,1) forwards;
    font-size: .875rem;
    font-weight: 500;
}
.toast-item.success { border-color: #10b981; }
.toast-item.error   { border-color: #f43f5e; }
.toast-item.warning { border-color: #f59e0b; }
.toast-item .toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-item.success .toast-icon { color: #10b981; }
.toast-item.error   .toast-icon { color: #f43f5e; }
.toast-item.warning .toast-icon { color: #f59e0b; }
.toast-item .toast-close {
    margin-left: auto;
    cursor: pointer;
    opacity: .4;
    transition: opacity .15s;
    font-size: .85rem;
    flex-shrink: 0;
}
.toast-item .toast-close:hover { opacity: 1; }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px) scale(.9); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(40px) scale(.9); }
}

/* ── MODAL OVERLAY ───────────────────────────────────────────── */
.modal-content {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 24px 64px rgba(60,0,0,.18) !important;
    overflow: hidden;
}
.modal-header {
    background: #3c0000;
    color: #fff;
    border-bottom: none;
    padding: 18px 24px;
}
.modal-header .modal-title { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 1rem; }
.modal-header .btn-close { filter: brightness(0) invert(1); opacity: .8; }
.modal-body   { padding: 24px !important; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #f0eef8; }

/* ── CONFIRM DIALOG ──────────────────────────────────────────── */
#confirm-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .2s; pointer-events: none;
}
#confirm-overlay.show { opacity: 1; pointer-events: all; }
#confirm-box {
    background: #fff;
    border-radius: 16px;
    padding: 32px 28px;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 24px 64px rgba(0,0,0,.2);
    transform: scale(.9); transition: transform .25s cubic-bezier(.34,1.56,.64,1);
    text-align: center;
}
#confirm-overlay.show #confirm-box { transform: scale(1); }
#confirm-box .confirm-icon {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: #fff1f2;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: #f43f5e;
    margin: 0 auto 16px;
}
#confirm-box h5 { font-size: 1.05rem; margin-bottom: 8px; }
#confirm-box p  { color: #6b7280; font-size: .875rem; margin-bottom: 24px; }
#confirm-box .btn-confirm-yes {
    background: #f43f5e; color: #fff; border: none;
    border-radius: 8px; padding: 10px 22px; font-weight: 600;
    cursor: pointer; transition: background .2s;
}
#confirm-box .btn-confirm-yes:hover { background: #e11d48; }
#confirm-box .btn-confirm-no {
    background: #f3f4f6; color: #374151; border: none;
    border-radius: 8px; padding: 10px 22px; font-weight: 600;
    cursor: pointer; margin-right: 10px; transition: background .2s;
}
#confirm-box .btn-confirm-no:hover { background: #e5e7eb; }

/* ── SEARCH HIGHLIGHT ────────────────────────────────────────── */
.highlight { background: rgba(201,168,124,.4); border-radius: 3px; padding: 0 2px; }

/* ── BADGE PILL ──────────────────────────────────────────────── */
.badge-pill {
    border-radius: 99px;
    padding: 4px 12px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .3px;
}
.badge-terisi  { background: rgba(60,0,0,.1);   color: #3c0000; }
.badge-draft   { background: rgba(124,58,237,.1); color: #7c3aed; }
.badge-kosong  { background: rgba(16,185,129,.1); color: #059669; }
.badge-jatuh   { background: rgba(245,158,11,.1); color: #d97706; }

/* ── STATS RING ──────────────────────────────────────────────── */
.ring-chart {
    position: relative;
    width: 80px; height: 80px;
    flex-shrink: 0;
}
.ring-chart svg { transform: rotate(-90deg); }
.ring-chart .ring-label {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: .95rem;
    color: #3c0000;
}

/* ── TABLE IMPROVEMENTS ──────────────────────────────────────── */
.dataTables_wrapper .dataTables_filter input {
    border: 1.5px solid #e4e1ee;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: .85rem;
    transition: border-color .2s;
}
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #3c0000;
    outline: none;
    box-shadow: 0 0 0 3px rgba(60,0,0,.08);
}
.dataTables_wrapper .dataTables_length select {
    border: 1.5px solid #e4e1ee;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: .85rem;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px !important;
    font-size: .8rem !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #3c0000 !important;
    color: #fff !important;
    border-color: #3c0000 !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(60,0,0,.08) !important;
    color: #3c0000 !important;
    border-color: transparent !important;
}
.dataTables_info { font-size: .8rem; color: #9ca3af; }

/* ── LOADING SPINNER ─────────────────────────────────────────── */
#page-loader {
    position: fixed; inset: 0;
    background: #fff;
    z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    transition: opacity .35s ease;
}
#page-loader.hidden { opacity: 0; pointer-events: none; }
.loader-cross {
    width: 48px; height: 48px;
    position: relative;
    animation: rotateCross 2s linear infinite;
}
.loader-cross::before, .loader-cross::after {
    content: '';
    position: absolute;
    background: #3c0000;
    border-radius: 2px;
}
.loader-cross::before { width: 8px; height: 48px; left: 20px; top: 0; }
.loader-cross::after  { width: 48px; height: 8px; left: 0; top: 20px; }
@keyframes rotateCross {
    0%   { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(180deg) scale(.8); }
    100% { transform: rotate(360deg) scale(1); }
}

/* ── SMOOTH SCROLLING ────────────────────────────────────────── */
html { scroll-behavior: smooth; }

/* ── FOCUS RING ──────────────────────────────────────────────── */
*:focus-visible {
    outline: 2px solid rgba(60,0,0,.5);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── PRINT ───────────────────────────────────────────────────── */
@media print {
    .navbar-premium, footer, .btn, .dataTables_wrapper .dataTables_filter,
    .dataTables_paginate, .dataTables_length { display: none !important; }
    body { background: #fff !important; }
    .card { box-shadow: none !important; border: 1px solid #ccc !important; }
}

/* ── RESPONSIVE TWEAKS ───────────────────────────────────────── */
@media (max-width: 576px) {
    .page-header-row { flex-direction: column; align-items: flex-start; }
    .stat-card { flex-direction: column; text-align: center; padding: 18px; }
    .stat-icon { margin: 0 auto; }
    .stat-num { font-size: 1.5rem; }
}
