/* CSS Variables for theming */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --text-color: #333;
    --text-secondary: #666;
    --bg-color: #ffffff;
    --bg-secondary: #f8f9fa;
    --border-color: #e1e5e9;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --card-bg: #ffffff;
    --modal-bg: #ffffff;
    --header-bg: rgba(255, 255, 255, 0.95);
}

/* Dark theme variables */
[data-theme="dark"] {
    --primary-color: #8b9eff;
    --secondary-color: #a78bff;
    --text-color: #ffffff;
    --text-secondary: #b0b0b0;
    --bg-color: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --border-color: #404040;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --card-bg: #2d2d2d;
    --modal-bg: #2d2d2d;
    --header-bg: rgba(26, 26, 26, 0.95);
}

/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
}

/* Header */
header {
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0.8rem 0;
    box-shadow: 0 2px 20px var(--shadow-color);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    font-size: 1.6rem;
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav a:hover {
    color: var(--primary-color);
    background: var(--bg-secondary);
    transform: translateY(-1px);
}

.nav a.active {
    color: var(--primary-color);
    background: var(--bg-secondary);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.admin-link {
    background: var(--primary-color);
    color: white !important;
    padding: 0.5rem 1.5rem !important;
}

.admin-link:hover {
    background: var(--secondary-color) !important;
    transform: translateY(-2px);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
}

.theme-btn {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-color);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.theme-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.theme-btn .light-icon,
.theme-btn .dark-icon {
    transition: all 0.3s ease;
}

/* Main Content */
main {
    margin-top: 80px;
    padding: 2rem;
    width: 100%;
    overflow-x: hidden;
}

.hero {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    z-index: -1;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="hero-pattern" width="50" height="50" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23hero-pattern)"/></svg>');
    z-index: -1;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3)); }
    100% { filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.6)); }
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 3rem;
    color: white;
    opacity: 0.9;
    font-weight: 300;
}

/* Platforms Showcase */
.platforms-showcase {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 2rem 0 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.platform-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    min-width: 80px;
}

.platform-item:hover {
    transform: translateY(-5px) scale(1.05);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.platform-item i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.platform-item span {
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    color: white;
}

/* Platform-specific colors */
.platform-item[data-platform="tiktok"] i { color: #000000; }
.platform-item[data-platform="youtube"] i { color: #FF0000; }
.platform-item[data-platform="instagram"] i { color: #E4405F; }
.platform-item[data-platform="facebook"] i { color: #1877F2; }
.platform-item[data-platform="twitter"] i { color: #1DA1F2; }
.platform-item[data-platform="pinterest"] i { color: #BD081C; }
.platform-item[data-platform="vimeo"] i { color: #1AB7EA; }
.platform-item[data-platform="twitch"] i { color: #9146FF; }

/* Download Form */
.download-form {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: stretch;
    position: relative;
    flex-wrap: wrap;
}

.url-input-container {
    flex: 1;
    position: relative;
    min-width: 200px;
}

.url-input-icon {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1rem;
    pointer-events: none;
}

.url-input {
    width: 100%;
    padding: 0.6rem 2.5rem 0.6rem 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85rem;
    background: var(--bg-color);
    color: var(--text-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    min-height: 36px;
    box-sizing: border-box;
}

.url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1), 0 5px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

        .download-btn {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
            border: none;
            padding: 0.5rem 1rem;
            border-radius: 6px;
            font-size: 0.8rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            align-items: center;
            gap: 0.3rem;
            min-height: 32px;
            white-space: nowrap;
            position: relative;
            overflow: hidden;
            min-width: 100px;
            max-width: 140px;
            justify-content: center;
            flex-shrink: 0;
        }

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.download-btn:active {
    transform: translateY(0);
}

/* Test buttons */
.test-buttons {
    margin-top: 1rem;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.test-buttons button {
    margin: 0.25rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    min-width: 120px;
}

.test-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.test-buttons .btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.test-buttons .btn-info {
    background: #17a2b8;
    color: white;
    border: none;
}

.test-buttons .btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
}

/* Responsive cho test buttons */
@media (max-width: 768px) {
    .test-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .test-buttons button {
        width: 100%;
        max-width: 200px;
    }
}

/* Features Section */
.features {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.features h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-color);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow-color);
}

.feature-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* How to Use Section */
.how-to-use {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: 20px;
    margin-top: 2rem;
}

.how-to-use h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-color);
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.step {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 20px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.step:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.step-number {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem;
}

.step h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.step p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Contact Section */
.contact {
    padding: 4rem 2rem;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.contact h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.contact-info {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
}

.contact-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--modal-bg);
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.5rem;
}

.close {
    color: var(--text-secondary);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close:hover {
    color: var(--text-color);
    background: var(--bg-secondary);
}

.modal-body {
    padding: 2rem;
}

/* Loading Modal */
.loading-modal {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
}

.loading-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
}

.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

.btn-info {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-1px);
}

/* Media Info Styles */
.media-info-header {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
    align-items: flex-start;
    text-align: left;
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.media-info-basic {
    flex: 1;
}

.media-info-basic h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
    font-size: 1.3rem;
    line-height: 1.4;
}

.media-info-basic p {
    margin: 0.25rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.media-thumbnail-large {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--shadow-color);
}

/* Images Grid */
.images-grid {
    margin: 2rem 0;
}

.images-grid h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    text-align: center;
}

.image-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: all 0.3s ease;
}

.image-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow-color);
}

.image-preview {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-color);
    background: var(--bg-secondary);
    margin-bottom: 1rem;
}

