/* =========================================================================
   Global App Alert & Loader Styles
   ========================================================================= */

/* --- Backdrop --- */
.app-alert-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199000;
}

.loader-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255, 0.8);
    z-index: 2147483000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-backdrop.hidden {
    display: none !important;
}

.loader-box {
    background: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.loader-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e2e8f0;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: loader-spin 1s linear infinite;
}

@keyframes loader-spin {
    to { transform: rotate(360deg); }
}

.loader-text {
    font-weight: 600;
    color: #1e293b;
    font-size: 1rem;
}

.mini-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(148, 163, 184, 0.55);
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: loader-spin 1s linear infinite;
    display: inline-block;
}

/* --- App Alert --- */
.app-alert {
    position: fixed;
    z-index: 200000;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    padding: 20px 24px;
    min-width: 300px;
    max-width: 450px;
    display: none;
    border-left: 5px solid #e2e8f0;
}

.app-alert.alert--success { border-left-color: #10b981; }
.app-alert.alert--error   { border-left-color: #ef4444; }
.app-alert.alert--info    { border-left-color: #3b82f6; }

.app-alert__close {
    position: absolute;
    top: 10px; right: 15px;
    background: none; border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

.app-alert__close:hover { color: #1e293b; }

.app-alert__content h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: #1e293b;
}

.app-alert__content span {
    font-size: 0.95rem;
    color: #475569;
}

/* Alert Positioning */
.kode-alert-top-right { top: 20px; right: 20px; }
.kode-alert-top-left  { top: 20px; left: 20px; }
.kode-alert-bottom-right { bottom: 20px; right: 20px; }
.kode-alert-bottom-left  { bottom: 20px; left: 20px; }
.kode-alert-top    { top: 20px; left: 50%; transform: translateX(-50%); }
.kode-alert-bottom { bottom: 20px; left: 50%; transform: translateX(-50%); }

/* Buttons inside Alert */
.app-alert__buttons {
    display: flex; gap: 10px; justify-content: flex-end;
}
.app-alert__buttons button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
}
.btn-ok { background: #4f46e5; color: white; }
.btn-cancel { background: #e2e8f0; color: #475569; }
