body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /* line-height: 1.6; */
    margin: 0;
    padding: 0;
    /* background-color: #f8f9fa; */
    background-color: #f3f4f6;
    color: #333;
}

header, main, footer {
    max-width: 950px;
    margin: 0 auto;
    padding: 10px;
}

header {
    text-align: center;
    border-bottom: 2px solid #e9ecef;
    /* padding-bottom: 30px; */
    /* margin-bottom: 30px; */
}

h1 {
    color: #007bff;
    font-size: 3em;
    margin: 0;
}

h2 {
    color: #0056b3;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    /* margin-top: 40px; */
    margin-top: 0px;
}

p {
    color: #555;
    font-size: 1.2em;
}

li {
    font-size: 1.2em;
    margin-top: 8px;
}

section {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

footer {
    text-align: center;
    /* margin-top: 40px; */
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    font-size: 1.2em;
    color: #5f666d;
}

footer a {
    color: #0063cc;
    margin: 0 10px;
}

a.back-to-home {
    color: #0063cc;
    text-decoration: none;
    font-size: 1.2em;
}

/* Converter Section Styles */
.file-input-area {
    border: 2px dashed #007bff;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    background-color: #f0f8ff;
    margin-bottom: 20px;
}

.file-input-area:hover {
    background-color: #e6f2ff;
}

.file-input-area input[type="file"] {
    display: none;
}

.file-label span {
    font-size: 1.2em;
    color: #0056b3;
}

.file-label small {
    display: block;
    margin-top: 8px;
    color: #5f666d;
}

.quality-slider {
    margin-bottom: 20px;
}

.quality-slider label {
    font-weight: bold;
}

.quality-slider input[type="range"] {
    width: 100%;
}

div.advanced-options {
    padding-bottom: 24px;
}

.advanced-options details {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
}

.advanced-options summary {
    font-weight: bold;
    cursor: pointer;
}

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

#convert-btn, #download-btn {
    display: block;
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
    background-color: #007bff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#convert-btn:disabled {
    cursor: default;
    background-color: #80bdff;
}

#convert-btn:not(:disabled):hover, #download-btn:hover {
    background-color: #0056b3;
}

/* Results Section Styles */
#previews-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.preview-header {
    font-weight: bold;
    font-size: 1.2em;
    text-align: center;
    margin-bottom: 10px;
    grid-column: span 1;
}

.preview-card {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-align: center;
}

.preview-card img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
}

.preview-card .preview-thumbnail {
    cursor: pointer;
}

.preview-card .size-info {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 10px;
    font-family: monospace;
}

.text-green {
    color: #248f24;
}

.text-red {
    color: #e65c00;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

select {
    font-size: 1em;
    margin-top: 8px;
}

#faq summary {
    background-color: #e6f2ff;
    font-size: 1.2em;
    font-weight: bold;
    margin-top: 20px;
}

div.faq-answer {
    color: #555;
    font-size: 1.2em;
    margin: 1em;
}

div.faq-answer p, div.faq-answer li {
    color: #555;
    font-size: 1em;
}

.question-circle {
    cursor: pointer;
    width: 13px;
    height: 13px;
}

@keyframes summary-highlight-animation {
    from {
        background-color: #e65c00;
    }
    to {
        background-color: initial;
    }
}

.summary-highlight {
    animation: summary-highlight-animation 3s ease-out;
}

.convert-failures-header {
    font-size: 1.2em;
    font-weight: bold;
    color: #cf222e;
    border-bottom: 2px solid #cf222e;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.error-card {
    border: 1px solid #cf222e;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
    background-color: #fdeded;
    color: #cf222e;
    font-family: monospace;
}
