/* styles.css */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #212529;
    overflow-x: hidden;
}

header {
    background-color: #2196f3;
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 1.8em;
    font-weight: bold;
    letter-spacing: 1px;
}

main {
    padding: 30px 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.compressor {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 50px;
}

.left-column, .right-column {
    width: 48%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.left-column:hover, .right-column:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
}

.upload-section {
    border: 2px dashed #6c757d;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin-bottom: 25px;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.upload-section.drag-over {
    border-color: #007bff;
    background-color: #e9ecef;
}

.upload-icon {
    font-size: 3em;
    margin-bottom: 15px;
    color: #007bff;
}

.browse-btn {
    background-color: #007bff;
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    display: inline-block;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.browse-btn:hover {
    background-color: #0069d9;
    transform: scale(1.05);
}

.preview-container {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 15px;
    position: relative;
    max-height: 300px;
}

.preview-placeholder {
    color: #6c757d;
    font-style: italic;
}

img, canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    margin: auto;
}

h1, h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #343a40;
    text-align: center;
}

.settings label {
    display: inline-block;
    margin-bottom: 5px;
    font-weight: 500;
}

.quality-line {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.quality-line label {
    margin-right: 10px;
}

.quality-line span {
    font-weight: bold;
    color: #343a40;
}

input[type="range"] {
    width: 100%;
    margin-bottom: 20px;
    accent-color: #007bff;
}

.edit-buttons {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 10px;
}

button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.3s ease;
    flex: 1;
}

button:hover {
    background-color: #218838;
    transform: scale(1.05);
}

button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

#cropBtn {
    background-color: #fd7e14;
}

#cropBtn:hover {
    background-color: #e76c00;
}

#compressBtn {
    background-color: #007bff;
    width: 100%;
    margin-top: 20px;
}

#compressBtn:hover {
    background-color: #0069d9;
}

.download-section {
    display: flex;
    flex-direction: column;
    margin-top: 20px;
    gap: 10px;
}

#fileName {
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 25px;
    transition: border-color 0.3s ease;
}

#fileName:focus {
    border-color: #007bff;
    outline: none;
}

select {
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 25px;
    background-color: white;
    transition: border-color 0.3s ease;
}

select:focus {
    border-color: #007bff;
    outline: none;
}

#downloadBtn {
    background-color: #28a745;
}

#downloadBtn:hover {
    background-color: #218838;
}

p {
    margin: 5px 0;
    font-size: 0.9em;
    color: #6c757d;
    text-align: center;
}

.info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.info-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
}

.info-card h2 {
    font-size: 1.4em;
    margin-bottom: 15px;
    color: #343a40;
    text-align: left;
}

.info-card p, .info-card ol {
    font-size: 1em;
    line-height: 1.6;
    color: #495057;
}

.info-card ol {
    padding-left: 20px;
}

.faq details {
    margin-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
}

.faq summary {
    cursor: pointer;
    font-weight: 500;
    color: #007bff;
    transition: color 0.3s ease;
}

.faq summary:hover {
    color: #0056b3;
}

.faq p {
    margin-top: 10px;
    color: #495057;
    text-align: left;
}

.content-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 25px;
    margin-bottom: 50px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input, .contact-form textarea {
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 25px;
}

.contact-form button {
    width: auto;
}

footer {
    background-color: #343a40;
    color: white;
    text-align: center;
    padding: 15px;
    margin-top: 40px;
    border-top: 3px solid #007bff;
}

footer ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 10px;
    padding: 0;
    list-style: none;
}

footer li {
    margin: 5px 10px;
}

footer a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #adb5bd;
}

@media (max-width: 768px) {
    main {
        padding: 15px;
    }

    .compressor {
        flex-direction: column;
        gap: 20px;
    }

    .left-column, .right-column {
        width: 100%;
        padding: 15px;
    }

    .settings {
        padding: 15px;
    }

    .preview-container {
        aspect-ratio: 16 / 9;
        height: auto;
        max-height: 200px;
    }

    .info-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .quality-line {
        flex-direction: column;
        align-items: flex-start;
    }

    .edit-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .edit-buttons button {
        width: 100%;
    }

    .download-section {
        flex-direction: column;
    }

    .download-section select {
        width: 100%;
    }

    footer ul {
        flex-direction: column;
    }

    .content-section {
        padding: 15px;
    }

    h1, h2 {
        font-size: 1.2em;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.5em;
    }

    header {
        padding: 10px;
    }

    button {
        padding: 10px;
    }

    input, select, textarea {
        font-size: 0.9em;
    }

    .upload-section {
        padding: 20px;
    }

    .preview-container {
        max-height: 150px;
    }

    .settings {
        padding: 10px;
    }
}