/* =========================================================================
   MODALS, POPUPS, NOTIFICATIONS & WIDGETS
   ========================================================================= */

/* --- POPUP MODAL --- */
#popup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(3, 5, 15, 0.95);
    z-index: 10000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#popup.show {
    opacity: 1;
}

.popup-card {
    position: relative;
    background: linear-gradient(150deg, rgba(16, 26, 50, 0.96), rgba(6, 10, 22, 0.98));
    border: 1.5px solid rgba(0, 210, 255, 0.45);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(0, 210, 255, 0.25);
    border-radius: 24px;
    padding: 30px 22px 24px 22px;
    width: 88%;
    max-width: 330px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.popup-close-btn {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    font-size: 15px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    z-index: 20;
    transition: background 0.2s;
}

.popup-close-btn:active {
    background: rgba(255, 255, 255, 0.25);
}

#popup img {
    width: 130px;
    height: 130px;
    object-fit: contain;
    margin-bottom: 12px;
    filter: drop-shadow(0 0 22px #00d2ff);
}

#popup h2 {
    color: #fff;
    font-size: 22px;
    margin: 0 0 10px 0;
    text-shadow: 0 0 15px #00d2ff;
}

#popup p {
    color: #aaa;
    max-width: 95%;
    margin: 0 0 15px 0;
    font-size: 13px;
    line-height: 1.4;
}

#popup-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    align-items: center;
}

/* --- AUTO DISMISS TOAST NOTIFICATION --- */
@keyframes autoToastSlideInOut {
    0% { opacity: 0; transform: translate(-50%, -20px) scale(0.85); }
    15% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    80% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -20px) scale(0.85); }
}

.auto-dismiss-toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    border-radius: 16px;
    padding: 10px 22px;
    color: #fff;
    font-weight: 900;
    font-size: 13px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85);
    pointer-events: none;
    animation: autoToastSlideInOut 2.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    backdrop-filter: blur(10px);
}

.auto-dismiss-toast.toast-success,
.auto-dismiss-toast:not(.toast-error):not(.toast-info) {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.98));
    border: 1.5px solid #6ee7b7;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 25px rgba(16, 185, 129, 0.6);
}

.auto-dismiss-toast.toast-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(153, 27, 27, 0.98));
    border: 1.5px solid #fca5a5;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 20px rgba(239, 68, 68, 0.6);
}

.auto-dismiss-toast.toast-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(29, 78, 216, 0.98));
    border: 1.5px solid #93c5fd;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 20px rgba(59, 130, 246, 0.6);
}

/* --- STAR BALANCE WIDGET --- */
#starBalanceWidget {
    position: relative;
    background: rgba(15, 23, 42, 0.9);
    border: 1.5px solid #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
    border-radius: 20px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(8px);
}
