/* ============================================
   Custom Popups - Replace alert()
   ============================================ */

/* Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: popupFadeIn 0.25s ease;
}

@keyframes popupFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal */
.popup-modal {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 90%;
    max-width: 420px;
    text-align: center;
    animation: popupSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}

@keyframes popupSlideIn {
    from { opacity: 0; transform: scale(0.85) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Icon */
.popup-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 20px;
}

.popup-icon.success {
    background: #d1fae5;
    color: #059669;
}

.popup-icon.error {
    background: #fee2e2;
    color: #dc2626;
}

.popup-icon.warning {
    background: #fef3c7;
    color: #d97706;
}

.popup-icon.info {
    background: #dbeafe;
    color: #2563eb;
}

.popup-icon.confirm {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* Text */
.popup-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.popup-message {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Buttons */
.popup-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.popup-btn {
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.popup-btn:hover { transform: translateY(-1px); }

.popup-btn-primary {
    background: var(--black);
    color: var(--white);
}

.popup-btn-primary:hover {
    background: var(--gray-800);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.popup-btn-secondary {
    background: var(--gray-100);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.popup-btn-secondary:hover {
    background: var(--gray-200);
}

.popup-btn-danger {
    background: #dc2626;
    color: white;
}

.popup-btn-danger:hover {
    background: #b91c1c;
}

/* Auto close timer */
.popup-timer {
    width: 100%;
    height: 3px;
    background: var(--gray-200);
    border-radius: 100px;
    margin-top: 20px;
    overflow: hidden;
}

.popup-timer-bar {
    height: 100%;
    background: var(--black);
    border-radius: 100px;
    animation: timerShrink linear forwards;
}

@keyframes timerShrink {
    from { width: 100%; }
    to { width: 0%; }
}
