/* 通用样式文件 */
/* 侧边栏相关样式 */
.sidebar-visible {
    transform: translateX(0);
    visibility: visible;
}

.sidebar-hidden {
    transform: translateX(-100%);
    visibility: hidden;
}

.sidebar-overlay {
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-btn {
    @apply lg:hidden fixed top-4 left-4 z-50 bg-white p-2 rounded-md shadow-md text-gray-700;
}

/* 通用动画效果 */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in {
    animation: slideIn 0.3s ease-in-out;
}

@keyframes slideIn {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 按钮效果 */
.btn-effect {
    @apply transition-all duration-200 transform hover:scale-105 active:scale-95;
}

/* 卡片悬停效果 */
.card-hover {
    @apply transition-all duration-200 hover:shadow-md hover:-translate-y-1;
}

/* 复制通知样式 */
.copy-notify {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    background: #10b981;
    color: white;
    border-radius: 4px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.copy-notify.show {
    opacity: 1;
    transform: translateY(0);
}

/* 加载状态 */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式表格 */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 状态标签 */
.status-badge {
    @apply px-2 py-1 text-xs font-semibold rounded-full;
}

.status-unused {
    @apply bg-green-100 text-green-800;
}

.status-using {
    @apply bg-yellow-100 text-yellow-800;
}

.status-used {
    @apply bg-red-100 text-red-800;
}

.status-expired {
    @apply bg-gray-100 text-gray-800;
}

/* 表单样式增强 */
.form-control:focus {
    @apply ring-2 ring-blue-500 border-blue-500;
}

.form-control.error {
    @apply border-red-500 ring-2 ring-red-200;
}

/* 消息提示样式 */
.alert {
    @apply p-4 rounded-md mb-4;
}

.alert-success {
    @apply bg-green-100 text-green-800 border border-green-200;
}

.alert-warning {
    @apply bg-yellow-100 text-yellow-800 border border-yellow-200;
}

.alert-error {
    @apply bg-red-100 text-red-800 border border-red-200;
}

.alert-info {
    @apply bg-blue-100 text-blue-800 border border-blue-200;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* 响应式设计增强 */
@media (max-width: 640px) {
    .mobile-stack {
        @apply flex-col space-y-2 space-x-0;
    }
    
    .mobile-full {
        @apply w-full;
    }
    
    .mobile-hidden {
        @apply hidden;
    }
}

@media (min-width: 641px) {
    .desktop-inline {
        @apply inline-flex;
    }
    
    .desktop-hidden {
        @apply hidden;
    }
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-before: always;
    }
}
