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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #1a202c;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 100%;
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 400;
}

main {
    padding: 40px;
}

.input-section {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

#urlInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f7fafc;
}

#urlInput:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-download {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    width: 100%;
    justify-content: center;
    font-size: 18px;
    padding: 18px;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(72, 187, 120, 0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s ease infinite;
}

.hidden {
    display: none !important;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    border-left: 4px solid #c53030;
}

.video-info {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.video-preview {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 25px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 12px;
}

#thumbnail {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.video-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#videoTitle {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.3;
}

.video-meta {
    display: flex;
    gap: 20px;
    color: #718096;
    font-size: 14px;
}

.video-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.video-meta span::before {
    content: '•';
    margin-right: 5px;
}

.video-meta span:first-child::before {
    display: none;
}

.video-description {
    color: #4a5568;
    line-height: 1.6;
    margin-top: 10px;
    max-height: 100px;
    overflow-y: auto;
}

.download-options {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
}

.download-options h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #2d3748;
}

.format-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.format-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.format-group label {
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.format-group select {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.format-group select:hover {
    border-color: #cbd5e0;
}

.format-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.download-icon {
    width: 24px;
    height: 24px;
}

.progress-section {
    margin-top: 30px;
    padding: 25px;
    background: #f7fafc;
    border-radius: 12px;
    text-align: center;
}

.progress-text {
    margin-bottom: 15px;
    color: #4a5568;
    font-weight: 500;
}

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

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

@keyframes loading {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

footer {
    background: #f7fafc;
    padding: 40px;
    border-top: 1px solid #e2e8f0;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.feature {
    display: flex;
    gap: 15px;
}

.feature svg {
    flex-shrink: 0;
    color: #667eea;
}

.feature h4 {
    font-size: 16px;
    margin-bottom: 5px;
    color: #2d3748;
}

.feature p {
    font-size: 14px;
    color: #718096;
    line-height: 1.4;
}

.disclaimer {
    text-align: center;
    color: #718096;
    font-size: 14px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .video-preview {
        grid-template-columns: 1fr;
    }
    
    .format-selection {
        grid-template-columns: 1fr;
    }
    
    .input-section {
        flex-direction: column;
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
}