:root {
    --primary: #7e57c2;
    --primary-dark: #5e35b1;
    --secondary: #03dac6;
    --background: #1a1a1a;
    --surface: #2c2c2c;
    --error: #cf6679;
    --on-primary: #ffffff;
    --on-secondary: #000000;
    --on-background: #e0e0e0;
    --on-surface: #e0e0e0;
    --on-error: #000000;

    --font-main: 'DotGothic16', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-sub: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    font-family: var(--font-main);
    margin: 0;
    padding: 0;
    background-color: var(--background);
    color: var(--on-background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.6;
}

header {
    background-color: var(--primary);
    color: var(--on-primary);
    width: 100%;
    padding: 1.2rem 0 1.5rem 0;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

h1 { /* For index.html main title */
    margin: 0;
    font-size: 2.2rem;
    font-weight: 400;
}

.subtitle { /* For index.html subtitle */
    font-family: var(--font-sub);
    font-size: 0.9rem;
    margin-top: 0.3rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 300;
}

.container {
    max-width: 1000px;
    width: 90%;
    margin: 2.5rem auto;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Section base styles */
.upload-section,
.options-section,
.preview-section,
.info-section,
.content-section {
    background-color: var(--surface);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

.upload-section {
    text-align: center;
}

.options-section {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-around;
}

.preview-section {
    text-align: center;
}
.info-section {
    text-align: left;
}

.content-section {
    text-align: left;
}


.upload-section h2,
.preview-section h2 {
    font-family: var(--font-main);
    color: var(--secondary);
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.options-section > h2 {
    font-family: var(--font-main);
    color: var(--secondary);
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    width: 100%;
    text-align: center;
}

.upload-section p {
    font-family: var(--font-sub);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    margin: 1rem 0;
}

.file-input {
    position: absolute;
    font-size: 100px;
    opacity: 0;
    right: 0;
    top: 0;
    cursor: pointer;
}

.file-input-button {
    background-color: var(--primary);
    color: var(--on-primary);
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    border: none;
    font-size: 1.1rem;
    font-family: var(--font-main);
    font-weight: 400;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
}

.file-input-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

#fileName {
    font-family: var(--font-sub);
    margin-top: 0.8rem;
    color: var(--secondary);
    font-size: 0.9rem;
}

.option-group {
    flex: 1;
    min-width: 280px;
    padding: 1rem;
    text-align: left;
}

.option-group h3 {
    font-family: var(--font-main);
    color: var(--secondary);
    font-size: 1.5rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.75rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.radio-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 1rem;
    font-family: var(--font-main);
}

.radio-button {
    appearance: none;
    width: 1.4rem;
    height: 1.4rem;
    border: 2px solid var(--secondary);
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.radio-button:checked {
    background-color: var(--secondary);
    border-color: var(--primary-dark);
}

.radio-button:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0.7rem;
    height: 0.7rem;
    background-color: var(--on-secondary);
    border-radius: 50%;
}

.radio-label:hover .radio-button {
    border-color: var(--primary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    margin-right: 12px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    transition: .3s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--secondary);
}

input:focus + .slider {
    box-shadow: 0 0 2px var(--secondary);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.toggle-option {
    display: flex;
    align-items: center;
    margin: 1.2rem 0;
    font-family: var(--font-main);
    font-size: 1rem;
}

.toggle-option .option-label-text {
     font-family: var(--font-main);
}

.option {
    margin: 1rem 0;
    font-family: var(--font-sub);
}
.option label {
    margin-right: 0.5rem;
}
.option input[type="range"] {
    width: 60%;
    vertical-align: middle;
}
.option span {
    margin-left: 0.5rem;
    color: var(--secondary);
    font-family: var(--font-main);
}

.preview-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    border: 2px solid var(--surface);
    border-radius: 8px;
    min-height: 300px;
}

#preview {
    max-width: 100%;
    max-height: 60vh;
    image-rendering: pixelated;
    display: none;
    border-radius: 6px;
}

.placeholder-text {
    color: #777;
    padding: 40px;
    font-style: italic;
    font-family: var(--font-main);
    font-size: 1.2rem;
}

.crt-effect::before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, var(--scanline-opacity-val)) 50%);
    background-size: 100% var(--scanline-size, 3px);
    pointer-events: none;
    z-index: 10;
    mix-blend-mode: multiply;
    border-radius: 6px;
}

.crt-effect::after {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.6);
    background: radial-gradient(circle at center, transparent 50%, rgba(0, 20, 40, var(--vignette-opacity-val)) 100%);
    opacity: 0.85;
    z-index: 2;
    pointer-events: none;
    border-radius: 6px;
}

