/* Nano Banana Pro - 自定义样式 */

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4b5563;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}

.animate-slideIn {
    animation: slideIn 0.3s ease-out;
}

/* 图片预览网格 */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.image-card {
    aspect-ratio: 1;
    border-radius: 0.75rem;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.image-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-card .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.image-card:hover .overlay {
    opacity: 1;
}

/* 加载骨架屏 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.dark .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 状态标签 */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.dark .status-pending {
    background-color: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.status-processing {
    background-color: #dbeafe;
    color: #1e40af;
}

.dark .status-processing {
    background-color: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.status-completed {
    background-color: #d1fae5;
    color: #065f46;
}

.dark .status-completed {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.status-failed {
    background-color: #fee2e2;
    color: #991b1b;
}

.dark .status-failed {
    background-color: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* 聊天界面样式 */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 400px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    space-y: 1rem;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-bubble {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
}

.chat-message.user .chat-bubble {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.chat-message.assistant .chat-bubble {
    background-color: #f3f4f6;
    color: #1f2937;
    border-bottom-left-radius: 0.25rem;
}

.dark .chat-message.assistant .chat-bubble {
    background-color: #374151;
    color: #f3f4f6;
}

.chat-image {
    max-width: 300px;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
}

.chat-input-container {
    border-top: 1px solid #e5e7eb;
    padding: 1rem;
}

.dark .chat-input-container {
    border-top-color: #374151;
}

/* 表单样式 */
.form-input {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
    outline: none;
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.1);
}

.dark .form-input {
    background-color: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

.dark .form-input:focus {
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
}

.btn-primary {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.dark .btn-secondary {
    background-color: #4b5563;
    color: #f3f4f6;
}

.dark .btn-secondary:hover {
    background-color: #6b7280;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 100;
}

.modal-content {
    background-color: white;
    border-radius: 1rem;
    max-width: 32rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.dark .modal-content {
    background-color: #1f2937;
}

/* 拖拽上传区域 */
.dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: #fbbf24;
    background-color: rgba(251, 191, 36, 0.05);
}

.dark .dropzone {
    border-color: #4b5563;
}

.dark .dropzone:hover,
.dark .dropzone.dragover {
    border-color: #fbbf24;
    background-color: rgba(251, 191, 36, 0.1);
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
}

.dark .table-container {
    border-color: #374151;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background-color: #f9fafb;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}

.dark .table th {
    background-color: #374151;
    color: #9ca3af;
    border-bottom-color: #4b5563;
}

.table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.dark .table td {
    color: #d1d5db;
    border-bottom-color: #374151;
}

.table tbody tr:hover {
    background-color: #f9fafb;
}

.dark .table tbody tr:hover {
    background-color: #374151;
}

/* 分页 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.15s;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #f3f4f6;
}

.dark .pagination-btn:hover:not(:disabled) {
    background-color: #374151;
}

.pagination-btn.active {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 自定义下拉选择器 */
.custom-select {
    position: relative;
}

.custom-select select {
    display: none;
}

.select-trigger {
    /* Base trigger styling - most styling handled by Tailwind classes in HTML */
    user-select: none;
}

/* Arrow rotation transition */
.select-trigger svg:last-child {
    transition: transform 0.2s;
}

.custom-select.active .select-trigger svg:last-child {
    transform: rotate(180deg);
}

.select-options {
    /* Base styling - visibility controlled by Alpine x-show/x-transition */
    max-height: 240px;
    overflow-y: auto;
}

.dark .select-options {
    /* Dark mode handled by Tailwind classes in HTML */
}

.select-option {
    /* Base option styling - hover/selected states handled by Tailwind :class binding in HTML */
    transition: all 0.15s;
}
