/* Clipdow - Modern Video Downloader Styles */
/* Inspired by xe.com clean design */

:root {
    --primary-color: #00D4AA;
    --primary-dark: #00B894;
    --secondary-color: #2D3436;
    --accent-color: #6C5CE7;
    --background-light: #F8FFFE;
    --background-dark: #1A1A2E;
    --text-primary: #2D3436;
    --text-secondary: #636E72;
    --text-light: #B2BEC3;
    --white: #FFFFFF;
    --border-color: #DFE6E9;
    --success-color: #00B894;
    --error-color: #D63031;
    --warning-color: #FDCB6E;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background-light);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }

p {
    color: var(--text-secondary);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header,
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.header-content,
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.navbar .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.navbar .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1rem;
}

.navbar .mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    order: 3;
}

.navbar .nav-links {
    display: flex;
    gap: 25px;
    list-style: none;
}

.navbar .nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 0;
    position: relative;
}

.navbar .nav-links a:hover {
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .navbar .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
    }
    
    .navbar .nav-links.show {
        display: flex;
    }
    
    .navbar .mobile-menu-btn {
        display: block;
        margin-left: auto;
    }
    
    .navbar .container {
        position: relative;
    }
}

/* Ensure navbar container has proper flex layout */
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.25rem;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
}

/* Hero Section */
.hero {
    background: linear-gradient(180deg, var(--white) 0%, var(--background-light) 100%);
    padding: 60px 0 80px;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Search Box */
.search-container {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 8px;
    box-shadow: var(--shadow-xl);
    max-width: 700px;
    margin: 0 auto;
    border: 2px solid transparent;
    transition: var(--transition);
}

.search-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-xl), 0 0 0 4px rgba(0, 212, 170, 0.1);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 15px;
}

.search-input-wrapper i {
    color: var(--text-light);
    font-size: 1.25rem;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.1rem;
    padding: 15px 0;
    background: transparent;
    color: var(--text-primary);
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    border: none;
    padding: 15px 35px;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 170, 0.4);
}

.search-btn:active {
    transform: translateY(0);
}

.search-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.search-btn .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.search-btn.loading .spinner {
    display: block;
}

.search-btn.loading .btn-text {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Platform Detection Badge */
.platform-badge {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--background-light);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 15px;
    justify-content: center;
}

.platform-badge.show {
    display: inline-flex;
}

.platform-badge i {
    font-size: 1.1rem;
}

.platform-badge.valid {
    color: var(--success-color);
    background: rgba(0, 184, 148, 0.1);
}

.platform-badge.invalid {
    color: var(--error-color);
    background: rgba(214, 48, 49, 0.1);
}

