/**
 * UB Notify - Lightweight notification styles
 * Replaces bootstrap-notify CSS
 */

/* Container positioning */
.ub-notify-container {
    position: fixed;
    z-index: 10500;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
}

.ub-notify-container.ub-notify-top {
    top: 20px;
}

.ub-notify-container.ub-notify-bottom {
    bottom: 20px;
}

.ub-notify-container.ub-notify-left {
    left: 20px;
}

.ub-notify-container.ub-notify-right {
    right: 20px;
}

.ub-notify-container.ub-notify-center {
    left: 50%;
    transform: translateX(-50%);
}

/* Notification base styles */
.ub-notify {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(20px);
    min-width: 300px;
    max-width: 400px;
}

.ub-notify-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.ub-notify-icon {
    flex-shrink: 0;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ub-notify-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    word-wrap: break-word;
}

.ub-notify-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #666;
    opacity: 0.6;
    transition: opacity 0.2s;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ub-notify-close:hover {
    opacity: 1;
}

/* Progress bar */
.ub-notify-progress {
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
}

.ub-notify-progress-bar {
    height: 100%;
    width: 100%;
    transition: width 0.1s linear;
}

/* Type variations */
.ub-notify-success {
    border-left: 4px solid #28a745;
}

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

.ub-notify-success .ub-notify-progress-bar {
    background: #28a745;
}

.ub-notify-danger {
    border-left: 4px solid #dc3545;
}

.ub-notify-danger .ub-notify-icon {
    color: #dc3545;
}

.ub-notify-danger .ub-notify-progress-bar {
    background: #dc3545;
}

.ub-notify-warning {
    border-left: 4px solid #ffc107;
}

.ub-notify-warning .ub-notify-icon {
    color: #e0a800;
}

.ub-notify-warning .ub-notify-progress-bar {
    background: #ffc107;
}

.ub-notify-info {
    border-left: 4px solid #17a2b8;
}

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

.ub-notify-info .ub-notify-progress-bar {
    background: #17a2b8;
}

.ub-notify-dark {
    border-left: 4px solid #343a40;
}

.ub-notify-dark .ub-notify-icon {
    color: #343a40;
}

.ub-notify-dark .ub-notify-progress-bar {
    background: #343a40;
}

/* Animations */
.ub-notify-enter {
    animation: ubNotifySlideIn 0.3s ease forwards;
}

.ub-notify-exit {
    animation: ubNotifySlideOut 0.3s ease forwards;
}

@keyframes ubNotifySlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ubNotifySlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Top position animations */
.ub-notify-top .ub-notify-enter {
    animation: ubNotifySlideInTop 0.3s ease forwards;
}

.ub-notify-top .ub-notify-exit {
    animation: ubNotifySlideOutTop 0.3s ease forwards;
}

@keyframes ubNotifySlideInTop {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ubNotifySlideOutTop {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Error shake animation */
.ub-notify-danger.ub-notify-enter {
    animation: ubNotifySlideIn 0.3s ease forwards, ubNotifyShake 0.5s 0.3s ease;
}

@keyframes ubNotifyShake {
    10%, 90% {
        transform: translateX(-2px);
    }
    20%, 80% {
        transform: translateX(4px);
    }
    30%, 50%, 70% {
        transform: translateX(-6px);
    }
    40%, 60% {
        transform: translateX(6px);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .ub-notify-container {
        left: 10px;
        right: 10px;
        max-width: none;
    }
    
    .ub-notify-container.ub-notify-left,
    .ub-notify-container.ub-notify-right {
        left: 10px;
        right: 10px;
        transform: none;
    }
    
    .ub-notify {
        min-width: 0;
        max-width: none;
    }
}