.button-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.button {
    background-color: var(--primary);
    color: var(--on-primary);
    padding: 0.9rem 2rem;
    border-radius: 8px;
    border: none;
    font-size: 1.1rem;
    font-family: var(--font-main);
    font-weight: 400;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.button:disabled {
    background-color: #444;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button.secondary {
    background-color: var(--secondary);
    color: var(--on-secondary);
}
.button.secondary:hover {
    background-color: #02c5b0;
}

footer {
    margin-top: auto;
    width: 100%;
    padding: 2rem 0;
    text-align: center;
    background-color: var(--surface);
    color: rgba(224, 224, 224, 0.6);
    font-family: var(--font-sub);
    font-size: 0.9rem;
    border-top: 1px solid #333;
}

footer a { /* MODIFIED: Added specific style for footer links */
    color: var(--secondary); /* Use secondary color for better visibility */
    text-decoration: none;
}

footer a:hover { /* MODIFIED: Added hover effect for footer links */
    text-decoration: underline;
    color: var(--primary); /* Optional: change color on hover for more feedback */
}

.info-section h2 {
    font-family: var(--font-main);
    color: var(--secondary);
    text-align: center;
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 2.5rem;
}

.info-section h3 {
    font-family: var(--font-main);
    color: var(--secondary);
    border-bottom: 1px solid rgba(224, 224, 224, 0.2);
    padding-bottom: 0.6rem;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
}

.info-section h3:first-of-type {
     margin-top: 0;
}

.info-columns {
    display: flex;
    flex-wrap: wrap; 
    gap: 2.5rem;     
    margin-top: 2rem;
}

.info-column {
    flex-basis: 100%;
}

.info-section p,
.info-section li {
    line-height: 1.75;
    margin-bottom: 1.2rem;
    font-family: var(--font-sub);
    font-size: 0.95rem;
}

.info-section ul,
.info-section ol {
    padding-left: 1.8rem;
    margin-bottom: 1.8rem;
}

.info-section li::marker {
    color: var(--secondary);
}

.info-section strong {
    color: var(--secondary); /* Changed from --primary to --secondary for consistency in info section emphasis */
    font-weight: 600;
    font-family: var(--font-main);
}

.info-section a { 
    color: var(--secondary);
    text-decoration: none;
}
.info-section a:hover {
    text-decoration: underline;
}

.loading {
    display: none;
    margin: 2.5rem auto;
}

.loading:after {
    content: " ";
    display: block;
    width: 50px;
    height: 50px;
    margin: 8px;
    border-radius: 50%;
    border: 5px solid var(--secondary);
    border-color: var(--secondary) transparent var(--secondary) transparent;
    animation: loading 1s linear infinite;
}

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

/* Styles specific to license.html elements, merged here */
.page-title { 
    font-family: var(--font-main);
    color: var(--on-primary);
    font-size: 1.8rem;
    font-weight: 400; 
    margin: 0; 
}

.content-section h2 {
    font-family: var(--font-main);
    color: var(--secondary);
    text-align: center;
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 2.5rem;
}

.content-section h3 {
    font-family: var(--font-main);
    color: var(--secondary);
    border-bottom: 1px solid rgba(224, 224, 224, 0.2);
    padding-bottom: 0.6rem;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
}

.content-section h3:first-of-type {
     margin-top: 0;
}

.content-section p,
.content-section li {
    line-height: 1.75;
    margin-bottom: 1.2rem;
    font-family: var(--font-sub);
    font-size: 0.95rem;
    color: var(--on-surface);
}

.content-section ul {
    padding-left: 1.8rem;
    margin-bottom: 1.8rem;
}

.content-section li::marker {
    color: var(--secondary);
}

.content-section a {
    color: var(--secondary);
    text-decoration: none;
}
.content-section a:hover {
    text-decoration: underline;
}


@media (max-width: 768px) {
    .container {
        width: 95%;
        gap: 2rem;
    }
    /* Smaller main title */
    h1 {
        font-size: 1.4rem;
    }
    /* Smaller license page title */
    .page-title {
         font-size: 1.3rem;
    }
    .subtitle {
        font-size: 0.8rem;
        margin: 0.2rem 1rem 0 1rem;
    }
    /* Smaller section headings */
    .upload-section h2,
    .preview-section h2,
    .options-section > h2 {
        font-size: 1.4rem;
        margin-bottom: 1.2rem;
    }
    /* Smaller info section headings */
    .info-section h2, 
    .content-section h2 { 
        font-size: 1.5rem;
        margin-bottom: 1.8rem;
    }
    /* Smaller option group headings */
    .option-group h3 {
        font-size: 1.3rem;
        margin-bottom: 1.2rem;
    }
    /* Smaller info section subheadings */
    .info-section h3, 
    .content-section h3 { 
        font-size: 1.2rem;
        margin-top: 1.8rem;
        margin-bottom: 1.2rem;
    }
    .upload-section,
    .options-section,
    .preview-section,
    .info-section,
    .content-section { 
        padding: 1.5rem;
    }
    .option-group {
        min-width: 100%;
    }
    /* Adjust margins to match font size adjustments */
    .button-container {
        flex-direction: column;
        gap: 0.8rem;
        margin-top: 2rem;
    }
    .button {
        width: 100%;
        box-sizing: border-box;
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}

/* Floating button promoting Converter II */
.promo-floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--surface);
    border: 2px solid var(--secondary);
    color: var(--on-surface);
    padding: 12px 24px;
    border-radius: 50px; /* Rounded shape */
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    font-family: var(--font-main);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, background-color 0.3s;
    animation: floatUp 1s ease-out; /* Fade in animation */
}

.promo-floating-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(3, 218, 198, 0.3); /* Secondary color glow */
    text-decoration: none;
    background-color: #333;
}

.promo-badge {
    background-color: var(--secondary);
    color: var(--on-secondary);
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
}

@keyframes floatUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Mobile: Centered at bottom of screen */
@media (max-width: 768px) {
    .promo-floating-btn {
        bottom: 20px;
        right: auto;
        left: 50%;
        transform: translateX(-50%); /* Center align */
        width: max-content;
        white-space: nowrap;
        padding: 10px 20px;
        font-size: 0.9rem;
        animation: floatUpMobile 1s ease-out forwards;
    }

    .promo-floating-btn:hover {
        transform: translate(-50%, -5px);
    }

    @keyframes floatUpMobile {
        0% { opacity: 0; transform: translate(-50%, 20px); }
        100% { opacity: 1; transform: translate(-50%, 0); }
    }
}