/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --text-color: #f0f0f0;
    --text-secondary: #b0b0b0;
    --bg-color: #121212;
    --bg-secondary: #1e1e1e;
    --bg-tertiary: #2d2d2d;
    --card-bg: #252525;
    --border-color: #444;
    --success-color: #27ae60;
    --success-dark: #219653;
    --error-color: #e74c3c;
    --warning-color: #f39c12;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

ul {
    list-style: none;
}

/* Header styles */
header {
    background-color: var(--bg-secondary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: 700;
}

.logo p {
    font-size: 14px;
    color: var(--text-secondary);
}

nav ul {
    display: flex;
}

nav ul li {
    margin-left: 30px;
}

nav ul li a {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s;
}

nav ul li a:hover, nav ul li a.active {
    color: var(--primary-color);
}

/* Hero section */
.hero {
    padding: 80px 0;
    background: linear-gradient(135deg, #1e3c5a, #0f2942);
    color: var(--text-color);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.hero h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

.hero p {
    font-size: 18px;
    margin-bottom: 40px;
    opacity: 0.9;
}

/* Converter box */
.converter-box {
    background-color: var(--bg-secondary);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    padding: 30px;
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
}

.input-group {
    display: flex;
    margin-bottom: 20px;
}

.input-group input {
    flex: 1;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 5px 0 0 5px;
    font-size: 16px;
    transition: border-color 0.3s;
    background-color: var(--bg-tertiary);
    color: var(--text-color);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.input-group button {
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    padding: 0 30px;
    border-radius: 0 5px 5px 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.input-group button:hover {
    background-color: var(--primary-dark);
}

/* Format options */
.format-options {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.format-group {
    flex: 1;
    background-color: var(--bg-tertiary);
    border-radius: 5px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
}

.format-group h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-color);
}

.options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.options label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 15px;
    background-color: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.options label:hover {
    border-color: var(--primary-color);
    background-color: #2a3b47;
}

.options label.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #1a1a1a;
}

.options label.disabled:hover {
    border-color: var(--border-color);
}

.format-notice {
    color: var(--error-color);
    font-size: 14px;
    margin-bottom: 10px;
    font-style: italic;
}

.options input[type="radio"] {
    display: none;
}

.options input[type="radio"]:checked + span {
    color: #fff;
    font-weight: 600;
}

.options input[type="radio"]:checked + span::before {
    content: "\2713 ";
}

.options input[type="radio"]:checked + label,
.options label:has(input[type="radio"]:checked) {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.options span {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 500;
}

/* Result section */
#result, #loading, #error {
    margin-top: 30px;
}

.hidden {
    display: none;
}

.video-info {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.thumbnail {
    width: 160px;
    height: 90px;
    border-radius: 5px;
    overflow: hidden;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info h3 {
    font-size: 18px;
    margin-bottom: 5px;
    color: #333;
}

.info p {
    font-size: 14px;
    color: #777;
    margin-bottom: 5px;
}

.download-options {
    display: flex;
    gap: 15px;
}

.download-btn, .copy-btn {
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.download-btn {
    background-color: #27ae60;
    color: #fff;
    border: none;
}

.download-btn:hover {
    background-color: #219653;
}

.copy-btn {
    background-color: #f1f1f1;
    color: #555;
    border: none;
}

.copy-btn:hover {
    background-color: #e0e0e0;
}

/* Loading spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(52, 152, 219, 0.2);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading p {
    text-align: center;
    color: #555;
    font-size: 16px;
}

/* Error message */
#error {
    text-align: center;
    color: #e74c3c;
}

#error i {
    font-size: 40px;
    margin-bottom: 15px;
}

/* Features section */
.features {
    padding: 80px 0;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.features h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 50px;
    color: #fff;
}

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

.feature-card {
    background-color: #2a2a2a;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
}

.feature-card i {
    font-size: 40px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--text-color);
}

.feature-card p {
    color: var(--text-secondary);
}

/* How it works section */
.how-it-works {
    padding: 80px 0;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

.how-it-works h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 50px;
    color: var(--text-color);
}

.steps {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
}

.step {
    flex: 1;
    min-width: 200px;
    text-align: center;
    position: relative;
}

.step-number {
    width: 50px;
    height: 50px;
    background-color: #3498db;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin: 0 auto 20px;
}

.step h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--text-color);
}

.step p {
    color: var(--text-secondary);
}

/* FAQ section */
.faq {
    padding: 80px 0;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.faq h2 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 50px;
    color: var(--text-color);
}

.accordion {
    max-width: 800px;
    margin: 0 auto;
}

.accordion-item {
    margin-bottom: 15px;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
}

.accordion-header {
    width: 100%;
    padding: 20px;
    background-color: var(--bg-tertiary);
    border: none;
    text-align: left;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s;
}

.accordion-header:hover {
    background-color: #2a2a2a;
}

.accordion-header::after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: var(--primary-color);
}

.accordion-item.active .accordion-header::after {
    content: '-';
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: var(--card-bg);
}

.accordion-item.active .accordion-content {
    max-height: 200px;
}

.accordion-content p {
    padding: 20px;
    color: var(--text-secondary);
}

/* Footer */
footer {
    background-color: #0a1622;
    color: var(--text-color);
    padding: 60px 0 20px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 40px;
}

.footer-logo h2 {
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 10px;
}

.footer-logo p {
    color: var(--text-secondary);
    font-size: 14px;
}

.footer-links {
    margin-right: 30px;
}

.footer-links h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-color);
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a {
    color: var(--text-secondary);
    transition: color 0.3s;
}

.footer-links ul li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Ad containers */
.ad-container {
    width: 100%;
    max-width: 728px;
    margin: 20px auto;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    padding: 10px;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.footer-ad {
    margin: 30px auto;
    background-color: rgba(255, 255, 255, 0.03);
}

@media (max-width: 768px) {
    .ad-container {
        max-width: 100%;
        overflow-x: auto;
    }
}

/* Responsive styles */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }
    
    nav ul {
        margin-top: 20px;
        justify-content: center;
    }
    
    nav ul li {
        margin: 0 10px;
    }
    
    .format-options {
        flex-direction: column;
    }
    
    .video-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .thumbnail {
        width: 100%;
        max-width: 320px;
        height: auto;
        aspect-ratio: 16/9;
    }
    
    .download-options {
        flex-direction: column;
    }
    
    .steps {
        flex-direction: column;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 30px;
    }
}
