/* Header Styles */
.site-header {
    background-color: #1877f2;
    padding: 15px 0;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    text-decoration: none;
}

.language-switcher select {
    background-color: #fff;
    color: #1877f2;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #fff;
    margin: 0;
}

.main-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 50px;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
}

.container {
    background-color: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 90%;
    max-width: 550px;
}

h1 {
    color: #1c1e21;
    margin-bottom: 15px;
    font-size: 28px;
}

p {
    color: #606770;
    margin-bottom: 30px;
    font-size: 17px;
}

.input-container {
    display: flex;
    margin-bottom: 20px;
}

.input-wrapper {
    position: relative;
    flex-grow: 1;
}

#tiktok-url {
    width: 100%;
    padding: 14px;
    border: 1px solid #dddfe2;
    border-radius: 6px 0 0 6px;
    box-sizing: border-box;
    font-size: 16px;
    padding-right: 80px; /* Space for the paste button */
}

#paste-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #e9ebee;
    color: #606770;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

.input-wrapper {
    position: relative;
    flex-grow: 1;
}

#tiktok-url {
    padding-right: 80px; /* Space for the paste button */
}

#paste-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: #e9ebee;
    color: #606770;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
}

#download-btn {
    border-radius: 0 6px 6px 0;
}

#tiktok-url {
    flex-grow: 1;
    padding: 14px;
    border: 1px solid #dddfe2;
    border-radius: 6px 0 0 6px;
    box-sizing: border-box;
    font-size: 16px;
}

#download-btn {
    background-color: #1877f2;
    color: #fff;
    border: none;
    padding: 14px 25px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s;
}

#download-btn:hover {
    background-color: #166fe5;
}

.loader {
    border: 4px solid #f3f3f3;
    border-radius: 50%;
    border-top: 4px solid #1877f2;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#result .download-link {
    display: inline-block;
    margin-top: 20px;
    background-color: #42b72a;
    color: white;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: bold;
    transition: background-color 0.3s;
}

#result .download-link:hover {
    background-color: #36a420;
}
/* Footer and FAQ Styles */
.footer-container {
    width: 100%;
    background-color: #fff;
    padding: 40px 20px;
    margin-top: 50px;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto 20px auto;
    text-align: left;
}

.about-section, .faq-section {
    margin-bottom: 30px;
}

.about-section h2, .faq-section h2 {
    font-size: 20px;
    color: #1c1e21;
    margin-bottom: 15px;
    border-bottom: 2px solid #1877f2;
    padding-bottom: 5px;
    display: inline-block;
}

.about-section p {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

.faq-item {
    margin-bottom: 20px;
}

.faq-item h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 5px;
}

.faq-item p {
    font-size: 15px;
    color: #606770;
    margin-bottom: 0;
}

.footer-links {
    text-align: center;
    font-size: 14px;
}

.footer-links a {
    color: #606770;
    text-decoration: none;
    margin: 0 10px;
}

.footer-links a:hover {
    text-decoration: underline;
}

.footer-links span {
    color: #ccc;
}
/* Responsive Design */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
        width: 100%;
    }

    h1 {
        font-size: 24px;
    }

    p {
        font-size: 16px;
    }

    .input-container {
        flex-direction: column;
    }

    #tiktok-url, #download-btn {
        border-radius: 6px;
    }

    #tiktok-url {
        margin-bottom: 10px;
        text-align: center;
    }
    
    .footer-content {
        padding: 0 10px;
    }
    .how-to-section {
        padding: 20px;
        margin-top: 30px;
    }

    .how-to-section h2 {
        font-size: 20px;
    }

    .step {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .step-number {
        margin-bottom: 10px;
    }
}
/* How-To Section Styles */
.how-to-section {
    max-width: 800px;
    margin: 50px auto 0 auto;
    padding: 30px;
    background-color: #f9f9f9;
    border-radius: 12px;
    text-align: left;
}

.how-to-section h2 {
    text-align: center;
    color: #1c1e21;
    font-size: 24px;
    margin-bottom: 30px;
}

.steps-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background-color: #1877f2;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.step-content h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: #333;
}

.step-content p {
    margin: 0;
    color: #606770;
    font-size: 16px;
    line-height: 1.5;
}

/* RTL Text Alignment Fix */
html[lang="ar"] .about-section,
html[lang="ar"] .faq-section,
html[lang="ar"] .how-to-section,
html[lang="ar"] .step-content {
    text-align: right;
}
