/* HitBone Web Interface Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.page {
    min-height: 100vh;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-container h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

#login-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

#login-form button {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

#login-form button:hover {
    background: #5568d3;
}

.error {
    color: #e74c3c;
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
}

.hint {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin-top: 20px;
}

/* Dashboard */
#dashboard-page {
    background: #f5f7fa;
}

.header {
    background: white;
    padding: 20px 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h2 {
    color: #667eea;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

#logout-btn {
    padding: 8px 16px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.main-content {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.section {
    background: white;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.section h3 {
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

/* Submit Task Form */
.submit-modes {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.mode-btn {
    padding: 10px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.mode-btn.active {
    background: #667eea;
    color: white;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
}

.form-group input[type="file"] {
    width: 100%;
}

#image-preview {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

#image-preview img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    border: 2px solid #ddd;
}

.btn-primary {
    padding: 12px 30px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #5568d3;
}

/* Task List */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

#task-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.task-item {
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.task-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.task-id {
    font-weight: bold;
    color: #667eea;
}

.task-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.task-status.queued { background: #f39c12; color: white; }
.task-status.running { background: #3498db; color: white; }
.task-status.completed { background: #27ae60; color: white; }
.task-status.failed { background: #e74c3c; color: white; }

.task-progress {
    margin-top: 10px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s ease;
}

.task-meta {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* Agent Progress */
.agent-item {
    padding: 15px;
    margin: 10px 0;
    border-left: 4px solid #ddd;
    background: #f9f9f9;
}

.agent-item.running {
    border-left-color: #3498db;
    background: #e3f2fd;
}

.agent-item.completed {
    border-left-color: #27ae60;
}

.agent-item.failed {
    border-left-color: #e74c3c;
    background: #ffebee;
}

.agent-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.agent-meta {
    font-size: 13px;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 15px 20px;
    }

    .main-content {
        padding: 0 15px;
    }

    .section {
        padding: 20px;
    }

    .modal-content {
        margin: 20px;
        max-width: 100%;
    }
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    background: white;
    padding: 0 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-tab {
    padding: 15px 30px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 15px;
    color: #666;
    transition: all 0.3s;
}

.nav-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.nav-tab:hover {
    color: #667eea;
    background: #f8f9fa;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Workflow Section */
.workflow-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
}

.workflow-intro {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.agent-flow {
    display: flex;
    align-items: center;
    overflow-x: auto;
    padding: 20px 0;
    gap: 15px;
}

.agent-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 200px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.agent-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.agent-info {
    text-align: center;
}

.agent-info h4 {
    font-size: 18px;
    margin-bottom: 5px;
}

.agent-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #ffd700;
}

.agent-desc {
    font-size: 12px;
    line-height: 1.4;
    opacity: 0.9;
}

.flow-arrow {
    font-size: 30px;
    color: #667eea;
    font-weight: bold;
}

/* Product Grid */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.product-images {
    display: flex;
    height: 200px;
}

.product-images img {
    width: 50%;
    object-fit: cover;
}

.product-info {
    padding: 15px;
}

.product-sku {
    font-size: 12px;
    color: #667eea;
    font-weight: bold;
    margin-bottom: 5px;
}

.product-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.product-selling-points {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.product-actions {
    padding: 10px 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.product-actions button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
}

.btn-edit {
    background: #667eea;
    color: white;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

/* Feishu Status */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
    background: #ccc;
}

.status-dot.connected {
    background: #28a745;
    box-shadow: 0 0 8px #28a745;
    animation: pulse 2s infinite;
}

.status-dot.error {
    background: #dc3545;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#feishu-status {
    font-size: 13px;
    color: #666;
}

/* Image Preview */
.image-preview-small {
    margin-top: 10px;
}

.image-preview-small img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Product Selection Preview */
#selected-product-preview {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    display: none;
}

#selected-product-preview.show {
    display: block;
}

#selected-product-preview .preview-images {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

#selected-product-preview .preview-images img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    border: 2px solid #667eea;
}

#selected-product-preview .preview-title {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

#selected-product-preview .preview-sku {
    font-size: 12px;
    color: #667eea;
}
