/**
 * Alert Styles
 * 
 * This file contains all alert and notification styles for CranioCatch application.
 * Use these styles for consistent alert appearances across the application.
 */

/* Base Alert Styles */
.alert {
    padding: 16px 20px;
    margin-bottom: 16px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    line-height: 1.5;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    pointer-events: auto;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Alert Types */
.alert-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fed7aa;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.alert-info {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

/* Error Notification */
.error-notification {
    position: relative;
    margin-bottom: 24px;
    overflow: hidden;
}

.error-notification-content {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1);
    overflow: hidden;
}

.error-icon-container {
    background: #ef4444;
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-icon {
    font-size: 20px;
}



.error-title {
    font-weight: 600;
    color: #ef4444;
    margin: 0 0 4px 0;
    font-size: 16px;
}

.error-text {
    color: #4b5563;
    margin: 0;
    font-size: 14px;
}

/* Form validation */
.form-control.error {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.1);
}

/* Success Message */
.success-message {
    background: #f0f9ff;
    color: #059669;
    border-left: 4px solid #10b981;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

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

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

/* Shake animation for form errors */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideInRight 0.3s ease-out;
    margin-bottom: 10px;
}

.toast-success {
    background-color: #10b981;
}

.toast-warning {
    background-color: #f59e0b;
}

.toast-danger {
    background-color: #ef4444;
}

.toast-info {
    background-color: #3b82f6;
}

/* Notification Container */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    pointer-events: none;
}

/* Alert Show Animation */
.alert.show {
    transform: translateX(0);
    opacity: 1;
}

/* Alert Hide Animation */
.alert.hiding {
    transform: translateX(100%);
    opacity: 0;
}

/* Alert Icon */
.alert i {
    flex-shrink: 0;
    font-size: 18px;
}

/* Alert Text */
.alert span {
    flex-grow: 1;
}

/* Alert Close Button */
.alert-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    margin-left: 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.alert-close:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.alert-close i {
    font-size: 14px;
}

/* Field Error Styles */
.field-error {
    margin-top: 8px;
    margin-bottom: 16px;
    transform: none;
    opacity: 1;
    position: static;
    animation: slideDown 0.3s ease;
}

/* Slide Down Animation */
@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        max-height: 100px;
        opacity: 1;
        transform: translateY(0);
    }
}

/* Static Alert Styles (for page content) */
.alert-static {
    transform: none;
    opacity: 1;
    margin-bottom: 24px;
    box-shadow: none;
}

/* Button Error State */
.btn-error {
    background: #dc2626 !important;
    color: white !important;
    border-color: #dc2626 !important;
    transition: all 0.3s ease;
}

.btn-error:hover {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
}

@keyframes errorButtonPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
}

.btn-error {
    animation: errorButtonPulse 1.5s infinite;
}

/* Button Success State */
.btn-success {
    background: #16a34a !important;
    color: white !important;
    border-color: #16a34a !important;
    transition: all 0.3s ease;
}

.btn-success:hover {
    background: #15803d !important;
    border-color: #15803d !important;
}

/* Success Icon Animation */
@keyframes checkmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.btn-success .fa-check {
    animation: checkmark 0.5s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .alert {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .field-error {
        padding: 10px 14px;
        font-size: 13px;
    }
}
