:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --background-color: #f4f7f6;
    --container-bg: #ffffff;
    --text-color: #333;
    --border-color: #ddd;
    --error-color: #d9534f;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 600px;
    background: var(--container-bg);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    text-align: center;
}

header {
    position: relative;
    margin-bottom: 1.5rem;
}

header h1 {
    font-size: 2.5rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

input[type="text"], select {
    width: 100%;
    padding: 12px;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
}

input[type="text"]:focus, select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.2);
    outline: none;
}

button, .button {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

button:hover, .button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hidden {
    display: none !important;
}

#result-section { margin-top: 2rem; }
#video-thumbnail { max-width: 100%; border-radius: 8px; margin-bottom: 1.5rem; }
#time-slider { margin: 2rem 1rem; }

.time-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}
.time-display input {
    width: 100px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.quality-selector, .format-selector {
    text-align: left;
    margin: 1.5rem auto;
    max-width: 300px;
}
.quality-selector > label, .format-selector > label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}
#quality-list {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
}
#quality-list label {
    font-weight: normal;
    display: block;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
}
#quality-list label:hover { background-color: #f0f0f0; }
#quality-list input { margin-right: 10px; width: auto; }

#status-section { margin-top: 2rem; }

.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--secondary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 1rem auto;
}

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

#error-section {
    margin-top: 1rem; padding: 1rem; background: #f8d7da;
    color: var(--error-color); border: 1px solid #f5c6cb; border-radius: 8px;
}

#lang-switcher { position: absolute; top: -10px; right: 0; }
#lang-switcher button {
    background: none; border: 1px solid var(--border-color); color: var(--text-color);
    padding: 5px 10px; margin-left: 5px; cursor: pointer;
    font-size: 0.9rem; border-radius: 6px;
}
#lang-switcher button.active {
    background: var(--primary-color); color: white; border-color: var(--primary-color); font-weight: bold;
}

#preview-button { background: #333; margin-bottom: 1.5rem; }
#preview-button:hover { background: #000; }

#modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.8); display: flex;
    justify-content: center; align-items: center; z-index: 1000;
    opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
}
#modal-overlay:not(.hidden) { opacity: 1; pointer-events: all; }

#modal-content {
    background: white; padding: 20px; border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); width: 90%;
    max-width: 800px; text-align: center;
}
#player { width: 100%; aspect-ratio: 16 / 9; margin-bottom: 15px; background: #000; border-radius: 8px; }
#modal-close-button { margin-top: 10px; background: #777; }

/* ===== NEW STYLES START HERE ===== */
.content-sections {
    max-width: 600px;
    width: 100%;
    margin-top: 3rem;
    text-align: left;
}
.content-sections section {
    background: var(--container-bg);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}
.content-sections h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    text-align: center;
    margin-top: 0;
    margin-bottom: 2rem;
}

.steps {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    text-align: center;
}
.step { flex: 1; }
.step-icon { font-size: 2.5rem; line-height: 1; }
.step h3 { margin-top: 1rem; margin-bottom: 0.5rem; font-size: 1.1rem; }
.step p { font-size: 0.9rem; color: #666; }

.faq details { border-bottom: 1px solid var(--border-color); padding: 1rem 0; }
.faq details:first-of-type { border-top: 1px solid var(--border-color); }
.faq summary {
    font-weight: bold; cursor: pointer; list-style: none;
    display: flex; justify-content: space-between; align-items: center;
    transition: margin 0.2s ease;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: '+';
    font-size: 1.5rem;
    transition: transform 0.2s ease;
}
.faq details[open] summary { margin-bottom: 1rem; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p {
    margin-top: 0; padding-left: 1rem;
    color: #333; border-left: 3px solid var(--primary-color);
}

footer {
    width: 100%; max-width: 600px; text-align: center;
    margin-top: 2rem; padding-bottom: 2rem;
    color: #888; font-size: 0.9rem;
}
footer a { color: #555; text-decoration: none; }
footer a:hover { text-decoration: underline; }
.footer-links a { margin: 0 10px; }

@media (max-width: 640px) {
    body { padding: 1rem; }
    .container { padding: 1.5rem 1rem; }
    header h1 { font-size: 2rem; }
    .time-display { flex-direction: column; }
    #lang-switcher { position: static; margin-bottom: 1rem; text-align: center; }
    .steps { flex-direction: column; gap: 30px; }
}
