/* 2026 TikTok Downloader Theme */
:root {
    --primary: #8B5CF6;
    --primary-dark: #7C3AED;
    --secondary: #10B981;
    --secondary-dark: #059669;
    --accent: #F59E0B;
    --accent-dark: #D97706;
    --background: #0F172A;
    --surface: #1E293B;
    --surface-light: #334155;
    --text: #F1F5F9;
    --text-muted: #94A3B8;
    --error: #EF4444;
    --success: #10B981;
    --warning: #F59E0B;
    --info: #3B82F6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background: linear-gradient(135deg, var(--background) 0%, #0D1B2A 100%);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Header */
header {
    background: rgba(30, 41, 59, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1.2rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--primary);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--text);
}

.logo i {
    color: var(--primary);
    font-size: 2rem;
}

.logo span {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.6rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s;
}

.menu-toggle:hover {
    background: rgba(139, 92, 246, 0.1);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1rem;
}

.nav-menu li a {
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    transition: all 0.3s;
    font-weight: 500;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.nav-menu li a:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Mobile Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100%;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 2rem 1.5rem;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1100;
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.5);
    border-right: 2px solid var(--primary);
}

.sidebar.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--surface-light);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s;
}

.close-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 1rem;
}

.sidebar-menu li a {
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    transition: all 0.3s;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.sidebar-menu li a:hover {
    background: var(--primary);
    transform: translateX(5px);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1050;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

/* Ad Banners */
.ad-container {
    margin: 2rem auto;
    padding: 1.5rem;
    text-align: center;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    overflow: hidden;
}

.ad-container iframe {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    background: white;
}

.ad-container:hover {
    border-color: var(--secondary);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.2);
}

/* Backup Ad Styles */
.backup-ad {
    width: 100%;
    max-width: 728px;
}

.ad-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 25px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
    max-width: 728px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.ad-banner:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
    text-decoration: none;
}

.ad-banner::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.7s;
}

.ad-banner:hover::before {
    left: 100%;
}

.ad-banner i {
    font-size: 24px;
    margin-right: 15px;
    color: white;
}

.ad-content {
    text-align: left;
    flex: 1;
}

.ad-content strong {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.ad-content small {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: normal;
    color: rgba(255, 255, 255, 0.9);
}

.ad-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-left: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 3rem 2rem;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 24px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    animation: fadeIn 0.8s ease-out;
    position: relative;
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientShift 3s infinite alternate;
    background-size: 200% auto;
}

.year-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 1rem;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 1rem auto;
    line-height: 1.6;
}

/* Download Section */
.download-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 3rem;
    margin-bottom: 3rem;
    border: 2px solid rgba(139, 92, 246, 0.4);
    box-shadow: 0 20px 40px rgba(139, 92, 246, 0.1);
    animation: slideUp 0.6s ease-out;
}

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

.card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
    color: var(--text);
    font-size: 1.8rem;
}

.card-title i {
    color: var(--primary);
}

.api-info {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--secondary);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    color: var(--text);
    animation: fadeIn 0.8s ease-out 0.2s both;
}

.api-info p {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Input Group */
.input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 2rem;
}

.url-input {
    flex: 1;
    padding: 1.2rem 1.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--surface-light);
    border-radius: 16px;
    color: var(--text);
    font-size: 1.1rem;
    transition: all 0.3s;
}

.url-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
    background: rgba(139, 92, 246, 0.05);
}

.download-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 1.2rem 2.5rem;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.3);
}

.download-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.download-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.download-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* URL Examples */
.url-examples {
    background: rgba(30, 41, 59, 0.6);
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1rem 0;
    border: 1px solid rgba(139, 92, 246, 0.2);
    animation: fadeIn 0.6s ease-out;
}

.url-examples h4 {
    margin-bottom: 0.8rem;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.example-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.example-btn {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.example-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    color: var(--text);
    transform: translateY(-2px);
}

/* Video Preview */
.result-container {
    margin-top: 2rem;
    display: none;
}

.result-container.active {
    display: block;
    animation: fadeIn 0.5s;
}

.video-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    margin-bottom: 2rem;
    padding: 2rem;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 16px;
    align-items: center;
    border: 1px solid rgba(139, 92, 246, 0.2);
    animation: fadeIn 0.6s ease-out;
}

