/* 商品管理系统自定义样式 */

/* 加载动画 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6B7280;
}

.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #E5E7EB;
    border-top: 2px solid #3B82F6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 表格样式优化 */
table {
    border-collapse: separate;
    border-spacing: 0;
}

/* 模态框动画 */
.modal-enter {
    animation: modalEnter 0.3s ease-out;
}

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

/* 按钮悬停效果 */
.btn-hover {
    transition: all 0.2s ease-in-out;
}

.btn-hover:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 卡片阴影效果 */
.card-shadow {
    transition: box-shadow 0.3s ease-in-out;
}

.card-shadow:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* 响应式表格 */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .table-responsive th,
    .table-responsive td {
        padding: 0.5rem;
    }
}

/* 搜索输入框样式 */
.search-input {
    transition: all 0.2s ease-in-out;
}

.search-input:focus {
    transform: scale(1.02);
}

/* 统计卡片样式 */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-card.green {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.stat-card.yellow {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.stat-card.red {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

/* 库存状态标签 */
.stock-badge {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

.stock-badge.high {
    background-color: #dcfce7;
    color: #166534;
}

.stock-badge.medium {
    background-color: #fef3c7;
    color: #92400e;
}

.stock-badge.low {
    background-color: #fee2e2;
    color: #991b1b;
}

/* 分页按钮样式 */
.pagination-btn {
    transition: all 0.2s ease-in-out;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #f3f4f6;
    transform: translateY(-1px);
}

.pagination-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.pagination-btn.active {
    background-color: #2563eb;
    color: white;
}

/* 表格行悬停效果 */
tbody tr {
    transition: background-color 0.2s ease-in-out;
}

tbody tr:hover {
    background-color: #f9fafb;
}

/* 操作按钮样式 */
.action-btn {
    transition: all 0.2s ease-in-out;
    padding: 0.375rem;
    border-radius: 0.375rem;
}

.action-btn:hover {
    background-color: #f3f4f6;
    transform: scale(1.1);
}

/* 表单样式优化 */
.form-input {
    transition: all 0.2s ease-in-out;
}

.form-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 消息提示样式 */
.message-slide {
    animation: slideInRight 0.3s ease-out;
}

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

/* 移动端优化 */
@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .grid-responsive {
        grid-template-columns: 1fr;
    }
    
    .text-responsive {
        font-size: 0.875rem;
    }
    
    .modal-responsive {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .bg-white {
        box-shadow: none !important;
    }
}