/* Combine Videos Page Styles */

.combine-section {
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h3 {
    color: #e6edf3;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #c9d1d9;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 0.875rem;
}

.form-control:focus {
    outline: none;
    border-color: #58a6ff;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.help-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #8b949e;
}

.topic-info {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(88, 166, 255, 0.1);
    border-radius: 8px;
    border-left: 3px solid #58a6ff;
}

.topic-info p {
    margin: 0.5rem 0;
    color: #c9d1d9;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.video-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.video-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(88, 166, 255, 0.3);
    transform: translateY(-2px);
}

.video-card.selected {
    background: rgba(88, 166, 255, 0.15);
    border-color: #58a6ff;
}

.video-card .selection-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #58a6ff;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
}

.video-card.selected .selection-badge {
    display: flex;
}

.video-card .video-thumbnail {
    width: 100%;
    aspect-ratio: 9/16;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    overflow: hidden;
}

.video-card .video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-card .video-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-card .video-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    flex-wrap: wrap;
}

.video-card .video-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.selected-videos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.selected-video-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-radius: 8px;
    position: relative;
    min-height: 250px;
}

.selected-video-item .order-badge,
.selected-video-item .video-order {
    background: #58a6ff;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.85rem;
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 1;
}

.selected-video-item .video-thumb,
.selected-video-item .video-thumbnail-small {
    width: 100%;
    aspect-ratio: 9/16;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    overflow: hidden;
    position: relative;
}

.selected-video-item .video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.selected-video-item .video-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.selected-video-item .video-info h4,
.selected-video-item .video-title-small {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 600;
}

.selected-video-item .video-info p,
.selected-video-item .video-meta-small {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.selected-video-item .remove-btn,
.selected-video-item .video-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.selected-video-item .btn-remove,
.selected-video-item .btn-preview {
    flex: 1;
    background: rgba(88, 166, 255, 0.2);
    color: #58a6ff;
    border: 1px solid rgba(88, 166, 255, 0.4);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.selected-video-item .btn-remove {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.4);
}

.selected-video-item .btn-remove:hover {
    background: rgba(244, 67, 54, 0.3);
    border-color: #f44336;
}

.selected-video-item .btn-preview:hover {
    background: rgba(88, 166, 255, 0.3);
    border-color: #58a6ff;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    width: 0%;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.875rem;
}

#progressStatus {
    text-align: center;
    font-size: 1rem;
    color: #58a6ff;
    margin: 0.5rem 0;
}

.progress-logs {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.progress-logs .log-entry {
    margin: 0.25rem 0;
    color: rgba(255, 255, 255, 0.7);
}

.progress-logs .log-entry.success {
    color: #4CAF50;
}

.progress-logs .log-entry.error {
    color: #f44336;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

@media (max-width: 768px) {
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .selected-videos {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .action-buttons {
        flex-direction: column;
    }
}