.video-thumbnail {
    width: 180px;
    height: 320px;
    border-radius: 16px;
    object-fit: cover;
    border: 3px solid var(--primary);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s;
}

.video-thumbnail:hover {
    transform: scale(1.02);
    border-color: var(--secondary);
}

.video-details {
    flex: 1;
    min-width: 300px;
}

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

.video-details p {
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.video-details i {
    color: var(--secondary);
    width: 20px;
}

.download-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeIn 0.6s ease-out 0.2s both;
}

.download-option {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 1rem 2rem;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.3);
    border: none;
    cursor: pointer;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
}

.download-option:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.download-option.audio {
    background: linear-gradient(135deg, var(--accent), #F97316);
}

.download-option.audio:hover {
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.loading.active {
    display: block;
    animation: fadeIn 0.3s;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 0.8rem;
}

.loading p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

/* Messages */
.message {
    padding: 1rem;
    border-radius: 12px;
    margin: 1rem 0;
    display: none;
    border-left: 4px solid;
    font-size: 0.9rem;
    animation: slideInLeft 0.3s ease-out;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.message.active {
    display: block;
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border-left-color: var(--error);
}

.message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border-left-color: var(--success);
}

/* Steps Section */
.steps-section {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 3rem;
    border: 2px solid rgba(16, 185, 129, 0.4);
    animation: fadeIn 0.8s ease-out 0.4s both;
}

.steps-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2.5rem;
    color: var(--text);
    font-size: 1.8rem;
}

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

.step-card {
    padding: 2rem;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 16px;
    transition: all 0.3s;
    border: 1px solid rgba(139, 92, 246, 0.2);
    animation: fadeInUp 0.6s ease-out;
}

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

.step-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 15px 30px rgba(139, 92, 246, 0.2);
}

.step-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: white;
    font-size: 1.8rem;
}

.step-card h3 {
    margin-bottom: 1rem;
    color: var(--text);
}

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

/* Footer */
footer {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(139, 92, 246, 0.2);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fadeIn 0.8s ease-out;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    background: rgba(139, 92, 246, 0.1);
}

.footer-links a:hover {
    color: var(--secondary);
    background: rgba(16, 185, 129, 0.1);
}

/* Download Progress */
.progress-container {
    display: none;
    margin: 1rem 0;
}

.progress-container.active {
    display: block;
    animation: fadeIn 0.3s;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.3s;
    border-radius: 4px;
    animation: progressPulse 1.5s infinite;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

.modal-content {
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    border: 2px solid var(--primary);
    animation: slideUp 0.4s ease-out;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal h2 {
    color: var(--text);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.modal button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
    }

    header {
        padding: 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .download-card, .steps-section {
        padding: 2rem;
    }

    .input-group {
        flex-direction: column;
    }

    .url-input, .download-btn {
        width: 100%;
    }

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

    .video-preview {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }

    .video-thumbnail {
        width: 100%;
        max-width: 250px;
        height: auto;
        max-height: 400px;
    }
    
    .ad-container {
        padding: 1rem;
        min-height: 70px;
    }
    
    .ad-container iframe {
        max-width: 100%;
        height: auto;
    }
    
    .backup-ad .ad-banner {
        padding: 12px 20px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .backup-ad .ad-banner i {
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .backup-ad .ad-content {
        text-align: center;
    }
    
    .download-options {
        flex-direction: column;
        gap: 15px;
    }
    
    .download-option {
        width: 100%;
        justify-content: center;
    }
}

/* Extra Small Devices */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .card-title {
        font-size: 1.5rem;
    }
    
    .step-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .ad-content strong {
        font-size: 1rem;
    }
    
    .ad-content small {
        font-size: 0.75rem;
    }
}

/* Placeholder color */
.url-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}