* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --facebook-color: #1877f2;
    --youtube-color: #ff0000;
    --instagram-color: #e4405f;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-white: #ffffff;
    --bg-gray: #f9fafb;
    --bg-light: #f3f4f6;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-gray);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(37, 99, 235, 0.95);
    box-shadow: var(--shadow-xl);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: white;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    border-radius: 3px;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 0 6rem;
    position: relative;
    overflow: hidden;
}

.wave-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.wave {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 80px;
    color: var(--bg-gray);
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.95;
    margin-bottom: 2.5rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Hero Stats */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.platform-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.platform-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.platform-btn svg {
    width: 24px;
    height: 24px;
}

.platform-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.platform-btn.active {
    background: white;
    color: var(--primary-color);
    border-color: white;
    transform: translateY(-2px);
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
    color: white;
}

.preloader-content .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
    display: block;
}

.preloader-content p {
    font-size: 1.125rem;
    font-weight: 500;
}

/* Features Showcase */
.features-showcase {
    background: white;
    border-radius: 1rem;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: 0.75rem;
    background: var(--bg-light);
    transition: var(--transition);
    border: 2px solid transparent;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
    background: white;
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: var(--transition);
}

.feature-card:hover .feature-icon {
    transform: rotate(5deg) scale(1.1);
}

.feature-icon svg {
    width: 32px;
    height: 32px;
}

.feature-card h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.feature-card p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-xl);
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid var(--primary-color);
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--error-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error .toast-icon {
    color: var(--error-color);
}

.toast.warning .toast-icon {
    color: var(--warning-color);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-light);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-dark);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.removing {
    animation: slideOut 0.3s ease-out forwards;
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-light);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* Main Content */
.main-wrapper {
    padding: 3rem 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

.main-content {
    min-height: 500px;
}

/* Downloader Sections */
.downloader-section {
    display: none;
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease-out;
}

.downloader-section.active {
    display: block;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.platform-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    color: white;
}

.platform-icon svg {
    width: 32px;
    height: 32px;
}

.facebook-icon {
    background: var(--facebook-color);
}

.youtube-icon {
    background: var(--youtube-color);
}

.instagram-icon {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.section-title {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.section-description {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Input Group */
.input-group {
    margin-bottom: 1.5rem;
}

.video-url-input {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.video-url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.video-url-input::placeholder {
    color: var(--text-light);
}

/* Download Buttons */
.download-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.download-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.download-btn:hover::before {
    width: 300px;
    height: 300px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.download-btn:active {
    transform: translateY(0);
}

.facebook-btn {
    background: linear-gradient(135deg, var(--facebook-color) 0%, #0c63d4 100%);
}

.youtube-btn {
    background: linear-gradient(135deg, var(--youtube-color) 0%, #cc0000 100%);
}

.instagram-btn {
    background: linear-gradient(135deg, #f09433 0%, #dc2743 50%, #bc1888 100%);
}

.btn-icon {
    width: 24px;
    height: 24px;
    position: relative;
    z-index: 1;
}

.btn-text {
    position: relative;
    z-index: 1;
}

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.download-btn.loading .btn-icon,
.download-btn.loading .btn-text {
    display: none;
}

.download-btn.loading .spinner {
    display: block;
}

/* Result Container */
.result-container {
    margin-top: 1.5rem;
    display: none;
}

.result-container.show {
    display: block;
    animation: fadeInUp 0.5s ease-out;
}

.result-card {
    background: var(--bg-light);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
}

.video-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.video-thumbnail {
    width: 200px;
    height: 112px;
    object-fit: cover;
    border-radius: 0.5rem;
}

.video-details h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.video-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.quality-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.quality-btn {
    padding: 0.75rem 1rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quality-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.quality-label {
    font-weight: 600;
}

.quality-size {
    font-size: 0.85rem;
    color: var(--text-light);
}

.error-message {
    background: #fee2e2;
    color: var(--error-color);
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    border-left: 4px solid var(--error-color);
}

.success-message {
    background: #d1fae5;
    color: var(--success-color);
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    border-left: 4px solid var(--success-color);
}

/* Tools Section */
.tools-section {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.tool-card {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 0.75rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.tool-icon {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.tool-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.tool-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Sidebar & Ads */
.sidebar {
    position: relative;
}

.ad-block {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.sidebar-ad.sticky {
    position: sticky;
    top: 100px;
}

.ad-placeholder {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 0.5rem;
    text-align: center;
    color: var(--text-light);
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.ad-placeholder p {
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.bottom-ad {
    margin-top: 2rem;
}

.bottom-ad .ad-placeholder {
    min-height: 120px;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--text-dark) 0%, #111827 100%);
    color: rgba(255, 255, 255, 0.8);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
    position: relative;
}

.footer-wave {
    top: 0;
    bottom: auto;
    transform: rotate(180deg);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
}

.footer-heading {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    margin-bottom: 1rem;
}

.footer-text {
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.footer-text.small {
    font-size: 0.85rem;
    opacity: 0.7;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
}

.footer-bottom p {
    margin-bottom: 0.5rem;
}

.google-compliance {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 968px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: -1;
    }
    
    .sidebar-ad.sticky {
        position: relative;
        top: 0;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-dark);
        flex-direction: column;
        padding: 1rem;
        gap: 0;
        box-shadow: var(--shadow-lg);
        animation: slideDown 0.3s ease-out;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-stats {
        gap: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .platform-selector {
        flex-direction: column;
    }
    
    .platform-btn {
        width: 100%;
        justify-content: center;
    }
    
    .section-header {
        flex-direction: column;
        text-align: center;
    }
    
    .video-info {
        flex-direction: column;
    }
    
    .video-thumbnail {
        width: 100%;
        height: auto;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .feature-card {
        padding: 1.5rem 1rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .toast-container {
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .download-btn {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }
    
    .quality-options {
        grid-template-columns: 1fr;
    }
}
