/* Universal Video Downloader Styles */

.uvd-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f6fa;
    color: #2c3e50;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.uvd-header {
    text-align: center;
    margin-bottom: 20px;
}

.uvd-header-icon {
    font-size: 2.5rem;
    color: #3498db;
}

.uvd-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.uvd-header p {
    color: #7f8c8d;
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Stats Cards */
.uvd-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.uvd-stat-card {
    background: white;
    padding: 30px 20px;
    text-align: center;
    border-radius: 8px;
}

.uvd-stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #3498db;
    margin-bottom: 8px;
}

.uvd-stat-label {
    font-size: 0.85rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Main Card */
.uvd-main-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

/* URL Input Section */
.uvd-url-section {
    margin-bottom: 20px;
}

.uvd-url-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.uvd-url-input-wrapper {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.uvd-url-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 1rem;
    border: 2px solid #e0e6ed;
    border-radius: 8px !important;
    background: #fff;
    color: #2c3e50;
    transition: border-color 0.2s ease;
}

.uvd-url-input:focus {
    outline: none;
    border-color: #3498db;
}

.uvd-url-input::placeholder {
    color: #95a5a6;
}

.uvd-analyze-btn {
    padding: 15px 25px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.uvd-analyze-btn:hover {
    background: #2980b9;
}

.uvd-analyze-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* Video Preview Section */
.uvd-video-preview {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    display: none;
}

.uvd-video-preview.uvd-show {
    display: block;
    animation: uvdFadeIn 0.3s ease;
}

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

.uvd-video-info {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.uvd-video-thumbnail {
    width: 120px;
    height: 160px;
    background: #e9ecef;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #6c757d;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.uvd-video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.uvd-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.uvd-video-details {
    flex: 1;
}

.uvd-video-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.4;
}

.uvd-video-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.uvd-author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #3498db;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.uvd-author-name {
    font-weight: 600;
    color: #2c3e50;
}

.uvd-author-username {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.uvd-video-stats {
    display: flex;
    gap: 20px;
    color: #7f8c8d;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.uvd-stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Download Options */
.uvd-download-options {
    margin-bottom: 20px;
    display: none;
}

.uvd-download-options.uvd-show {
    display: block;
}

.uvd-download-options h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
}

.uvd-quality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.uvd-quality-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.uvd-quality-card:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

.uvd-quality-card.uvd-selected {
    border-color: #3498db;
    background: #e3f2fd;
}

.uvd-quality-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.uvd-quality-size {
    font-size: 0.9rem;
    color: #3498db;
    font-weight: 600;
    margin-bottom: 8px;
}

.uvd-quality-desc {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 15px;
}

.uvd-download-btn {
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.uvd-download-btn:hover {
    background: #229954;
}

.uvd-quality-card.uvd-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none; /* Prevent all clicks */
}

.uvd-quality-card.uvd-disabled .uvd-download-btn {
    background: #bdc3c7 !important;
    cursor: not-allowed !important;
    pointer-events: none !important; /* Block clicks completely */
}

.uvd-quality-card.uvd-disabled:hover {
    border-color: #e9ecef !important; /* No hover effect */
    background: #f8f9fa !important;
}

/* Additional Options */
.uvd-additional-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.uvd-option-btn {
    padding: 12px 20px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    color: #2c3e50;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.uvd-option-btn:hover {
    border-color: #3498db;
    background: #f0f8ff;
    color: #3498db;
    text-decoration: none;
}

/* Thêm vào file style.css */
.uvd-status-message {
    padding: 10px 20px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 0.95rem;
    font-weight: 500;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.uvd-status-text {
	padding: 15px 0;
}

.uvd-status-message.uvd-hidden {
    /* Thay vì display: none, dùng opacity và visibility */
    opacity: 0;
    visibility: hidden;
    /* Giữ nguyên height để không ảnh hưởng layout */
    min-height: 50px;
}

/* Thêm class cho permanent messages */
.uvd-status-message.uvd-permanent {
    opacity: 1;
    visibility: visible;
}

.uvd-status-success {
    background: #d4edda;
    color: #155724;
}

.uvd-status-error {
    background: #f8d7da;
    color: #721c24;
}

.uvd-status-info {
    background: #cce7ff;
    color: #004085;
}

/* Features Grid */
.uvd-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.uvd-feature {
    background: white;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
}

.uvd-feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.uvd-feature h3 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

.uvd-feature p {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* FAQ Section */
.uvd-faq-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.uvd-faq-section h2 {
    font-size: 22px;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
}

.uvd-faq-item {
    margin-bottom: 10px;
}

.uvd-faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.uvd-faq-question {
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.uvd-faq-question:hover {
    background: #e9ecef;
}

.uvd-faq-question h3 {
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: 600;
    margin: 0;
}

.uvd-faq-toggle {
    font-size: 1.5rem;
    color: #6c757d;
    transition: transform 0.3s ease;
}

.uvd-faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.uvd-faq-answer.uvd-active {
    max-height: 200px;
    padding: 20px;
}

.uvd-faq-answer p {
    color: #6c757d;
    line-height: 1.7;
    margin: 0;
}

/* How to Guide */
.uvd-guide-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.uvd-guide-section h2 {
    font-size: 22px;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
}

.uvd-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.uvd-step {
    text-align: center;
}

.uvd-step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.3rem;
    font-weight: 700;
}

.uvd-step h3 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

.uvd-step p {
    color: #7f8c8d;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Utilities */
.uvd-hidden {
    display: none !important;
}

.uvd-loading {
    opacity: 0.7;
    pointer-events: none;
}

.uvd-text-center {
    text-align: center;
}

.uvd-mb-20 {
    margin-bottom: 20px;
}

.uvd-mt-20 {
    margin-top: 20px;
}

/* Container loading state */
.uvd-container.uvd-downloading {
    pointer-events: none; /* Prevent all interactions */
    opacity: 0.8;
}

.uvd-container.uvd-downloading .uvd-download-btn {
    cursor: not-allowed !important;
}

.uvd-container.uvd-downloading .uvd-quality-card {
    opacity: 0.6;
}

/* Allow status message to still be interactive */
.uvd-container.uvd-downloading .uvd-status-message {
    pointer-events: auto;
    opacity: 1;
}

/* Complete removal of spinner */
.uvd-download-btn:disabled::after,
.uvd-download-btn.uvd-downloading::after {
    display: none !important;
}

/* Loading animation for buttons */
.uvd-download-btn:disabled {
    background: #95a5a6 !important;
    cursor: not-allowed !important;
	opacity: 0.6;
}

/* Analyze button disabled state */
.uvd-analyze-btn:disabled {
    background: #bdc3c7 !important;
    cursor: not-allowed !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .uvd-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .uvd-url-input-wrapper {
        flex-direction: column;
    }

    .uvd-analyze-btn {
        width: 100%;
    }

    .uvd-video-info {
        flex-direction: column;
        text-align: center;
    }

    .uvd-video-thumbnail {
        align-self: center;
    }

    .uvd-video-stats {
        justify-content: center;
    }

    .uvd-quality-grid {
        grid-template-columns: 1fr;
    }

    .uvd-additional-options {
        flex-direction: column;
    }

    .uvd-option-btn {
        width: 100%;
        justify-content: center;
    }

    .uvd-features {
        grid-template-columns: 1fr;
    }

    .uvd-steps {
        grid-template-columns: 1fr;
    }

    .uvd-faq-section,
    .uvd-guide-section {
        padding: 25px 20px;
    }
}

@media (max-width: 480px) {
    .uvd-header p {
        font-size: 0.9rem;
    }

    .uvd-stat-number {
        font-size: 1.5rem;
    }

    .uvd-stat-label {
        font-size: 0.75rem;
    }

    .uvd-url-input {
        font-size: 0.9rem;
        padding: 12px 15px;
    }

    .uvd-analyze-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .uvd-video-thumbnail {
        width: 100px;
        height: 140px;
    }

    .uvd-quality-title {
        font-size: 1rem;
    }

    .uvd-download-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

/* Print styles */
@media print {
    .uvd-download-options,
    .uvd-additional-options {
        display: none !important;
    }
}