* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5em;
    color: #ff0000;
    margin-bottom: 10px;
}

header h1 i {
    margin-right: 10px;
}

header p {
    color: #666;
    font-size: 1.1em;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#urlInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#urlInput:focus {
    outline: none;
    border-color: #667eea;
}

#fetchBtn {
    padding: 15px 30px;
    background: #ff0000;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

#fetchBtn:hover {
    background: #cc0000;
}

.loading {
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff0000;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #fee;
    color: #c00;
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
}

.video-card {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 15px;
}

.thumbnail-container {
    position: relative;
    min-width: 200px;
}

.thumbnail-container img {
    width: 200px;
    border-radius: 10px;
}

.duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
}

.video-details h2 {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.video-details p {
    color: #666;
    margin-bottom: 10px;
}

.stats {
    display: flex;
    gap: 15px;
    color: #888;
    font-size: 0.9em;
}

.format-options {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.format-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
}

.format-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.format-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.format-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: background 0.3s;
}

.format-item:hover {
    background: #e9ecef;
}

.download-btn {
    padding: 10px 25px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.download-btn:hover {
    background: #218838;
}

.progress-container {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: #28a745;
    width: 0%;
    transition: width 0.3s;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #e0e0e0;
}

.feature {
    text-align: center;
    padding: 20px;
}

.feature i {
    font-size: 2em;
    color: #667eea;
    margin-bottom: 10px;
}

.feature h3 {
    margin-bottom: 5px;
}

.feature p {
    color: #666;
    font-size: 0.9em;
}

footer {
    text-align: center;
    margin-top: 30px;
    color: white;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    .video-card {
        flex-direction: column;
    }

    .thumbnail-container {
        min-width: 100%;
    }

    .thumbnail-container img {
        width: 100%;
    }

    .features {
        grid-template-columns: 1fr;
    }

    .input-group {
        flex-direction: column;
    }
}