/* notifications.css - 弹窗和系统消息样式 */

/* 通知容器 */
#notification-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 通知基础样式 */
.notification-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    max-width: 320px;
    z-index: 50;
    pointer-events: auto;
    transform: translateY(-20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 移动端通知位置调整 */
@media (max-width: 640px) {
    .notification-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        width: calc(100% - 20px);
    }
}

/* 不同类型通知的颜色 */
.notification-toast.bg-green-500 {
    background-color: #10b981;
    color: white;
}

.notification-toast.bg-amber-500 {
    background-color: #f59e0b;
    color: white;
}

.notification-toast.bg-blue-500 {
    background-color: #3b82f6;
    color: white;
}

.notification-toast.bg-purple-500 {
    background-color: #8b5cf6;
    color: white;
}

/* 确认对话框样式 */
.confirm-dialog {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-dialog .bg-white {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 28rem;
    margin: 0 1rem;
    overflow: hidden;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.confirm-dialog .bg-white.scale-100 {
    transform: scale(1);
}

.confirm-dialog .bg-white.opacity-100 {
    opacity: 1;
}

/* 移动端对话框调整 */
@media (max-width: 640px) {
    .confirm-dialog .bg-white {
        max-width: 90%;
        margin: 0 0.5rem;
    }
}

/* 侧边栏滑入动画（用于账户页面等） */
.sidebar-slide-in {
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* 加入购物车按钮动画 */
.add-to-cart-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.add-to-cart-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.add-to-cart-btn:active {
    transform: translateY(0);
}

/* 表单提交按钮动画 */
button[type="submit"]:active {
    transform: scale(0.98);
}

/* 工具提示样式 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #374151;
    color: white;
    text-align: center;
    border-radius: 0.375rem;
    padding: 8px 12px;
    position: absolute;
    z-index: 10;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.875rem;
}

.tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #374151 transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 淡入动画 */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 旋转加载动画 */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* 脉动动画 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 缩放动画 */
@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.scale-in {
    animation: scaleIn 0.3s ease forwards;
}

/* 平滑过渡 */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
}

/* 输入框焦点动画 */
.input-field:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
    border-color: #10b981;
}

/* 按钮禁用样式 */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}
