/**
 * WooCommerce Floating Notices - Stylesheet
 * Version: 1.0.0
 */

/* Hide default WooCommerce notices */
.woocommerce-error,
.woocommerce-info,
.woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-error,
.woocommerce-notices-wrapper .woocommerce-info,
.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce .woocommerce-error,
.woocommerce .woocommerce-info,
.woocommerce .woocommerce-message,
div.woocommerce-notices-wrapper,
.woocommerce-notices-wrapper > *,
ul.woocommerce-error,
.woocommerce-error li,
.woocommerce-message li,
.woocommerce-info li {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Floating Notice Container */
.floating-notices-container {
    position: fixed;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

/* Position variations */
.floating-notices-container.top-right {
    top: 20px;
    right: 20px;
}

.floating-notices-container.top-left {
    top: 20px;
    left: 20px;
}

.floating-notices-container.bottom-right {
    bottom: 20px;
    right: 20px;
}

.floating-notices-container.bottom-left {
    bottom: 20px;
    left: 20px;
}

.floating-notices-container.top-center {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

/* Individual Floating Notice */
.floating-notice {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 20px;
    padding-right: 36px; /* Make room for close button */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    pointer-events: all;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    min-width: 280px;
}

.floating-notice:hover {
    transform: translateX(-5px);
    box-shadow: 0 12px 45px rgba(0, 0, 0, 0.2);
}

/* Notice Types with Gradients */
.floating-notice.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.floating-notice.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.floating-notice.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.floating-notice.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

/* Icon Styles */
.floating-notice-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.floating-notice-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Content Styles */
.floating-notice-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}

.floating-notice-content a {
    color: white;
    text-decoration: underline;
    font-weight: 600;
    opacity: 0.95;
    transition: opacity 0.2s ease;
}

.floating-notice-content a:hover {
    opacity: 1;
    text-decoration: none;
}

.floating-notice-content ul,
.floating-notice-content li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.floating-notice-content li + li {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Close Button */
.floating-notice-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0 !Important;
    outline: none;
}

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

.floating-notice-close:active {
    transform: scale(0.95);
}

.floating-notice-close svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

/* Progress Bar */
.floating-notice-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 12px 12px;
}

.floating-notice.has-progress .floating-notice-progress {
    animation: progress var(--progress-duration, 5s) linear forwards;
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-120%);
        opacity: 0;
    }
}

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

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Animation Classes */
.floating-notice.animation-slide {
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.floating-notice.animation-slide.from-left {
    animation: slideInLeft 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.floating-notice.animation-fade {
    animation: fadeIn 0.3s ease;
}

.floating-notice.animation-bounce {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.floating-notice.animation-zoom {
    animation: zoomIn 0.3s ease;
}

/* Removing animations */
.floating-notice.removing {
    pointer-events: none;
}

.floating-notice.removing.animation-slide {
    animation: slideOutRight 0.3s ease forwards;
}

.floating-notice.removing.animation-slide.from-left {
    animation: slideOutLeft 0.3s ease forwards;
}

.floating-notice.removing.animation-fade,
.floating-notice.removing.animation-bounce,
.floating-notice.removing.animation-zoom {
    animation: fadeOut 0.3s ease forwards;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .floating-notices-container {
        max-width: calc(100vw - 20px);
    }
    
    .floating-notices-container.top-right,
    .floating-notices-container.top-left,
    .floating-notices-container.bottom-right,
    .floating-notices-container.bottom-left {
        right: 10px;
        left: 10px;
    }
    
    .floating-notices-container.mobile-top-full {
        top: 10px !important;
        right: 10px !important;
        left: 10px !important;
        bottom: auto !important;
        max-width: none;
        transform: none !important;
    }
    
    .floating-notices-container.mobile-bottom-full {
        bottom: 10px !important;
        right: 10px !important;
        left: 10px !important;
        top: auto !important;
        max-width: none;
        transform: none !important;
    }
    
    .floating-notice {
        min-width: unset;
        width: 100%;
        padding: 14px 16px;
    }
    
    .floating-notice-content {
        font-size: 13px;
    }
    
    .floating-notice-close {
        width: 28px;
        height: 28px;
    }
}

/* Tablet Responsive */
@media (min-width: 481px) and (max-width: 768px) {
    .floating-notices-container {
        max-width: 350px;
    }
    
    .floating-notices-container.top-right,
    .floating-notices-container.bottom-right {
        right: 15px;
    }
    
    .floating-notices-container.top-left,
    .floating-notices-container.bottom-left {
        left: 15px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .floating-notice {
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    }
    
    .floating-notice:hover {
        box-shadow: 0 12px 45px rgba(0, 0, 0, 0.5);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .floating-notice {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .floating-notice,
    .floating-notice-close {
        animation: none !important;
        transition: none !important;
    }
    
    .floating-notice-progress {
        display: none;
    }
}

/* Print styles */
@media print {
    .floating-notices-container {
        display: none !important;
    }
}
