/* ============================================================
   APP ALERT  —  unified mobile-app style notifications
   Used across the whole user panel for success / error / info.
   Loaded from includes/footer.php
   ============================================================ */

.appa-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2147483000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px 0;
    pointer-events: none;
}

.appa {
    pointer-events: auto;
    width: 100%;
    max-width: 420px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 12px 13px 14px;
    border-radius: 16px;
    background: #0e121d;
    color: #cecbee;
    box-shadow:
        0 12px 30px -6px rgba(0, 0, 0, 0.60),
        0 4px 10px -2px rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(130, 160, 255, 0.12);
    position: relative;
    overflow: hidden;
    transform: translateY(-140%);
    opacity: 0;
    transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    will-change: transform, opacity;
}

.appa.show {
    transform: translateY(0);
    opacity: 1;
}

.appa.hide {
    transform: translateY(-140%);
    opacity: 0;
}

/* accent strip */
.appa::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--appa-c, #1f6bff);
}

.appa-ico {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #fff;
    background: var(--appa-c, #1f6bff);
    box-shadow: 0 4px 10px -2px var(--appa-c, #1f6bff);
}

.appa-body {
    flex: 1;
    min-width: 0;
    padding-top: 1px;
}

.appa-title {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0.01em;
    margin-bottom: 2px;
    color: #cecbee;
}

.appa-msg {
    font-size: 12.5px;
    line-height: 1.45;
    color: #bac6c2;
    word-break: break-word;
}

.appa-x {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(18, 14, 44, 0.06);
    color: #6b7a74;
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-top: 1px;
    transition: background 0.15s;
}

.appa-x:active {
    background: rgba(18, 14, 44, 0.14);
}

/* auto-dismiss progress */
.appa-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: var(--appa-c, #1f6bff);
    opacity: 0.35;
    transform-origin: left center;
    animation: appaBar linear forwards;
}

@keyframes appaBar {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* ---- type colors ---- */
.appa[data-type="success"] { --appa-c: #1f6bff; }
.appa[data-type="error"]   { --appa-c: #ef4444; }
.appa[data-type="warning"] { --appa-c: #f59e0b; }
.appa[data-type="info"]    { --appa-c: #3b82f6; }

/* ---- dark mode ---- */
@media (prefers-color-scheme: dark) {
    .appa {
        background: #17142f;
        color: #eef4ff;
        border-color: rgba(255, 255, 255, 0.07);
        box-shadow: 0 14px 34px -6px rgba(0, 0, 0, 0.60);
    }
    .appa-title { color: #f7f6ff; }
    .appa-msg { color: #9fb4ac; }
    .appa-x { background: rgba(255, 255, 255, 0.08); color: #9fb4ac; }
}

@media (min-width: 600px) {
    .appa-wrap { padding-top: calc(env(safe-area-inset-top, 0px) + 18px); }
}

@media (prefers-reduced-motion: reduce) {
    .appa { transition: opacity 0.2s ease; transform: none; }
    .appa.show { transform: none; }
    .appa.hide { transform: none; }
    .appa-bar { animation: none; display: none; }
}
