/* tools/media-tools/image-compressor/style.css - Tool-specific styles */

.form-control-file {
    display: block;
    width: 100%;
    padding: 10px 15px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--color-dark-gray);
    background-color: var(--color-white);
    background-clip: padding-box;
    border: 1px solid var(--color-light-gray-2);
    border-radius: var(--border-radius-small);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    cursor: pointer;
}

.form-control-file:hover {
    border-color: var(--color-teal);
}

.form-control-file:focus {
    border-color: var(--color-teal);
    box-shadow: 0 0 0 0.2rem rgba(0, 128, 128, 0.25);
    outline: none;
}

.form-range {
    width: 100%;
    height: 25px;
    background: transparent; /* Needed for Safari */
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: 10px;
}

/* Track styles */
.form-range::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    background: var(--color-light-gray-2);
    border-radius: 4px;
    border: 0.2px solid var(--color-border);
}
.form-range::-moz-range-track {
    width: 100%;
    height: 8px;
    background: var(--color-light-gray-2);
    border-radius: 4px;
    border: 0.2px solid var(--color-border);
}
.form-range::-ms-track {
    width: 100%;
    height: 8px;
    background: transparent;
    border-color: transparent;
    border-width: 6px 0;
    color: transparent;
}

/* Thumb styles */
.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    border: 1px solid var(--color-teal);
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--color-teal);
    cursor: pointer;
    margin-top: -6.5px; /* Centers thumb vertically */
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
}
.form-range::-moz-range-thumb {
    border: 1px solid var(--color-teal);
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--color-teal);
    cursor: pointer;
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
}
.form-range::-ms-thumb {
    border: 1px solid var(--color-teal);
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--color-teal);
    cursor: pointer;
    box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
}

/* Focus styles for thumb */
.form-range:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 0.2rem rgba(0, 128, 128, 0.25);
}
.form-range:focus::-moz-range-thumb {
    box-shadow: 0 0 0 0.2rem rgba(0, 128, 128, 0.25);
}
.form-range:focus::-ms-thumb {
    box-shadow: 0 0 0 0.2rem rgba(0, 128, 128, 0.25);
}

/* Output Section */
#outputSection {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed var(--color-light-gray-2);
}

.image-preview-container {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 20px;
    justify-content: center;
    margin-top: 20px;
}

.image-box {
    flex: 1 1 300px; /* Flex-grow, flex-shrink, basis */
    background-color: var(--color-white);
    border: 1px solid var(--color-light-gray-2);
    border-radius: var(--border-radius-medium);
    padding: 15px;
    text-align: center;
    box-shadow: var(--shadow-small);
    min-width: 280px; /* Ensure a minimum width for small screens */
}

.image-box h5 {
    color: var(--color-primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.img-preview {
    max-width: 100%;
    height: auto;
    max-height: 200px; /* Limit height of preview */
    display: block; /* Remove extra space below image */
    margin: 0 auto 15px auto; /* Center image and add space below */
    border: 1px solid var(--color-light-gray-2);
    border-radius: var(--border-radius-small);
    background-color: #f9f9f9; /* Placeholder background */
    object-fit: contain; /* Ensure image fits without cropping */
}

.file-size-info {
    font-size: 0.9rem;
    color: var(--color-dark-gray);
    margin-bottom: 15px;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .image-preview-container {
        flex-direction: column;
        align-items: center;
    }
    .image-box {
        width: 100%;
        max-width: 400px; /* Constrain width on smaller screens */
    }
}