* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.main-content {
    padding: 30px;
}

.input-section {
    margin-bottom: 30px;
}

.url-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#videoUrl {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

#videoUrl:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#analyzeBtn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#analyzeBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.supported-sites h3 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.sites-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.site-tag {
    background: #ecf0f1;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #2c3e50;
}

.video-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
}

.video-header {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

#videoThumbnail {
    width: 200px;
    height: 150px;
    border-radius: 10px;
    object-fit: cover;
}

.video-details {
    flex: 1;
}

.video-details h2 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.4em;
}

.video-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    color: #7f8c8d;
}

.video-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.video-description {
    color: #5d6d7e;
    line-height: 1.5;
}

.option-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    background: #ecf0f1;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: #3498db;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.format-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #e1e8ed;
    cursor: pointer;
    transition: all 0.3s ease;
}

.format-card:hover {
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.format-card.selected {
    border-color: #27ae60;
    background: #f0fff4;
}

.format-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 8px;
}

.format-quality {
    font-weight: bold;
    color: #2c3e50;
}

.format-size {
    color: #7f8c8d;
    font-size: 0.9em;
}

.format-details {
    font-size: 0.85em;
    color: #5d6d7e;
}

.download-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(39, 174, 96, 0.3);
}

.custom-filename {
    margin-top: 20px;
}

.custom-filename label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

#filenameInput {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
}

.progress-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e1e8ed;
    border-radius: 5px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: #5d6d7e;
}

.result-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.success-message {
    color: #27ae60;
    font-size: 1.1em;
    margin-bottom: 15px;
}

.download-link {
    display: inline-block;
    padding: 12px 25px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.download-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.hidden {
    display: none !important;
}
/* Add these to your existing CSS */

.error-message {
    background: #fee;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    padding: 15px;
    margin: 10px 0;
    color: #721c24;
}

.warning-message {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    padding: 15px;
    margin: 10px 0;
    color: #856404;
}

.retry-button {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
}

.retry-button:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
}
/* Responsive design */
@media (max-width: 768px) {
    .video-header {
        flex-direction: column;
    }
    
    #videoThumbnail {
        width: 100%;
        height: 200px;
    }
    
    .url-input-container {
        flex-direction: column;
    }
    
    .formats-grid {
        grid-template-columns: 1fr;
    }
}