/* Reset và base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #f1f1f1;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header styles */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.logo-icon {
    font-size: 3rem;
    color: #FF0000;
    margin-right: 15px;
}

.logo-text {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(to right, #FF0000, #FF6B6B);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tagline {
    font-size: 1.1rem;
    color: #aaa;
    max-width: 800px;
    margin: 0 auto;
}

/* Input section */
.input-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.input-with-icon {
    flex: 1;
    position: relative;
}

.input-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #FF0000;
    font-size: 1.2rem;
}

#videoUrl {
    width: 100%;
    padding: 18px 20px 18px 55px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s ease;
}

#videoUrl:focus {
    outline: none;
    border-color: #FF0000;
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.2);
}

.btn-extract {
    background: linear-gradient(to right, #FF0000, #C53030);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.btn-extract:hover {
    background: linear-gradient(to right, #C53030, #FF0000);
    transform: translateY(-2px);
    box-shadow: 0 7px 15px rgba(255, 0, 0, 0.3);
}

.btn-extract:active {
    transform: translateY(0);
}

.input-hint {
    color: #aaa;
    font-size: 0.95rem;
    font-style: italic;
}

/* Thumbnail section */
.thumbnail-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.thumbnail-section h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-description {
    color: #aaa;
    margin-bottom: 25px;
}

.quality-selector {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.quality-selector h3 {
    margin-bottom: 15px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quality-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quality-btn {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.quality-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.quality-btn.active {
    background: #FF0000;
    color: white;
    border-color: #FF0000;
}

.thumbnails-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.thumbnail-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.thumbnail-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.thumbnail-header {
    display: flex;
    justify-content: space-between;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.thumbnail-quality {
    font-weight: 600;
    color: #fff;
}

.thumbnail-dimension {
    color: #FF6B6B;
    font-weight: 500;
}

.thumbnail-preview {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.thumbnail-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.no-thumbnail {
    text-align: center;
    color: #777;
}

.no-thumbnail i {
    font-size: 3rem;
    margin-bottom: 10px;
    color: #444;
}

.thumbnail-actions {
    padding: 20px;
    text-align: center;
}

.btn-download {
    background: linear-gradient(to right, #4CAF50, #2E7D32);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.btn-download:hover {
    background: linear-gradient(to right, #2E7D32, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.video-info {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
}

.video-info h3 {
    margin-bottom: 20px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-label {
    font-weight: 600;
    min-width: 100px;
    color: #aaa;
}

.info-value {
    color: #fff;
    flex: 1;
    word-break: break-word;
}

/* Instructions section */
.instructions-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.instructions-section h2 {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instructions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
}

.instruction-step {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.instruction-step:hover {
    transform: translateY(-5px);
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(to right, #FF0000, #C53030);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 20px;
}

.instruction-step h3 {
    margin-bottom: 15px;
    color: #fff;
    font-size: 1.3rem;
}

.instruction-step p {
    color: #aaa;
    font-size: 0.95rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-text {
    color: #aaa;
    margin-bottom: 10px;
    font-size: 1rem;
}

.footer-disclaimer {
    color: #777;
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-style: italic;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-link {
    color: #4CAF50;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #FF0000;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 70px;
    height: 70px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: #FF0000;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: white;
    font-size: 1.2rem;
    font-weight: 500;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #4CAF50;
    color: white;
    padding: 20px 25px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-width: 400px;
    transform: translateX(100px);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-icon {
    font-size: 1.5rem;
}

.notification-text {
    font-weight: 500;
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Responsive styles */
@media (max-width: 992px) {
    .thumbnails-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .instructions-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .logo-text {
        font-size: 1.8rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .btn-extract {
        padding: 18px;
        justify-content: center;
    }
    
    .thumbnails-container {
        grid-template-columns: 1fr;
    }
    
    .instructions-grid {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-links {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .notification {
        left: 20px;
        right: 20px;
        bottom: 20px;
        max-width: calc(100% - 40px);
    }
}

@media (max-width: 480px) {
    .logo-container {
        flex-direction: column;
        text-align: center;
    }
    
    .logo-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .logo-text {
        font-size: 1.5rem;
    }
    
    .input-section, .thumbnail-section, .instructions-section {
        padding: 20px;
    }
    
    .quality-options {
        flex-direction: column;
    }
}