/* ═══════════════════════════════════════════════════════
   MODAL STYLES
   ═══════════════════════════════════════════════════════ */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(61, 53, 32, 0.4);
    /* Matches text color slightly */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Modal Content */
.modal {
    background: var(--surface-card);
    border-radius: 24px;
    /* Using explicit px for consistency or var(--radius-lg) */
    padding: 40px 32px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    text-align: center;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

/* Modal Decorative Background */
.modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--gradient-primary);
}

.modal-icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
    display: inline-block;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
    line-height: 1.2;
}

.modal-desc {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 16px 24px;
    border-radius: var(--radius-full);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 1rem;
    border: none;
    letter-spacing: 0.01em;
    line-height: 1;
}


.modal-btn--primary {
    background: linear-gradient(135deg, var(--primary) 0%, #f97316 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(237, 99, 40, 0.35);
}

.modal-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(237, 99, 40, 0.4);
}

.modal-btn--primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(237, 99, 40, 0.3);
}

.modal-btn--secondary {
    background: var(--surface-2, #f5f0eb);
    color: var(--text-secondary);
    border: 2px solid rgba(0, 0, 0, 0.08);
}

.modal-btn--secondary:hover {
    background: var(--blue-gray, #ede8e3);
    color: var(--text);
    border-color: rgba(0, 0, 0, 0.14);
}

.modal-btn--secondary:active {
    transform: scale(0.98);
}


/* ═══════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   Replaces native alert() – shown bottom-right
   ═══════════════════════════════════════════════════════ */
#toast-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 16px;
    background: var(--surface-card, #fff);
    border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    min-width: 260px;
    max-width: 360px;
    pointer-events: auto;
    transform: translateX(110%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.35s ease;
    position: relative;
    overflow: hidden;
}

.toast--visible {
    transform: translateX(0);
    opacity: 1;
}

.toast--hide {
    transform: translateX(110%);
    opacity: 0;
}

/* Top accent bar */
.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--toast-accent, var(--gradient-primary));
    border-radius: 16px 16px 0 0;
}

.toast__icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 1px;
}

.toast__body {
    flex: 1;
    min-width: 0;
}

.toast__title {
    font-family: var(--font-display, sans-serif);
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text, #3D3520);
    line-height: 1.3;
    margin-bottom: 2px;
}

.toast__message {
    font-size: 0.82rem;
    color: var(--text-secondary, #7A7060);
    line-height: 1.4;
}

.toast__close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted, #A8A090);
    font-size: 1rem;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s;
    margin-top: 1px;
}

.toast__close:hover {
    color: var(--text, #3D3520);
}

/* ─── Variants ─── */
.toast--success {
    --toast-accent: linear-gradient(90deg, #22c55e, #4ade80);
}

.toast--error {
    --toast-accent: linear-gradient(90deg, #ef4444, #f87171);
}

.toast--info {
    --toast-accent: var(--gradient-primary);
}

.toast--warning {
    --toast-accent: linear-gradient(90deg, #f59e0b, #fbbf24);
}