/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1da1f2;
    --primary-dark: #1991db;
    --secondary-color: #14171a;
    --background-color: #f8f9fa;
    --text-color: #14171a;
    --text-light: #657786;
    --white: #ffffff;
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --transition: transform 0.2s ease;
}

/* Optimized animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Layout */
body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
}

/* Optimize font loading */
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('https://fonts.gstatic.com/s/poppins/v20/pxiEyp8kv8JHgFVrJJfecg.woff2') format('woff2');
}

/* Header */
header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Hero section */
.hero {
    padding: 120px 20px 60px;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.6s ease;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease 0.2s;
}

/* Form */
.input-group {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
}

#url-input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    font-size: 16px;
}

button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}

button:hover {
    transform: translateY(-2px);
}

/* Features */
.features {
    padding: 60px 20px;
    background-color: var(--white);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.feature {
    text-align: center;
    padding: 30px;
    transition: var(--transition);
}

.feature:hover {
    transform: translateY(-5px);
}

/* FAQ */
.faq {
    padding: 60px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.faq h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: var(--text-color);
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 20px;
    border: 1px solid var(--text-light);
    border-radius: 4px;
    overflow: hidden;
    background: var(--white);
}

.faq-question {
    width: 100%;
    padding: 15px;
    text-align: left;
    background: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    transition: var(--transition);
}

.faq-question:hover {
    background: rgba(29, 161, 242, 0.05);
}

.faq-question i {
    transition: transform 0.3s ease;
}

.faq-question.active i {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
    background: var(--white);
}

.faq-answer.active {
    padding: 15px;
    max-height: 500px;
}

.faq-answer p {
    color: var(--text-light);
    line-height: 1.6;
    margin: 0;
}

/* Footer */
footer {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 40px 20px;
    margin-top: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

/* Responsive design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .input-group {
        flex-direction: column;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Optimize for reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.logo a {
    text-decoration: none;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.logo h1 i {
    font-size: 1.2rem;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--primary-color);
    background: rgba(29, 161, 242, 0.1);
}

/* Main content styles */
main {
    max-width: 100%;
    margin: 5rem auto 0;
    padding: 0;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(29, 161, 242, 0.1) 0%, rgba(255, 255, 255, 0.8) 100%);
    z-index: -1;
}

/* Feedback and download links styles */
#feedback {
    text-align: center;
    margin: 2rem auto;
    padding: 1rem;
    border-radius: 4px;
    max-width: 600px;
}

#download-links {
    margin: 2rem auto;
    max-width: 600px;
}

/* Video card styles */
.entry-container,
.single-entry-container {
    background: var(--white);
    border-radius: 15px;
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: var(--transition);
    animation: fadeInUp 0.5s ease;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.entry-container:hover,
.single-entry-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.entry-container img,
.single-entry-container img {
    width: 100%;
    max-width: 320px;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.formats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    width: 100%;
    margin-top: 1.5rem;
}

.format-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--white);
    background: var(--primary-color);
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 45px;
    border: 2px solid transparent;
}

.format-link:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(29, 161, 242, 0.2);
    border-color: var(--white);
}

.format-link:active {
    transform: translateY(0);
}

/* Responsive adjustments for format buttons */
@media (max-width: 480px) {
    .formats {
        grid-template-columns: 1fr;
    }

    .format-link {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
    }
}

/* Features section */
.features h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: var(--text-color);
}

.feature i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

/* How-to section */
.how-to {
    padding: 2rem 1rem;
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow);
    margin: 2rem 0;
}

.how-to h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    color: var(--text-color);
}

.how-to ol {
    max-width: 600px;
    margin: 0 auto;
    padding-left: 1.5rem;
}

.how-to li {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* Footer styles */
.footer-section h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.footer-section a {
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    transition: var(--transition);
    opacity: 0.8;
}

.footer-section a:hover {
    color: var(--primary-color);
    opacity: 1;
    transform: translateX(5px);
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.7;
}

/* Privacy Policy Page */
.privacy-policy {
    padding: 6rem 1rem 4rem;
    background: var(--white);
}

.privacy-policy .container {
    max-width: 800px;
    margin: 0 auto;
}

.privacy-policy h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

.privacy-policy .subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 3rem;
    text-align: center;
}

.policy-content {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.policy-content h2 {
    color: var(--text-color);
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
}

.policy-content h2:first-child {
    margin-top: 0;
}

.policy-content p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .privacy-policy {
        padding: 8rem 2rem 6rem;
    }

    .privacy-policy h1 {
        font-size: 3rem;
    }

    .policy-content {
        padding: 3rem;
    }
}