.image-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-preview:hover .image-thumbnail {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-preview:hover .image-overlay {
    opacity: 1;
}

.image-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.image-details {
    flex: 1;
}

.image-details h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
    font-size: 1.1rem;
}

.image-details p {
    margin: 0.25rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.image-actions {
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
    min-width: 150px;
}

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

/* Audio Section */
.audio-section {
    margin: 2rem 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.audio-section h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    text-align: center;
}

.audio-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.audio-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow-color);
}

.audio-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.audio-details h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
    font-size: 1.1rem;
}

.audio-details p {
    margin: 0.25rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.audio-actions {
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
    min-width: 150px;
}

/* Video Player Section */
.video-player-section {
    margin: 2rem 0;
    text-align: center;
}

.video-player-section h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.video-player {
    margin: 1rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-color);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

.video-player video {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 12px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.video-info {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.video-info p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Download Section */
.download-section {
    margin: 2rem 0;
}

.download-section h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    text-align: center;
}

.download-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1rem 0;
}

.download-option {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: all 0.3s ease;
}

.download-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--shadow-color);
}

.download-option h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
    font-size: 1.1rem;
}

.download-option p {
    margin: 0 0 1rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.download-option .btn-primary,
.download-option .btn-secondary {
    margin: 0.5rem;
    width: 100%;
    justify-content: center;
}

.note-small {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-style: italic;
}

.video-note {
    background: #e8f5e8;
    color: #2e7d32;
    border-left: 4px solid #4caf50;
}

/* Video Error Display */
.video-error {
    text-align: center;
    padding: 2rem;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    color: #856404;
}

.video-error i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #f39c12;
}

.video-error ul {
    text-align: left;
    margin: 1rem 0;
    padding-left: 2rem;
}

.video-error li {
    margin: 0.5rem 0;
}

.video-error .btn-primary {
    margin-top: 1rem;
}

/* File Name Display */
.file-name {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.5rem;
    border-radius: 4px;
    margin: 0.5rem 0;
    font-size: 0.9rem;
    border-left: 3px solid #2196f3;
}

/* Preview Modal */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}

.preview-content {
    background: var(--modal-bg);
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow-color);
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.preview-header h3 {
    margin: 0;
    color: var(--text-color);
}

.preview-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.preview-close:hover {
    color: var(--text-color);
    background: var(--bg-secondary);
}

.preview-body {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
    padding: 20px;
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color);
}

/* Stabilize layout: prevent content shifts */
img, video { 
    max-width: 100%;
    height: auto;
}

