:root {
    --primary-color: #1b3a57;
    --secondary-color: #274c77;
    --accent-color: #4a90e2;
    --light-color: #eef4fc;
    --dark-color: #333;
    --text-color: #4b647d;
    --white: #ffffff;
    --shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --transition: all 0.3s ease-in-out;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: url('/theme/image/background.svg') no-repeat center center fixed;
    background-size: cover;
    background-color: #f0f3fb;
    color: var(--dark-color);
    line-height: 1.6;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    padding-top: 70px;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.hidden {
    display: none !important;
}

/* Container Styles */
.container {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin: 20px auto;
    max-width: 800px;
    transition: var(--transition);
}

/* Typography */
h1, h2, h3, h4 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.3;
}

h1 {
    font-size: 2.2rem;
    text-align: center;
    margin-top: 10px;
}

h2 {
    font-size: 1.8rem;
    margin: 25px 0 15px;
}

h3 {
    font-size: 1.4rem;
}

p {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 15px;
}

/* Form Elements */
.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 1.1rem;
}

input[type="file"],
input[type="range"],
select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    background-color: var(--white);
    font-size: 1rem;
    color: var(--dark-color);
    transition: var(--transition);
    margin-bottom: 5px;
}

input[type="file"]:focus,
input[type="range"]:focus,
select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

input[type="file"]::file-selector-button {
    padding: 10px 16px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    margin-right: 15px;
    font-weight: 500;
}

input[type="file"]::file-selector-button:hover {
    background: var(--secondary-color);
}

input[type="range"] {
    -webkit-appearance: none;
    height: 8px;
    background: #d1d9e6;
    border-radius: 10px;
    padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

#qualityValue {
    display: inline-block;
    margin-left: 10px;
    font-weight: 500;
    color: var(--primary-color);
}

/* Buttons */
button, .download-btn {
    display: inline-block;
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    margin-top: 10px;
    text-decoration: none;
}

button:hover, .download-btn:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27, 58, 87, 0.3);
}

button:active, .download-btn:active {
    transform: translateY(0);
}

/* Image Previews */
#preview, #result {
    margin-top: 25px;
    animation: fadeIn 0.5s ease-out;
}

#uploadedImage, #processedImage {
    max-width: 100%;
    max-height: 400px;
    border-radius: var(--border-radius);
    margin: 15px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: block;
    object-fit: contain;
}

.file-info {
    margin: 15px 0;
    font-size: 1rem;
    color: var(--text-color);
    font-weight: 500;
}

/* Progress Bar */
#loading {
    margin: 25px 0;
    text-align: center;
}

.progress-container {
    width: 100%;
    height: 10px;
    background: #e0e6ed;
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 10px;
    transition: width 0.5s ease;
}

#progressText {
    color: var(--primary-color);
    font-weight: 500;
    margin-top: 10px;
}

/* Content Sections */
.intro, .faq {
    background: transparent;
    border-radius: var(--border-radius);
}

.intro ul, .faq ul {
    list-style-position: inside;
    margin: 15px 0;
}

.intro li, .faq li {
    margin-bottom: 10px;
    padding-left: 10px;
}

.intro i, .faq i {
    color: var(--accent-color);
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Cards Layout */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    border: 1px solid rgba(74, 144, 226, 0.2);
    text-align: center;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.card p {
    font-size: 1rem;
    color: var(--text-color);
}

/* FAQ Section */
.faq h3 {
    color: var(--secondary-color);
    margin-top: 25px;
    font-size: 1.2rem;
}

.faq p {
    margin-left: 20px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    main {
        padding: 15px;
    }
    
    .container, .intro, .faq {
        padding: 20px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .cards {
        grid-template-columns: 1fr;
    }
    
    input[type="file"],
    input[type="range"],
    select,
    button,
    .download-btn {
        padding: 14px;
    }
    
    #uploadedImage, #processedImage {
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    p, li {
        font-size: 1rem;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    #uploadedImage, #processedImage {
        max-height: 250px;
    }
}