/**
 * Base Styles
 * -----------
 * Core styles and CSS reset
 */

:root {
    /* Colors - Facebook Theme */
    --color-primary: #1877f2;
    --color-secondary: #42a5f5;
    --color-text: #333;
    --color-text-light: #666;
    --color-background: #f8f9fa;
    --color-white: #fff;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.4;
    color: var(--color-text);
    background-color: var(--color-background);
}

.container {
    max-width: 1000px;
    width: 95%;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

/* Header */
.header {
    text-align: left;
    padding: var(--spacing-xs) 0;
}

.header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-xs);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0;
}

.tagline {
    color: var(--color-text-light);
    font-size: 0.85rem;
    text-align: right;
    flex: 1;
}

/* Main Section */
.main-section {
    background: var(--color-white);
    border-radius: 16px;
    padding: 25px 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    text-align: center;
}

.main-title {
    font-size: 2.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--color-text);
}

.main-description {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin-bottom: 20px;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.3;
}

.download-form {
    display: inline-flex;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.url-input {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px 0 0 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
}

.url-input:focus {
    border-color: var(--color-primary);
}

.download-btn {
    background: var(--gradient-primary);
    color: var(--color-white);
    border: none;
    width: 30%;
    border-radius: 0 12px 12px 0;
    font-size: 1.1rem;
    font-weight: 400;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.download-result-btn {
    background: var(--gradient-primary);
    color: var(--color-white);
    border: none;
    width: 30%;
    font-size: 1.1rem;
    font-weight: 400;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(24, 119, 242, 0.3);
}

.features {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.feature {
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.feature::before {
    content: "✓";
    color: #4caf50;
    margin-right: 8px;
    font-weight: bold;
}

/* More Downloaders Section */
.more-downloaders {
    padding: 40px 0;
    text-align: center;
}

.section-title {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--color-text);
}

.section-description {
    font-size: 1rem;
    color: var(--color-text-light);
    margin-bottom: 30px;
}

.downloaders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.downloader-card {
    background: var(--color-white);
    border-radius: 12px;
    padding: 25px 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    transition: transform 0.3s, box-shadow 0.3s;
}

.downloader-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.downloader-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.facebook-icon {
    background: var(--gradient-primary);
}

.instagram-icon {
    background: linear-gradient(135deg, #e91e63, #9c27b0);
}

.youtube-icon {
    background: linear-gradient(135deg, #ff0000, #ff5722);
}

.tiktok-icon {
    background: linear-gradient(135deg, #000000, #ff0050);
}

.downloader-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--color-text);
}

.downloader-description {
    color: var(--color-text-light);
    margin-bottom: 20px;
}

.coming-soon {
    background: #f5f5f5;
    color: #999;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: inline-block;
}

.available-now {
    background: var(--gradient-primary);
    color: var(--color-white);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: inline-block;
    text-decoration: none;
    transition: transform 0.2s;
}

.available-now:hover {
    transform: translateY(-2px);
}

/* How To Section */
.how-to-section {
    background: var(--color-white);
    border-radius: 16px;
    padding: 40px 25px;
    margin: 30px 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.step {
    text-align: center;
}

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

.step-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--color-text);
}

.step-description {
    color: var(--color-text-light);
    line-height: 1.6;
}

/* FAQ Section */
.faq-section {
    padding: 40px 0;
    text-align: center;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
    text-align: left;
}

.faq-item {
    background: var(--color-white);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}

.faq-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 15px;
}

.faq-answer {
    color: var(--color-text-light);
    line-height: 1.6;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0;
    color: var(--color-text-light);
    border-top: 1px solid #e0e0e0;
    margin-top: 80px;
}

/* Result Container */
.result-container {
    margin-top: 30px;
}

.result-card {
    background: var(--color-white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    max-width: 500px;
    margin: 0 auto;
}

.thumbnail-container {
    position: relative;
    margin-bottom: 15px;
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.result-thumbnail {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--color-white);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    z-index: 2;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    z-index: 2;
}

.play-button:hover {
    background: rgba(0, 0, 0, 0.9);
}

.play-button svg {
    width: 30px;
    height: 30px;
    margin-left: 4px;
}

.thumbnail-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}

.thumbnail-container:hover::after {
    opacity: 1;
}

.result-title {
    font-size: 1.1rem;
    color: var(--color-text);
    margin-bottom: 15px;
    word-break: break-word;
}

.error-message {
    color: var(--color-primary);
    text-align: center;
    padding: 20px;
}

/* Loading Animation */
@keyframes loading-bar {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.loading-bar {
    width: 50%;
    height: 4px;
    margin: 0 auto 0;
    background: linear-gradient(90deg, #2196f3 25%, #d64ebd 50%, #2196f3 75%);
    background-size: 200% 100%;
    animation: loading-bar 1.5s infinite linear;
    border-radius: 2px;
    display: block;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        width: 90%;
    }
    
    .downloaders-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .header-flex {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .tagline {
        text-align: center;
    }

    .main-title {
        font-size: 2.2rem;
    }

    .main-description {
        font-size: 1.1rem;
        padding: 0 1rem;
    }

    .features {
        flex-direction: column;
        gap: 15px;
    }

    .download-form {
        flex-direction: column;
        gap: 1rem;
    }

    .url-input {
        border-radius: 12px;
        width: 100%;
    }

    .download-btn {
        width: 100%;
        padding: 1rem;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .main-description {
        font-size: 1rem;
    }

    .downloader-card {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 320px) {
    .container {
        width: 100%;
        padding: 0 10px;
    }

    .main-title {
        font-size: 1.5rem;
    }

    .logo {
        font-size: 2rem;
    }

    .tagline {
        font-size: 1rem;
    }
}
