* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

:root {
    --primary-color: #4361ee;
    --primary-light: #4895ef;
    --secondary-color: #3f37c9;
    --accent-color: #4cc9f0;
    --text-color: #333;
    --light-text: #666;
    --white: #ffffff;
    --light-bg: #f8f9fa;
    --dark-bg: #212529;
    --border-color: #e0e0e0;
    --success-color: #52b788;
    --error-color: #e63946;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --primary-color: #4cc9f0;
    --primary-light: #4895ef;
    --secondary-color: #3a0ca3;
    --accent-color: #7209b7;
    --text-color: #e9ecef;
    --light-text: #ced4da;
    --white: #212529;
    --light-bg: #343a40;
    --dark-bg: #212529;
    --border-color: #4d5359;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

body {
    background: var(--light-bg);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    flex-direction: column;
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

body::before {
    content: none !important;
    display: none !important;
}

body::after {
    content: none !important;
    display: none !important;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 5px;
}

.logo i {
    font-size: 28px;
    color: var(--primary-color);
}

h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.tagline {
    font-size: 1rem;
    color: var(--light-text);
    margin-bottom: 10px;
}

/* Theme Switcher */
.theme-switch-wrapper {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 50px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
}

.slider:before {
    background-color: white;
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.theme-mode {
    margin-left: 10px;
    color: var(--light-text);
}

.container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    background: var(--primary-light);
    color: var(--white);
    padding: 15px 25px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.upload-area {
    border: 2px dashed var(--primary-light);
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin: 20px;
    background: var(--light-bg);
}

.upload-area:hover {
    background: rgba(67, 97, 238, 0.05);
}

.upload-area.active {
    background: rgba(67, 97, 238, 0.1);
    border-color: var(--primary-color);
}

.upload-area i {
    font-size: 60px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.upload-area p {
    margin-bottom: 20px;
    color: var(--light-text);
    font-size: 1rem;
}

.upload-btn {
    background: var(--primary-color);
    color: var(--white);
    padding: 12px 25px;
    border-radius: 30px;
    cursor: pointer;
    display: inline-block;
    transition: var(--transition);
    font-weight: 500;
    font-size: 1rem;
    border: none;
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
}

.upload-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(67, 97, 238, 0.4);
}

.file-details-container {
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
}

@media (min-width: 768px) {
    .file-details-container {
        flex-direction: row;
    }
}

.file-preview {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    background: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    position: relative;
}

.file-preview img {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 350px;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

/* Image Controls */
.image-controls {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.file-preview:hover .image-controls {
    opacity: 1;
}

.image-control-btn {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.image-control-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.file-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-item {
    display: flex;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.info-label {
    font-weight: 600;
    width: 80px;
    flex-shrink: 0;
    color: var(--light-text);
}

.info-value {
    word-break: break-all;
}

.format-selection {
    margin: 20px 0;
    background: var(--light-bg);
    padding: 15px;
    border-radius: 10px;
}

.format-selection h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.quality-control {
    margin: 25px 0;
    position: relative;
    background: linear-gradient(to right, rgba(230, 57, 70, 0.05), rgba(67, 97, 238, 0.1), rgba(82, 183, 136, 0.05));
    border-radius: 15px;
    padding: 18px;
    border: 1px solid var(--primary-color);
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.1);
}

.quality-control h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: var(--primary-color);
    text-align: center;
    font-weight: 600;
}

.quality-slider {
    margin: 20px 0;
    padding: 0;
    border: none;
    background: transparent;
}

.quality-slider label {
    display: block;
    margin-bottom: 15px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.05rem;
    text-align: center;
}

.format-options {
    margin-bottom: 20px;
}

select {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-top: 5px;
    font-size: 1rem;
    color: var(--text-color);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 15px center;
    background-size: 15px;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

/* Quality Slider */
.quality-slider {
    margin: 20px 0;
    background: rgba(67, 97, 238, 0.05);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid var(--primary-light);
}

.quality-slider label {
    display: block;
    margin-bottom: 10px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.05rem;
}

.quality-slider .slider {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 18px;
    border-radius: 12px;
    background: linear-gradient(to right, var(--error-color), var(--primary-color), var(--success-color));
    outline: none;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.quality-slider .slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--white);
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.quality-slider .slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--white);
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.quality-slider .slider:hover::-webkit-slider-thumb {
    transform: scale(1.2);
}

.quality-slider .slider:hover::-moz-range-thumb {
    transform: scale(1.2);
}

.quality-info {
    margin-top: 12px;
}

.quality-levels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.quality-low {
    color: var(--error-color);
    font-size: 0.85rem;
}

.quality-high {
    color: var(--success-color);
    font-size: 0.85rem;
}

.quality-description {
    font-size: 0.9rem;
    color: var(--light-text);
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.5);
    padding: 8px;
    border-radius: 5px;
    margin-top: 5px;
}

.convert-btn, .download-btn, .new-conversion-btn {
    background: var(--primary-color);
    color: var(--white);
    padding: 14px 25px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
    width: 100%;
}

.convert-btn:hover, .download-btn:hover, .new-conversion-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(67, 97, 238, 0.4);
}

.convert-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
}

.convert-btn i, .download-btn i, .new-conversion-btn i {
    margin-right: 8px;
}

.download-btn {
    background: var(--success-color);
    box-shadow: 0 4px 10px rgba(82, 183, 136, 0.3);
    margin-bottom: 10px;
}

.download-btn:hover {
    background: #3da76d;
    box-shadow: 0 6px 15px rgba(82, 183, 136, 0.4);
}

.new-conversion-btn {
    background: var(--accent-color);
    box-shadow: 0 4px 10px rgba(76, 201, 240, 0.3);
}

.new-conversion-btn:hover {
    background: #34a6c7;
    box-shadow: 0 6px 15px rgba(76, 201, 240, 0.4);
}

.result-container {
    text-align: center;
    padding-bottom: 20px;
}

.download-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
}

.download-section img {
    max-width: 100%;
    max-height: 350px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

/* Result Details */
.result-details {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 20px;
    padding: 15px;
    background: var(--light-bg);
    border-radius: 10px;
}

.download-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 300px;
}

.features {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.feature-item {
    flex: 1;
    min-width: 250px;
    background: var(--white);
    padding: 25px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: var(--white);
}

.feature-icon i {
    font-size: 28px;
}

.feature-item h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.feature-item p {
    color: var(--light-text);
    font-size: 0.95rem;
}

/* FAQ Section */
.faq-section {
    margin: 40px 0;
}

.faq-section h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.accordion {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.accordion-item {
    background: var(--white);
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.accordion-header {
    padding: 15px 20px;
    background: var(--white);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.accordion-header:hover {
    background: var(--light-bg);
}

.accordion-header h3 {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
}

.accordion-header i {
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.accordion-item.active .accordion-header i {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, padding 0.5s ease-in-out;
    padding: 0 20px;
    opacity: 0;
}

.accordion-item.active .accordion-content {
    max-height: 500px;
    padding: 15px 20px 20px;
    opacity: 1;
}

.accordion-content p {
    color: var(--light-text);
    line-height: 1.6;
}

/* Footer */
.footer {
    margin-top: 50px;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
    width: 100%;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    padding: 30px;
    gap: 30px;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.footer-section p {
    color: var(--light-text);
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.social-icon:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    padding: 15px 30px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.footer-bottom p {
    color: var(--light-text);
    font-size: 0.9rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    overflow: auto;
}

.modal-content {
    background: var(--white);
    margin: 50px auto;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    color: var(--light-text);
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--error-color);
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.modal-content p {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 15px;
}

.modal-content ul {
    padding-left: 20px;
    margin-bottom: 20px;
}

.modal-content ul li {
    margin-bottom: 8px;
    color: var(--text-color);
}

/* Contact Form */
.contact-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--light-bg);
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

.submit-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.3);
}

.submit-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(67, 97, 238, 0.4);
}

.error-message {
    background-color: var(--error-color);
    color: var(--white);
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    width: 100%;
    max-width: 1200px;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(230, 57, 70, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.error-message::before {
    content: "\f071";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 10px;
}

.success-message {
    background-color: var(--success-color);
    color: var(--white);
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    width: 100%;
    max-width: 1200px;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(82, 183, 136, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.success-message::before {
    content: "\f058";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 10px;
}

.js-error-message, .js-success-message {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .file-details-container {
        flex-direction: column;
    }
    
    .features {
        flex-direction: column;
    }
    
    .feature-item {
        min-width: 100%;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .logo i {
        font-size: 24px;
    }
    
    .upload-area {
        padding: 40px 20px;
    }
    
    .upload-area i {
        font-size: 50px;
    }
    
    .theme-switch-wrapper {
        position: relative;
        top: auto;
        right: auto;
        margin: 15px auto 0;
        justify-content: center;
    }
    
    .accordion-header h3 {
        font-size: 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .modal-content {
        margin: 60px auto;
        padding: 20px;
    }
} 