/* Reduce motion if user prefers */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* Responsive nav wrapping for very small screens */
@media (max-width: 360px) {
    .nav ul {
        gap: 0.25rem;
        flex-wrap: wrap;
    }
    .nav a {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Compact copy-title buttons */
.copy-title-btn {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
    border-radius: 8px;
    margin: 0.25rem 0 0.5rem 0;
}

/* Media Info Footer */
.media-info-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.note, .image-note, .video-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.image-note {
    background: #e3f2fd;
    color: #1976d2;
    border-left: 4px solid #2196f3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .download-btn {
        width: 100%;
        justify-content: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .steps {
        grid-template-columns: 1fr;
    }
    
    .download-buttons {
        grid-template-columns: 1fr;
    }
    
    .video-player video {
        max-width: 100%;
    }
    
    .media-info-header {
        flex-direction: column;
        text-align: center;
    }
    
    .media-thumbnail-large {
        width: 80px;
        height: 80px;
        margin: 0 auto;
    }
    
    .image-info, .audio-info {
        flex-direction: column;
        text-align: center;
    }
    
    .image-actions, .audio-actions {
        flex-direction: row;
        justify-content: center;
        min-width: auto;
    }
    
    .image-preview {
        width: 100px;
        height: 100px;
        margin: 0 auto 1rem;
    }
    
    .preview-content {
        max-width: 95%;
        max-height: 95%;
    }
    
    .preview-header {
        padding: 10px 15px;
    }
    
    .preview-body {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 0.5rem;
        gap: 0.5rem;
    }
    
    .nav ul {
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .nav a {
        padding: 0.3rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .search-container {
        margin: 0;
    }
    
    .search-box {
        padding: 0.3rem 0.6rem;
    }
    
    .search-input {
        font-size: 0.7rem;
        padding: 0.3rem;
    }
    
    .search-btn {
        font-size: 0.75rem;
    }
    
    .avatar-circle {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
    }
    
    main {
        padding: 0.5rem;
    }
    
    .hero {
        padding: 1.5rem 0.5rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .platforms-showcase {
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .platform-item {
        min-width: 60px;
        padding: 0.5rem;
    }
    
    .platform-item i {
        font-size: 1.2rem;
    }
    
    .platform-item span {
        font-size: 0.7rem;
    }
    
    .download-form {
        padding: 1rem;
        margin: 0 0.5rem;
    }
    
    .url-input {
        padding: 0.5rem 1.5rem 0.5rem 0.5rem;
        font-size: 0.75rem;
        min-height: 28px;
    }
    
    .url-input-icon {
        right: 0.5rem;
        font-size: 0.8rem;
    }
    
    .download-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
        min-height: 28px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-header,
    .modal-body {
        padding: 1rem;
    }
}

/* Debug info styles */
.debug-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.debug-info h4, .debug-info h5 {
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.debug-info pre {
    background: #f1f3f4;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Image URL display */
.image-url, .audio-url {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 0.5rem;
    margin: 0.5rem 0;
}

.image-url span, .audio-url span {
    font-family: monospace;
    background: #e9ecef;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

/* Result Section */
.result-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 15px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 16px var(--shadow-color);
}

.result-section h3 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    text-align: center;
    font-size: 1.5rem;
}

/* Responsive cho input group */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }
    
    .search-container {
        margin: 0;
        width: 100%;
        order: 3;
    }
    
    .search-box {
        min-width: 100%;
        padding: 0.3rem 0.6rem;
    }
    
    .search-input {
        font-size: 0.75rem;
        padding: 0.3rem;
    }
    
    .search-btn {
        font-size: 0.8rem;
        padding: 0.2rem;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
        order: 2;
        gap: 0.5rem;
    }
    
    .avatar-circle {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .platforms-showcase {
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .platform-item {
        min-width: 70px;
        padding: 0.75rem;
    }
    
    .platform-item i {
        font-size: 1.5rem;
    }
    
    .platform-item span {
        font-size: 0.8rem;
    }
    
    .download-form {
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    .input-group {
        flex-direction: column;
        gap: 1rem;
    }

    .url-input {
        width: 100%;
        min-height: 32px;
        font-size: 0.8rem;
        padding: 0.5rem 2rem 0.5rem 0.6rem;
    }
    
    .url-input-icon {
        right: 0.6rem;
        font-size: 0.9rem;
    }

    .download-btn {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        justify-content: center;
        min-height: 32px;
        font-size: 0.75rem;
        padding: 0.5rem 0.8rem;
    }
}

/* Large Screen Responsive */
@media (min-width: 1024px) {
    .download-form {
        max-width: 900px;
        padding: 2.5rem;
    }
    
    .input-group {
        gap: 1.5rem;
    }
    
    .url-input {
        padding: 0.7rem 2.8rem 0.7rem 1rem;
        font-size: 0.9rem;
        min-height: 38px;
    }
    
    .url-input-icon {
        right: 1rem;
        font-size: 1.1rem;
    }
    
    .download-btn {
        padding: 0.6rem 1.4rem;
        font-size: 0.85rem;
        min-height: 36px;
        min-width: 120px;
        max-width: 160px;
    }
    
    .platforms-showcase {
        gap: 2rem;
        padding: 2.5rem;
    }
    
    .platform-item {
        min-width: 90px;
        padding: 1.2rem;
    }
    
    .platform-item i {
        font-size: 2.2rem;
    }
    
    .platform-item span {
        font-size: 1rem;
    }
}

/* Extra Large Screen Responsive */
@media (min-width: 1440px) {
    .download-form {
        max-width: 1000px;
        padding: 3rem;
    }
    
    .url-input {
        padding: 0.8rem 3rem 0.8rem 1.2rem;
        font-size: 0.95rem;
        min-height: 40px;
    }
    
    .download-btn {
        padding: 0.7rem 1.6rem;
        font-size: 0.9rem;
        min-height: 38px;
        min-width: 130px;
        max-width: 170px;
    }
}

/* Enhanced Download Button Effects */
.download-btn {
    position: relative;
    overflow: hidden;
    min-width: 150px;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    border: 2px solid transparent;
}

.download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.download-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.download-btn:hover::before {
    left: 100%;
}

.download-btn:hover::after {
    width: 300px;
    height: 300px;
}

.download-btn:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.4), 
                0 0 0 1px rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.download-btn:active {
    transform: translateY(-2px) scale(1.02);
    transition: all 0.1s ease;
}

.download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.download-btn:disabled::before,
.download-btn:disabled::after {
    display: none;
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    50% { left: -100%; }
    100% { left: 100%; }
}

/* Download Button Icon Animation */
.download-btn i {
    transition: transform 0.3s ease;
}

.download-btn:hover i {
    transform: translateY(-2px) rotate(5deg);
}

.download-btn:active i {
    transform: translateY(0) rotate(0deg);
}

/* Platform Detection */
.platform-detection {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    animation: slideDown 0.3s ease-out;
}

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

.detected-platform {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 500;
}

.platform-icon {
    font-size: 1.2rem;
}

.platform-name {
    font-size: 1rem;
}

/* Platform Badge */
.media-platform-header {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 25px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    font-weight: 500;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease-out;
}

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

.platform-badge i {
    font-size: 1.1rem;
}

/* Search Container */
.search-container {
    position: relative;
    margin: 0 1rem;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    min-width: 250px;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-color);
    font-size: 0.9rem;
    padding: 0.5rem;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.search-btn:hover {
    color: var(--primary-color);
    background: var(--bg-secondary);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--shadow-color);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    margin-top: 0.5rem;
}

.search-results.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.search-result-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-result-item:hover {
    background: var(--bg-secondary);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-icon {
    font-size: 1.5rem;
    width: 30px;
    text-align: center;
}

.search-result-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    color: var(--text-color);
}

.search-result-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* Search Container */
.search-container {
    position: relative;
    margin: 0 0.5rem;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.4rem 0.8rem;
    transition: all 0.3s ease;
    min-width: 200px;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-color);
    font-size: 0.8rem;
    padding: 0.4rem;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.search-btn:hover {
    color: var(--primary-color);
    background: var(--bg-secondary);
}

/* User Avatar */
.user-avatar {
    position: relative;
    cursor: pointer;
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.avatar-circle:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.avatar-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--shadow-color);
    z-index: 1000;
    min-width: 250px;
    display: none;
    margin-top: 0.5rem;
    animation: slideDown 0.3s ease-out;
}

.avatar-menu.show {
    display: block;
}

.avatar-menu-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar-large {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.user-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    color: var(--text-color);
}

.user-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.avatar-menu-actions {
    padding: 0.5rem 0;
}

.menu-action {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    color: var(--text-color);
    text-align: left;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.menu-action:hover {
    background: var(--bg-secondary);
}

.menu-action i {
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

/* Responsive cho các nút trong kết quả */
.download-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.download-option {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.download-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px var(--shadow-color);
}

.download-option h4 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1.1rem;
}

.download-option p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Enhanced Small Download Buttons */
.btn-primary, .btn-secondary, .btn-info {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.3rem;
    min-width: 90px;
    justify-content: center;
    min-height: 32px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-primary:active {
    transform: translateY(-1px) scale(1.02);
    transition: all 0.1s ease;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
    transition: left 0.5s ease;
}

.btn-secondary:hover::before {
    left: 100%;
}

.btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.btn-secondary:active {
    transform: translateY(-1px) scale(1.01);
    transition: all 0.1s ease;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8, #20c997);
    color: white;
    box-shadow: 0 3px 10px rgba(23, 162, 184, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-info:hover::before {
    left: 100%;
}

.btn-info:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(23, 162, 184, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-info:active {
    transform: translateY(-1px) scale(1.02);
    transition: all 0.1s ease;
}

/* Button Icon Animations */
.btn-primary i, .btn-secondary i, .btn-info i {
    transition: transform 0.3s ease;
}

.btn-primary:hover i, .btn-secondary:hover i, .btn-info:hover i {
    transform: translateY(-1px) rotate(5deg);
}

.btn-primary:active i, .btn-secondary:active i, .btn-info:active i {
    transform: translateY(0) rotate(0deg);
}

/* Copy Button Styles */
.copy-btn {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0.2rem;
    min-width: 40px;
    justify-content: center;
    min-height: 28px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.copy-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.copy-btn:hover::before {
    left: 100%;
}

.copy-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.copy-btn:active {
    transform: translateY(-1px) scale(1.02);
    transition: all 0.1s ease;
}

.copy-btn i {
    transition: transform 0.3s ease;
}

.copy-btn:hover i {
    transform: translateY(-1px) rotate(10deg);
}

.copy-btn:active i {
    transform: translateY(0) rotate(0deg);
}

/* Download Button Small */
.download-btn-small {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0.2rem;
    min-width: 80px;
    justify-content: center;
    min-height: 28px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.download-btn-small::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.download-btn-small:hover::before {
    left: 100%;
}

.download-btn-small:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.download-btn-small:active {
    transform: translateY(-1px) scale(1.02);
    transition: all 0.1s ease;
}

.download-btn-small i {
    transition: transform 0.3s ease;
}

.download-btn-small:hover i {
    transform: translateY(-1px) rotate(-5deg);
}

.download-btn-small:active i {
    transform: translateY(0) rotate(0deg);
}

/* Button Loading State */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: button-spin 1s linear infinite;
}

@keyframes button-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive cho download buttons */
@media (max-width: 768px) {
    .download-buttons {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .download-option {
        padding: 1rem;
    }
    
    .btn-primary, .btn-secondary, .btn-info {
        width: 100%;
        margin: 0.15rem 0;
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
        min-height: 30px;
    }
    
    .download-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        min-height: 36px;
    }
    
    .copy-btn, .download-btn-small {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
        min-height: 26px;
        min-width: 70px;
    }
}

@media (max-width: 480px) {
    .download-option {
        padding: 0.8rem;
    }
    
    .download-option h4 {
        font-size: 1rem;
    }
    
    .download-option p {
        font-size: 0.8rem;
    }
    
    .btn-primary, .btn-secondary, .btn-info {
        padding: 0.3rem 0.5rem;
        font-size: 0.65rem;
        min-width: 70px;
        min-height: 24px;
    }
}

/* Video Controls Overlay */
.video-controls-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-player:hover .video-controls-overlay {
    opacity: 1;
}

.video-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.progress-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 0.1s ease;
}

.time-display {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-control .control-btn {
    width: 35px;
    height: 35px;
    padding: 0.4rem;
}

#volumeSlider {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

#volumeSlider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: white;
}

#volumeSlider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

#volumeSlider::-moz-range-thumb:hover {
    transform: scale(1.2);
    background: white;
}

/* Video Error Styles */
.video-error {
    text-align: center;
    padding: 2rem;
    background: var(--bg-color);
    border-radius: 12px;
    border: 2px dashed var(--border-color);
}

.video-error i {
    font-size: 3rem;
    color: var(--warning-color);
    margin-bottom: 1rem;
}

.video-error ul {
    text-align: left;
    max-width: 400px;
    margin: 1rem auto;
}

.video-error li {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

/* Video Status */
.video-status {
    font-weight: 500;
    color: var(--primary-color);
}

/* Responsive Video Controls */
@media (max-width: 768px) {
    .video-controls {
        gap: 0.5rem;
    }
    
    .control-btn {
        width: 35px;
        height: 35px;
        padding: 0.4rem;
    }
    
    .volume-control .control-btn {
        width: 32px;
        height: 32px;
        padding: 0.3rem;
    }
    
    #volumeSlider {
        width: 50px;
    }
    
    .time-display {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .video-controls-overlay {
        padding: 0.5rem;
    }
    
    .video-controls {
        gap: 0.3rem;
    }
    
    .control-btn {
        width: 30px;
        height: 30px;
        padding: 0.3rem;
    }
    
    .volume-control .control-btn {
        width: 28px;
        height: 28px;
        padding: 0.2rem;
    }
    
    #volumeSlider {
        width: 40px;
    }
    
    .time-display {
        font-size: 0.7rem;
    }
}

/* Audio Preview Styles */
.audio-preview {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin: 1rem 0;
}

/* Audio Player Container */
.audio-player-container {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.audio-player {
    width: 100%;
    height: 50px;
    border-radius: 8px;
    outline: none;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.audio-player:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.audio-player:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Audio Player Info */
.audio-player-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
}

.audio-quality-info {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.quality-badge, .format-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.quality-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.format-badge {
    background: var(--bg-secondary);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

/* Custom Audio Player Styles */
.audio-player::-webkit-media-controls-panel {
    background-color: var(--card-bg);
    border-radius: 8px;
}

.audio-player::-webkit-media-controls-play-button,
.audio-player::-webkit-media-controls-pause-button {
    background-color: var(--primary-color);
    border-radius: 50%;
}

.audio-player::-webkit-media-controls-timeline {
    background-color: var(--bg-secondary);
    border-radius: 4px;
}

.audio-player::-webkit-media-controls-current-time-display,
.audio-player::-webkit-media-controls-time-remaining-display {
    color: var(--text-color);
    font-weight: 500;
}

.audio-player::-webkit-media-controls-volume-slider {
    background-color: var(--bg-secondary);
    border-radius: 4px;
}

.audio-player::-webkit-media-controls-mute-button {
    background-color: var(--text-secondary);
    border-radius: 50%;
}

.audio-thumbnail {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.audio-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.audio-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.audio-info {
    flex: 1;
    min-width: 0;
}

.audio-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.3;
    word-wrap: break-word;
}

.audio-info .author {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.audio-info .duration {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Media Type Badge for Audio */
.media-type-badge.audio {
    background: linear-gradient(135deg, #FF5500, #FF8A00);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.media-type-badge.audio i {
    font-size: 0.9rem;
}

/* Responsive Audio Preview */
@media (max-width: 768px) {
    .audio-preview {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1rem;
    }
    
    .audio-thumbnail {
        width: 100px;
        height: 100px;
    }
    
    .audio-icon {
        font-size: 2rem;
    }
    
    .audio-info h3 {
        font-size: 1.3rem;
    }
    
    .audio-info .author {
        font-size: 0.9rem;
    }
    
    .audio-info .duration {
        font-size: 0.8rem;
    }
    
    .audio-player-container {
        padding: 0.8rem;
    }
    
    .audio-player {
        height: 45px;
    }
    
    .audio-player-info {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .quality-badge, .format-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

@media (max-width: 480px) {
    .audio-preview {
        padding: 0.8rem;
    }
    
    .audio-thumbnail {
        width: 80px;
        height: 80px;
    }
    
    .audio-icon {
        font-size: 1.5rem;
    }
    
    .audio-info h3 {
        font-size: 1.1rem;
    }
    
    .audio-info .author {
        font-size: 0.8rem;
    }
    
    .audio-info .duration {
        font-size: 0.75rem;
    }
}

