* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
}

.main-header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    position: relative;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.home-link {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #ff0000;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: color 0.3s;
}

.home-link:hover {
    color: #cc0000;
    text-decoration: underline;
}

.container {
    max-width: 800px;
    margin: 20px auto;
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #ff0000;
    text-align: center;
    margin-bottom: 10px;
    padding-top: 10px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

.input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#youtube-url {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

#extract-btn, button {
    padding: 12px 20px;
    background-color: #ff0000;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

#extract-btn:hover, button:hover {
    background-color: #cc0000;
}

#error-message {
    color: #ff0000;
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid #ff0000;
    border-radius: 4px;
    background-color: #ffeeee;
}

.hidden {
    display: none;
}

#thumbnails-container {
    margin-top: 30px;
}

#thumbnails-container h2 {
    margin-bottom: 20px;
    color: #333;
}

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

.thumbnail-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.thumbnail-img {
    width: 100%;
    height: auto;
    display: block;
}

.thumbnail-info {
    padding: 15px;
    background-color: #f5f5f5;
}

.thumbnail-quality {
    font-weight: bold;
    margin-bottom: 5px;
}

.thumbnail-resolution {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
}

.download-btn {
    width: 100%;
    padding: 8px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.download-btn:hover {
    background-color: #45a049;
}

.how-to-use {
    margin-top: 40px;
    padding: 20px;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.how-to-use h3 {
    margin-bottom: 15px;
    color: #333;
}

.how-to-use ol {
    padding-left: 20px;
}

.how-to-use li {
    margin-bottom: 8px;
}

.ad-container {
    margin: 20px 0;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 8px;
}

@media (max-width: 600px) {
    .input-container {
        flex-direction: column;
    }
    
    #youtube-url, #extract-btn {
        width: 100%;
    }
    
    .thumbnails-grid {
        grid-template-columns: 1fr;
    }
    
    .home-link {
        position: static;
        display: block;
        text-align: center;
        margin-bottom: 15px;
    }
    
    h1 {
        padding-top: 0;
    }
}