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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

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

header {
    text-align: center;
    color: #2d3748;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #667eea;
}

header p {
    font-size: 1.1em;
    color: #4a5568;
}

.main-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.input-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #eee;
}

.input-section h2 {
    margin-bottom: 20px;
    color: #667eea;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-group input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

button {
    padding: 12px 25px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    font-weight: 600;
}

button:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.videos-section, .downloaded-section {
    margin-top: 30px;
}

.videos-section h2, .downloaded-section h2 {
    margin-bottom: 20px;
    color: #667eea;
}

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

.video-card {
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #e0e0e0;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.video-card.already-downloaded {
    opacity: 0.7;
    border: 2px solid #d4edda;
}

.video-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #ddd;
}

.video-info {
    padding: 15px;
}

.video-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    font-size: 14px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-size {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.video-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 10px;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-downloading {
    background: #d1ecf1;
    color: #0c5460;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
}

.status-queued {
    background: #e2e3e5;
    color: #383d41;
}

.queue-status {
    padding: 10px 15px;
    background: #e2e3e5;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 14px;
    font-weight: 600;
    color: #383d41;
    text-align: center;
}

.queue-status.processing {
    background: #d1ecf1;
    color: #0c5460;
    animation: pulse 2s ease-in-out infinite;
}

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

.process-next-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background: #48bb78;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 600;
}

.process-next-btn:hover:not(:disabled) {
    background: #38a169;
}

.process-next-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #667eea;
    font-size: 18px;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .videos-list {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .input-group {
        flex-direction: column;
    }
}