/* Supported Platforms */
.platforms-hint {
    margin-top: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.platforms-hint span {
    color: var(--text-light);
    font-size: 0.9rem;
}

.platform-icons {
    display: flex;
    gap: 15px;
}

.platform-icons i {
    font-size: 1.5rem;
    color: var(--text-light);
    transition: var(--transition);
    cursor: pointer;
}

.platform-icons i:hover {
    transform: scale(1.2);
}

.platform-icons .fa-tiktok:hover { color: #000000; }
.platform-icons .fa-youtube:hover { color: #FF0000; }
.platform-icons .fa-facebook:hover { color: #1877F2; }
.platform-icons .fa-instagram:hover { color: #E4405F; }
.platform-icons .fa-twitter:hover { color: #1DA1F2; }

/* Results Section */
.results-section {
    padding: 40px 0;
    display: none;
}

.results-section.show {
    display: block;
}

.result-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    display: flex;
    gap: 20px;
    padding: 25px;
    border-bottom: 1px solid var(--border-color);
}

.result-thumbnail {
    width: 180px;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--background-light);
}

.result-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-info h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.result-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.result-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.result-meta i {
    color: var(--primary-color);
}

/* Download Options */
.download-options {
    padding: 25px;
}

.download-options h4 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.format-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.format-tab {
    padding: 10px 25px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--white);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.format-tab:hover {
    border-color: var(--primary-color);
}

.format-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.download-list {
    display: grid;
    gap: 10px;
}

.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: var(--background-light);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.download-item:hover {
    background: rgba(0, 212, 170, 0.1);
}

.download-item-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quality-badge {
    padding: 5px 12px;
    background: var(--white);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.download-item-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.download-btn {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.download-btn:hover {
    background: var(--primary-dark);
    transform: translateX(3px);
}

/* Features Section */
.features {
    padding: 80px 0;
    background: var(--white);
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    margin-bottom: 15px;
}

.section-header p {
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-card {
    padding: 30px;
    background: var(--background-light);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.75rem;
    color: var(--white);
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 0.95rem;
}

/* How It Works */
.how-it-works {
    padding: 80px 0;
    background: linear-gradient(180deg, var(--background-light) 0%, var(--white) 100%);
}

.steps-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 50px;
}

.step {
    text-align: center;
    max-width: 280px;
    position: relative;
}

.step-number {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    margin: 0 auto 20px;
}

.step h3 {
    margin-bottom: 10px;
}

.step-arrow {
    position: absolute;
    right: -50px;
    top: 30px;
    color: var(--text-light);
    font-size: 1.5rem;
}

/* Platforms Section */
.platforms-section {
    padding: 80px 0;
    background: var(--white);
}

.platforms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.platform-card {
    padding: 30px 20px;
    background: var(--background-light);
    border-radius: var(--radius-md);
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.platform-card:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.platform-card i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: block;
}

.platform-card span {
    font-weight: 600;
    font-size: 0.95rem;
}

.platform-card.tiktok i { color: #000000; }
.platform-card.youtube i { color: #FF0000; }
.platform-card.facebook i { color: #1877F2; }
.platform-card.instagram i { color: #E4405F; }
.platform-card.twitter i { color: #1DA1F2; }
.platform-card.vimeo i { color: #1AB7EA; }
.platform-card.pinterest i { color: #BD081C; }
.platform-card.linkedin i { color: #0A66C2; }
.platform-card.reddit i { color: #FF4500; }
.platform-card.twitch i { color: #9146FF; }

/* Ad Containers */
.ad-container {
    padding: 20px;
    text-align: center;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-light);
    border-radius: var(--radius-md);
    margin: 20px 0;
}

.ad-container.header-ad {
    margin: 0;
    border-radius: 0;
}

.ad-placeholder {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* FAQ Section */
.faq-section {
    padding: 80px 0;
    background: var(--background-light);
}

.faq-list {
    max-width: 700px;
    margin: 40px auto 0;
}

.faq-item {
    background: var(--white);
    border-radius: var(--radius-md);
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.faq-question {
    width: 100%;
    padding: 20px 25px;
    background: none;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    color: var(--primary-color);
}

.faq-question i {
    transition: var(--transition);
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding: 0 25px 20px;
    font-size: 0.95rem;
}

/* Footer */
.footer {
    background: var(--secondary-color);
    color: var(--white);
    padding: 60px 0 30px;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .logo {
    color: var(--white);
    margin-bottom: 15px;
}

.footer-brand p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.footer-links h4,
.footer-section h4 {
    color: var(--white);
    margin-bottom: 20px;
    font-size: 1rem;
}

.footer-links ul,
.footer-section ul {
    list-style: none;
}

.footer-links li,
.footer-section li {
    margin-bottom: 10px;
}

.footer-links a,
.footer-section a {
    color: var(--text-light);
    font-size: 0.9rem;
}

.footer-links a:hover,
.footer-section a:hover {
    color: var(--primary-color);
}

.footer-section p {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.6;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
}

.toast {
    background: var(--white);
    padding: 15px 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    animation: slideIn 0.3s ease;
    max-width: 350px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success { border-left: 4px solid var(--success-color); }
.toast.error { border-left: 4px solid var(--error-color); }
.toast.warning { border-left: 4px solid var(--warning-color); }

.toast i {
    font-size: 1.25rem;
}

.toast.success i { color: var(--success-color); }
.toast.error i { color: var(--error-color); }
.toast.warning i { color: var(--warning-color); }

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    flex-direction: column;
    gap: 20px;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 992px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        gap: 0;
        box-shadow: var(--shadow-md);
    }

    .nav-links.show {
        display: flex;
    }

    .nav-links li {
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links a {
        display: block;
        padding: 15px 0;
    }

    .mobile-menu-btn {
        display: block;
    }

    .step-arrow {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 40px 0 60px;
    }

    .search-box {
        flex-direction: column;
    }

    .search-input-wrapper {
        width: 100%;
        padding: 0 10px;
    }

    .search-btn {
        width: 100%;
        justify-content: center;
        margin-top: 5px;
    }

    .result-header {
        flex-direction: column;
    }

    .result-thumbnail {
        width: 100%;
        height: 180px;
    }

    .format-tabs {
        flex-wrap: wrap;
    }

    .download-item {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .download-item-info {
        flex-direction: column;
    }

    .platforms-hint {
        flex-direction: column;
        gap: 15px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .steps-container {
        flex-direction: column;
        align-items: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }

    .toast-container {
        left: 20px;
        right: 20px;
        bottom: 20px;
    }

    .toast {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .search-container {
        padding: 5px;
    }

    .search-input {
        font-size: 1rem;
        padding: 12px 0;
    }

    .search-btn {
        padding: 12px 25px;
    }

    .feature-card {
        padding: 25px 20px;
    }

    .platforms-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --background-light: #1A1A2E;
        --background-dark: #0F0F1A;
        --text-primary: #FFFFFF;
        --text-secondary: #B2BEC3;
        --white: #16213E;
        --border-color: #2D3748;
    }

    .header {
        background: rgba(22, 33, 62, 0.95);
    }

    .search-container {
        background: #16213E;
    }

    .result-card,
    .feature-card,
    .faq-item,
    .platform-card {
        background: #16213E;
    }

    .download-item {
        background: rgba(255, 255, 255, 0.05);
    }

    .quality-badge {
        background: #1A1A2E;
        border-color: #2D3748;
    }

    .toast {
        background: #16213E;
    }

    .loading-overlay {
        background: rgba(26, 26, 46, 0.95);
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .ad-container,
    .search-container {
        display: none;
    }
}
