/* Custom Notifications and Modal Dialogs Styles */

#custom-toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: calc(100vw - 2.5rem);
    max-width: 26rem;
    pointer-events: none;
}

@media (max-width: 640px) {
    #custom-toast-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        width: auto;
        max-width: none;
    }
}

.custom-toast {
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem 1.125rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.9);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.custom-toast.toast-hiding {
    animation: toastSlideOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-12px) scale(0.96);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastSlideOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
        max-height: 120px;
        margin-bottom: 0.75rem;
    }
    100% {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

.custom-toast-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    margin-top: -0.1rem;
}

.custom-toast-content {
    flex: 1;
    min-width: 0;
}

.custom-toast-title {
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.25rem;
    margin-bottom: 0.15rem;
}

.custom-toast-message {
    font-size: 0.825rem;
    color: #475569;
    line-height: 1.35;
    word-break: break-word;
}

.custom-toast-close {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #94a3b8;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    margin-top: -0.25rem;
    margin-right: -0.25rem;
}

.custom-toast-close:hover {
    color: #1e293b;
    background: #f1f5f9;
}

.custom-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    animation: toastProgress linear forwards;
}

.custom-toast:hover .custom-toast-progress {
    animation-play-state: paused;
}

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

/* Toast Color Themes */
.custom-toast.toast-success {
    border-left: 4px solid #10b981;
}
.custom-toast.toast-success .custom-toast-icon {
    background: #ecfdf5;
    color: #059669;
}
.custom-toast.toast-success .custom-toast-title {
    color: #065f46;
}
.custom-toast.toast-success .custom-toast-progress {
    background: #10b981;
}

.custom-toast.toast-error {
    border-left: 4px solid #ef4444;
}
.custom-toast.toast-error .custom-toast-icon {
    background: #fef2f2;
    color: #dc2626;
}
.custom-toast.toast-error .custom-toast-title {
    color: #991b1b;
}
.custom-toast.toast-error .custom-toast-progress {
    background: #ef4444;
}

.custom-toast.toast-warning {
    border-left: 4px solid #f59e0b;
}
.custom-toast.toast-warning .custom-toast-icon {
    background: #fffbeb;
    color: #d97706;
}
.custom-toast.toast-warning .custom-toast-title {
    color: #92400e;
}
.custom-toast.toast-warning .custom-toast-progress {
    background: #f59e0b;
}

.custom-toast.toast-info {
    border-left: 4px solid #0ea5e9;
}
.custom-toast.toast-info .custom-toast-icon {
    background: #f0f9ff;
    color: #0284c7;
}
.custom-toast.toast-info .custom-toast-title {
    color: #0369a1;
}
.custom-toast.toast-info .custom-toast-progress {
    background: #0ea5e9;
}

/* --- Custom Confirmation Modal --- */
#custom-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-out;
}

#custom-modal-backdrop.modal-open {
    opacity: 1;
    pointer-events: auto;
}

#custom-modal-card {
    position: relative;
    width: 100%;
    max-width: 28rem;
    background: #ffffff;
    border-radius: 1.25rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(226, 232, 240, 0.9);
    padding: 1.75rem;
    text-align: center;
    transform: scale(0.92) translateY(8px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#custom-modal-backdrop.modal-open #custom-modal-card {
    transform: scale(1) translateY(0);
}

.modal-icon-badge {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.25rem;
    border-radius: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.modal-icon-badge.badge-danger {
    background: #fee2e2;
    color: #ef4444;
}

.modal-icon-badge.badge-warning {
    background: #fef3c7;
    color: #f59e0b;
}

.modal-icon-badge.badge-success {
    background: #d1fae5;
    color: #10b981;
}

.modal-icon-badge.badge-info {
    background: #e0f2fe;
    color: #0284c7;
}

.modal-title-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.modal-body-text {
    font-size: 0.925rem;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 1.75rem;
}

.modal-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.modal-btn {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.modal-btn-cancel {
    background: #ffffff;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.modal-btn-cancel:hover {
    background: #f8fafc;
    color: #0f172a;
}

.modal-btn-confirm {
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.modal-btn-confirm.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}
.modal-btn-confirm.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 6px 12px -2px rgba(239, 68, 68, 0.35);
}

.modal-btn-confirm.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
}
.modal-btn-confirm.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 6px 12px -2px rgba(16, 185, 129, 0.35);
}

.modal-btn-confirm.btn-primary {
    background: linear-gradient(135deg, #0d9488, #0f766e);
}
.modal-btn-confirm.btn-primary:hover {
    background: linear-gradient(135deg, #0f766e, #115e59);
    box-shadow: 0 6px 12px -2px rgba(13, 148, 136, 0.35);
}
