/**
 * Custom Notification System Styles
 * Modals, Toasts, and Loading Overlays
 */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10002;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
}

/* Toast Item */
.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0;
    min-width: 200px;
    max-width: 320px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease-out;
    pointer-events: auto;
    overflow: hidden;
}

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

.toast.hide {
    opacity: 0;
    transform: translateX(400px);
}

.toast-content {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    gap: 10px;
}

.toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
    color: #424242;
    font-weight: 500;
    word-wrap: break-word;
}

.toast-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 12px;
    transition: color 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.toast-close:hover {
    color: #333;
}

/* Toast Types */
.toast-success {
    border-left: 4px solid #b71c1c;
    background: #ffebee;
}

.toast-success .toast-icon {
    color: #b71c1c;
}

.toast-success .toast-message {
    color: #424242;
}

.toast-error {
    border-left: 4px solid #e53935;
}

.toast-error .toast-icon {
    color: #e53935;
}

.toast-warning {
    border-left: 4px solid #ff6f00;
    background: #fff8e1;
}

.toast-warning .toast-icon {
    color: #ff6f00;
}

.toast-warning .toast-message {
    color: #5d4037;
}

.toast-info {
    border-left: 4px solid #757575;
    background: #fafafa;
}

.toast-info .toast-icon {
    color: #757575;
}

.toast-info .toast-message {
    color: #424242;
}

/* Toast Progress Bar */
.toast-progress {
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    background: currentColor;
    animation: toastProgress linear forwards;
}

.toast-success .toast-progress-bar {
    background: #b71c1c !important;
}

.toast-error .toast-progress-bar {
    background: #e53935 !important;
}

.toast-warning .toast-progress-bar {
    background: #ff6f00 !important;
}

.toast-info .toast-progress-bar {
    background: #757575 !important;
}

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

/* Modal Overlay */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.65) !important;
    backdrop-filter: blur(5px);
    z-index: 99999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
    margin: 0 !important;
    padding: 0 !important;
}

.modal-overlay.show {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Custom Modal */
.custom-modal {
    background: white !important;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease-out;
    display: flex !important;
    flex-direction: column;
    position: relative !important;
    margin: 0 !important;
    border: 2px solid #b71c1c;
}

.modal-overlay.show .custom-modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #b71c1c 0%, #d32f2f 100%);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    border: none;
}

.modal-icon {
    font-size: 32px;
    flex-shrink: 0;
    color: white;
}

.modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: white;
    flex: 1;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 18px;
    color: white;
    cursor: pointer;
    padding: 6px 10px;
    transition: all 0.2s;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.modal-body {
    padding: 28px 24px;
    color: #424242;
    line-height: 1.7;
    overflow-y: auto;
    flex: 1;
    font-size: 15px;
}

.modal-message {
    margin: 0;
    font-size: 15px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f5f5f5;
}

.modal-footer .btn {
    min-width: 100px;
    padding: 10px 24px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.2s;
    border: none;
}

.modal-footer .btn-secondary {
    background: #757575;
    border-color: #757575;
    color: white;
}

.modal-footer .btn-secondary:hover {
    background: #616161;
    border-color: #616161;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, #b71c1c 0%, #d32f2f 100%);
    border-color: #b71c1c;
    color: white;
}

.modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #a31818 0%, #c62828 100%);
    border-color: #a31818;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(183, 28, 28, 0.4);
}

.modal-footer .btn-success {
    background: #43a047;
    border-color: #43a047;
}

.modal-footer .btn-success:hover {
    background: #388e3c;
    border-color: #388e3c;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(67, 160, 71, 0.3);
}

.modal-footer .btn-danger {
    background: #e53935;
    border-color: #e53935;
}

.modal-footer .btn-danger:hover {
    background: #d32f2f;
    border-color: #c62828;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(229, 57, 53, 0.3);
}

.modal-confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading Overlay */
.loading-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.loading-spinner {
    text-align: center;
    color: white;
}

.loading-spinner .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

.loading-spinner p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }

    .custom-modal {
        width: 95%;
        max-width: none;
        margin: 20px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* Animation for modal content */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-modal {
    animation: modalFadeIn 0.3s ease-out;
}

/* Modal Icon Color Classes - Red/Gray Theme */
.custom-modal .modal-icon .text-info {
    color: white !important;
}

.custom-modal .modal-icon .text-warning {
    color: #fff59d !important;
}

.custom-modal .modal-icon .text-danger {
    color: white !important;
}

.custom-modal .modal-icon .text-success {
    color: white !important;
}

/* Override Bootstrap button colors in modals */
.custom-modal .modal-footer .btn-success {
    background: linear-gradient(135deg, #b71c1c 0%, #d32f2f 100%) !important;
    border-color: #b71c1c !important;
    color: white !important;
}

.custom-modal .modal-footer .btn-success:hover {
    background: linear-gradient(135deg, #a31818 0%, #c62828 100%) !important;
    border-color: #a31818 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(183, 28, 28, 0.4) !important;
}

.custom-modal .modal-footer .btn-primary {
    background: linear-gradient(135deg, #b71c1c 0%, #d32f2f 100%) !important;
    border-color: #b71c1c !important;
    color: white !important;
}

.custom-modal .modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #a31818 0%, #c62828 100%) !important;
    border-color: #a31818 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(183, 28, 28, 0.4) !important;
}

