/* ============================================================
   Toast Notifications System
   Floating notifications with dynamic positions and animations
   ============================================================ */

.apm-toast-container {
    position: fixed;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 400px;
}

/* Default position: top-left */
.apm-toast-container {
    top: 28px;
    left: 8px;
}

/* Position: top-left */
.apm-toast-container--top-left {
    top: 28px;
    left: 8px;
}

/* Position: top-center */
.apm-toast-container--top-center {
    top: 28px;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* Position: top-right */
.apm-toast-container--top-right {
    top: 28px;
    right: 8px;
    left: auto;
}

/* Position: bottom-left */
.apm-toast-container--bottom-left {
    bottom: 28px;
    left: 8px;
    top: auto;
}

/* Position: bottom-center */
.apm-toast-container--bottom-center {
    bottom: 28px;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    top: auto;
}

/* Position: bottom-right */
.apm-toast-container--bottom-right {
    bottom: 28px;
    right: 8px;
    left: auto;
    top: auto;
}

/* Position: center */
.apm-toast-container--center {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 400px;
    margin: auto;
    align-items: center;
    justify-content: center;
}

/* Position: top-full */
.apm-toast-container--top-full {
    top: 28px;
    left: 0;
    right: 0;
    max-width: 100%;
    align-items: center;
}

/* Position: bottom-full */
.apm-toast-container--bottom-full {
    bottom: 28px;
    left: 0;
    right: 0;
    max-width: 100%;
    align-items: center;
    top: auto;
}

@media (max-width: 768px) {
    .apm-toast-container {
        left: 10px;
        right: 10px;
        max-width: 100%;
    }
}

.apm-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 500;
    pointer-events: auto;
    background: white;
    border-left: 4px solid;
    animation: apm-toast-slide-in-right 0.3s ease-out;
}

/* Animation: slide-in-right */
.apm-toast.apm-animation-slide-in-right {
    animation: apm-toast-slide-in-right 0.3s ease-out;
}

/* Animation: slide-in-left */
.apm-toast.apm-animation-slide-in-left {
    animation: apm-toast-slide-in-left 0.3s ease-out;
}

/* Animation: slide-in-top */
.apm-toast.apm-animation-slide-in-top {
    animation: apm-toast-slide-in-top 0.3s ease-out;
}

/* Animation: slide-in-bottom */
.apm-toast.apm-animation-slide-in-bottom {
    animation: apm-toast-slide-in-bottom 0.3s ease-out;
}

/* Animation: fade-in */
.apm-toast.apm-animation-fade-in {
    animation: apm-toast-fade-in 0.4s ease-out;
}

/* Animation: bounce-in */
.apm-toast.apm-animation-bounce-in {
    animation: apm-toast-bounce-in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Animation: zoom-in */
.apm-toast.apm-animation-zoom-in {
    animation: apm-toast-zoom-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Animation: flip-in */
.apm-toast.apm-animation-flip-in {
    animation: apm-toast-flip-in 0.5s ease-out;
}

/* Animation: scale-in */
.apm-toast.apm-animation-scale-in {
    animation: apm-toast-scale-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Animation: blur-in */
.apm-toast.apm-animation-blur-in {
    animation: apm-toast-blur-in 0.5s ease-out;
}

/* Animation: glass-pop */
.apm-toast.apm-animation-glass-pop {
    animation: apm-toast-glass-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.apm-toast.apm-toast-hide {
    animation: apm-toast-slide-out 0.3s ease-in forwards;
}

/* Toast Types */
.apm-toast.apm-toast-success {
    border-left-color: #27ae60;
    background: #f0f9f5;
    color: #27ae60;
}

.apm-toast.apm-toast-success .apm-toast-icon {
    color: #27ae60;
}

.apm-toast.apm-toast-error {
    border-left-color: #e74c3c;
    background: #fadbd8;
    color: #c0392b;
}

.apm-toast.apm-toast-error .apm-toast-icon {
    color: #e74c3c;
}

.apm-toast.apm-toast-warning {
    border-left-color: #f39c12;
    background: #fef5e7;
    color: #d68910;
}

.apm-toast.apm-toast-warning .apm-toast-icon {
    color: #f39c12;
}

.apm-toast.apm-toast-info {
    border-left-color: #3498db;
    background: #ebf5fb;
    color: #2980b9;
}

.apm-toast.apm-toast-info .apm-toast-icon {
    color: #3498db;
}

/* Toast Icon */
.apm-toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* Toast Message */
.apm-toast-message {
    flex: 1;
    line-height: 1.4;
}

/* Toast Close Button */
.apm-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    color: inherit;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

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

/* Animations */

/* Slide animations */
@keyframes apm-toast-slide-in-right {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes apm-toast-slide-in-left {
    from {
        transform: translateX(-400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes apm-toast-slide-in-top {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes apm-toast-slide-in-bottom {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Fade animation */
@keyframes apm-toast-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Bounce animation */
@keyframes apm-toast-bounce-in {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    70% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Zoom animation */
@keyframes apm-toast-zoom-in {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Flip animation */
@keyframes apm-toast-flip-in {
    from {
        transform: rotateY(90deg);
        opacity: 0;
    }
    to {
        transform: rotateY(0deg);
        opacity: 1;
    }
}

/* Scale animation */
@keyframes apm-toast-scale-in {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Blur animation */
@keyframes apm-toast-blur-in {
    from {
        filter: blur(10px);
        opacity: 0;
    }
    to {
        filter: blur(0);
        opacity: 1;
    }
}

/* Glass Pop animation */
@keyframes apm-toast-glass-pop {
    0% {
        transform: scale(0.5) translateY(-20px);
        opacity: 0;
        backdrop-filter: blur(0);
    }
    50% {
        backdrop-filter: blur(10px);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
        backdrop-filter: blur(0);
    }
}

@keyframes apm-toast-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .apm-toast-container--top-center,
    .apm-toast-container--bottom-center,
    .apm-toast-container--center {
        max-width: 95%;
    }

    @keyframes apm-toast-slide-in-right {
        from {
            transform: translateX(100%);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    @keyframes apm-toast-slide-in-left {
        from {
            transform: translateX(-100%);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    @keyframes apm-toast-slide-out {
        from {
            transform: translateX(0);
            opacity: 1;
        }
        to {
            transform: translateX(100%);
            opacity: 0;
        }
    }
}
