/* Form Validation Styles */

.form-control.is-invalid,
.form-check-input.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.1);
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #dc3545;
    font-weight: 500;
}

.form-control.is-invalid ~ .invalid-feedback,
.form-check-input.is-invalid ~ .invalid-feedback {
    display: block;
}

/* Toast Notification Styles */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.toast {
    animation: slideInRight 0.3s ease-in-out;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    padding: 12px 16px;
    display: flex !important;
    align-items: center;
}

.toast-hiding {
    animation: slideOutRight 0.3s ease-in-out forwards;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.toast-icon {
    font-size: 20px;
    font-weight: bold;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    word-break: break-word;
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
    line-height: 1;
}

.toast-close:hover {
    opacity: 1;
}

/* Toast Types */

.toast-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.toast-success .toast-icon {
    color: #28a745;
}

.toast-success .toast-close {
    color: #155724;
}

.toast-error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

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

.toast-error .toast-close {
    color: #721c24;
}

.toast-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

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

.toast-warning .toast-close {
    color: #856404;
}

.toast-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.toast-info .toast-icon {
    color: #17a2b8;
}

.toast-info .toast-close {
    color: #0c5460;
}

/* Animations */

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Responsive */

@media (max-width: 576px) {
    .toast-container {
        left: 12px;
        right: 12px;
        max-width: none;
    }

    .toast {
        padding: 10px 12px;
    }

    .toast-message {
        font-size: 13px;
    }
}

/* Loading Overlay */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9998;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-content {
    text-align: center;
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

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

.loading-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin-top: 1rem;
}
