/* Status Page Specific Styles */

/* Section Styles */
.progress-section,
.jobs-section,
.storybooks-section {
    margin: 30px 0;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 232, 240, 0.3) 0%, rgba(255, 249, 230, 0.3) 100%);
    border-radius: 20px;
    border: 2px solid var(--border-color);
}

.progress-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-section h2,
.jobs-section h2,
.storybooks-section h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-align: center;
    color: var(--primary-color);
}

.generation-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 20px;
}

/* Progress Container */
.progress-container {
    width: 100%;
    max-width: 600px;
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 40px;
    background: linear-gradient(135deg, #FFE8F0 0%, #FFF9E6 100%);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.1);
    border: 3px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 50%, var(--secondary-color) 100%);
    transition: width 0.8s ease;
    border-radius: 20px;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Progress Text */
.progress-text {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 25px 0 15px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(255, 107, 157, 0.2);
}

.progress-text::after {
    content: ' 完成';
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.current-step {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 30px;
    text-align: center;
    min-height: 35px;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(255, 217, 61, 0.2) 0%, rgba(107, 207, 127, 0.2) 100%);
    border-radius: 15px;
    display: inline-block;
}

.current-step::before {
    content: '✨ ';
    margin-right: 8px;
}

/* Jobs List */
.jobs-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.job-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.job-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

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

.job-id {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-family: monospace;
}

.job-status {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.job-status.processing {
    background: linear-gradient(135deg, rgba(255, 217, 61, 0.3), rgba(107, 207, 127, 0.3));
    color: var(--text-color);
}

.job-status.pending {
    background: rgba(200, 200, 200, 0.3);
    color: var(--text-color);
}

.job-status.failed {
    background: rgba(255, 107, 157, 0.2);
    color: var(--primary-color);
}

.job-progress-bar {
    width: 100%;
    height: 25px;
    background: linear-gradient(135deg, #FFE8F0 0%, #FFF9E6 100%);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    margin-bottom: 10px;
}

.job-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 50%, var(--secondary-color) 100%);
    transition: width 0.5s ease;
}

.job-step {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Job actions */
.job-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.btn-cancel {
    padding: 8px 14px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8585 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.3);
}

.btn-cancel:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(255, 107, 107, 0.45);
}

.btn-cancel:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
}

/* Storybooks Grid */
.storybooks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.storybook-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    border: 3px solid var(--border-color);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.storybook-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}

.storybook-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #FFE8F0 0%, #FFF9E6 100%);
}

.storybook-info {
    padding: 20px;
}

.storybook-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.storybook-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.storybook-style {
    display: inline-block;
    padding: 5px 12px;
    background: linear-gradient(135deg, rgba(255, 217, 61, 0.2), rgba(107, 207, 127, 0.2));
    border-radius: 15px;
    font-weight: 600;
}

.storybook-pages {
    font-size: 0.9rem;
}

.storybook-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* Empty Message */
.empty-message {
    text-align: center;
    padding: 40px 20px;
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Spinner for status page */
.progress-section .spinner {
    margin-top: 20px;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding: 20px 0;
}

.pagination-btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3);
}

.pagination-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 157, 0.4);
}

.pagination-btn:active:not(:disabled) {
    transform: translateY(0);
}

.pagination-btn:disabled {
    background: linear-gradient(135deg, #ccc 0%, #aaa 100%);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.pagination-info {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    padding: 10px 20px;
    background: white;
    border-radius: 20px;
    border: 2px solid var(--border-color);
    min-width: 150px;
    text-align: center;
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Loading indicator */
.loading {
    text-align: center;
    padding: 40px;
}

.loading p {
    margin-top: 20px;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .progress-section,
    .jobs-section,
    .storybooks-section {
        padding: 15px;
    }
    
    .progress-bar {
        height: 25px;
    }
    
    .progress-text {
        font-size: 1.75rem;
    }
    
    .current-step {
        font-size: 1rem;
    }
    
    .storybooks-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 15px;
    }
    
    .job-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .pagination-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        width: 100%;
        max-width: 200px;
    }
    
    .pagination-info {
        font-size: 1rem;
        min-width: auto;
        width: 100%;
        max-width: 200px;
    }
}
