/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #FF0000, #CC0000);
    color: white;
    padding: 30px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header-content {
    text-align: center;
}

.header-content h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.header-content .tagline {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content Styles */
main {
    padding: 40px 0;
}

section {
    margin-bottom: 50px;
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

h2 {
    font-family: 'Poppins', sans-serif;
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

h3 {
    font-family: 'Poppins', sans-serif;
    color: #444;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

h4 {
    font-family: 'Poppins', sans-serif;
    color: #555;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

/* Intro Section */
.intro-section {
    background: linear-gradient(to right, #f8f9fa, #e9ecef);
    border-left: 5px solid #FF0000;
}

.intro-content h2 {
    color: #FF0000;
}

/* Input Section */
.input-section {
    border-top: 5px solid #FF0000;
}

.input-container label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.input-group input {
    flex: 1;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #FF0000;
}

.btn-primary {
    background: linear-gradient(to right, #FF0000, #CC0000);
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: linear-gradient(to right, #CC0000, #990000);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.2);
}

.examples {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #FF0000;
}

.examples ul {
    list-style-type: none;
    margin-top: 10px;
}

.examples li {
    padding: 5px 0;
    font-family: monospace;
    color: #666;
    font-size: 0.9rem;
    border-bottom: 1px dashed #ddd;
}

.examples li:last-child {
    border-bottom: none;
}

/* Thumbnails Section */
.section-header {
    text-align: center;
    margin-bottom: 30px;
}

.section-subtitle {
    color: #666;
    font-size: 1rem;
}

/* Loading and Error States */
.loading, .error-message {
    display: none;
    text-align: center;
    padding: 40px;
    background-color: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 30px;
}

.loading.active, .error-message.active {
    display: block;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #FF0000;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    background-color: #fff5f5;
    border-left: 5px solid #ff6b6b;
}

.error-message i {
    font-size: 2.5rem;
    color: #ff6b6b;
    margin-bottom: 15px;
}

/* Video Info */
.video-info {
    display: none;
    margin-bottom: 40px;
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.video-info.active {
    display: block;
}

.video-details {
    display: flex;
    gap: 25px;
    align-items: center;
}

.video-thumbnail-preview {
    flex-shrink: 0;
}

.video-thumbnail-preview img {
    width: 180px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.video-text-info {
    flex: 1;
}

#video-title {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 10px;
}

#video-channel {
    color: #666;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.video-id-display {
    background-color: #e9ecef;
    padding: 8px 15px;
    border-radius: 5px;
    display: inline-block;
    font-family: monospace;
}

/* Thumbnails Container */
.thumbnails-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.thumbnail-item {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #eee;
}

.thumbnail-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.thumbnail-img-container {
    height: 180px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f1f1;
}

.thumbnail-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s;
}

.thumbnail-img-container img:hover {
    transform: scale(1.05);
}

.thumbnail-info {
    padding: 20px;
}

.thumbnail-size {
    font-weight: 700;
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 8px;
}

.thumbnail-resolution {
    color: #666;
    margin-bottom: 15px;
    font-family: monospace;
}

.btn-view {
    display: inline-block;
    background-color: #FF0000;
    color: white;
    padding: 8px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.btn-view:hover {
    background-color: #CC0000;
    color: white;
}

/* Instructions */
.instructions ol {
    margin-left: 20px;
    margin-bottom: 30px;
}

.instructions li {
    margin-bottom: 10px;
    padding-left: 10px;
}

.thumbnail-sizes-info {
    overflow-x: auto;
}

.thumbnail-sizes-info table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.thumbnail-sizes-info th {
    background-color: #FF0000;
    color: white;
    padding: 15px;
    text-align: left;
}

.thumbnail-sizes-info td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.thumbnail-sizes-info tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Features Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.feature {
    text-align: center;
    padding: 25px;
    border-radius: 10px;
    background-color: #f8f9fa;
    transition: transform 0.3s;
}

.feature:hover {
    transform: translateY(-5px);
    background-color: #fff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.feature-icon {
    font-size: 2.5rem;
    color: #FF0000;
    margin-bottom: 20px;
}

.feature h3 {
    margin-bottom: 15px;
}

/* API Section */
.api-example {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    margin-top: 20px;
    overflow-x: auto;
}

.api-example h3 {
    margin-top: 20px;
    margin-bottom: 10px;
}

.api-example code, .api-example pre {
    background-color: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 5px;
    display: block;
    font-family: 'Courier New', monospace;
    margin-bottom: 15px;
    overflow-x: auto;
}

.api-example pre {
    white-space: pre-wrap;
}

/* Footer */
footer {
    background-color: #222;
    color: #ddd;
    padding: 50px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-info h3 {
    color: white;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-links h4 {
    color: white;
    margin-bottom: 20px;
}

.footer-links ul {
    list-style-type: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover {
    color: #FF0000;
}

.footer-disclaimer {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 8px;
    grid-column: 1 / -1;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    font-size: 0.9rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 800px;
    width: 100%;
    position: relative;
    animation: modalFade 0.3s;
}

@keyframes modalFade {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 10;
}

.close-modal:hover {
    color: #FF0000;
}

.modal-content img {
    width: 100%;
    max-height: 500px;
    object-fit: contain;
    border-radius: 5px;
    margin-bottom: 20px;
}

.modal-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.btn-download {
    background-color: #FF0000;
    color: white;
    padding: 10px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.btn-download:hover {
    background-color: #CC0000;
    color: white;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .header-content h1 {
        font-size: 2.2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .btn-primary {
        justify-content: center;
        padding: 15px;
    }
    
    .video-details {
        flex-direction: column;
        text-align: center;
    }
    
    .video-thumbnail-preview img {
        width: 100%;
        max-width: 300px;
    }
    
    .thumbnails-container {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-info {
        flex-direction: column;
        align-items: flex-start;
    }
}