/**
 * FRQ Image Converter Stylesheet (v1.0 - Original Stable)
 * Version: 1.1.0
 * Author: FRQ TOOLS
 */

:root {
    --frq-primary-color: #007cba;
    --frq-primary-hover: #005a87;
    --frq-secondary-color: #6c757d;
    --frq-secondary-hover: #5a6268;
    --frq-border-color: #ccd0d4;
    --frq-bg-light: #f6f7f7;
    --frq-text-color: #3c434a;
    --frq-error-color: #d63638;
    --frq-error-bg: #fbeaea;
}

.frq-converter-wrapper {
    max-width: 800px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--frq-text-color);
    border: 1px solid var(--frq-border-color);
    border-radius: 8px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
    background: #fff;
    padding: 2em;
}

/* ADD THIS NEW RULE FOR THE HEADER CONTAINER */
.frq-converter-header {
    text-align: center; /* This will center the h2 and p inside it */
}

.frq-converter-header h2 {
    margin-top: 0;
    font-size: 24px;
    color: #1d2327;
}

.frq-converter-header p {
    font-size: 16px;
    color: var(--frq-secondary-color);
    margin-bottom: 2em;
}

.frq-upload-area {
    border: 3px dashed var(--frq-border-color);
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background-color: var(--frq-bg-light);
    transition: all 0.3s ease;
    cursor: pointer;
}

.frq-upload-area.drag-over {
    border-color: var(--frq-primary-color);
    background-color: #eaf5fa;
}

.frq-upload-area .frq-upload-content svg {
    fill: var(--frq-primary-color);
    margin-bottom: 15px;
}

.frq-upload-area p {
    margin: 5px 0 15px;
}

.frq-upload-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--frq-primary-color);
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.frq-upload-button:hover {
    background-color: var(--frq-primary-hover);
}

.frq-controls,
.frq-previews-area {
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0s 0s, height 0.4s ease, padding 0.4s ease, margin 0.4s ease;
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.frq-controls.hidden,
.frq-previews-area.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    overflow: hidden;
    transition: opacity 0.4s ease, transform 0.4s ease, visibility 0s 0.4s, height 0.4s ease, padding 0.4s ease, margin 0.4s ease;
}

.frq-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background-color: var(--frq-bg-light);
    border-radius: 8px;
}

#frq-output-format {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid var(--frq-border-color);
    font-size: 14px;
}

.frq-previews-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.frq-preview-box {
    border: 1px solid var(--frq-border-color);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.frq-preview-box h3 {
    margin-top: 0;
    font-size: 18px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.frq-preview-box img {
    max-width: 100%;
    height: 200px;
    object-fit: contain;
    background-color: var(--frq-bg-light);
    border-radius: 4px;
}

.frq-file-info {
    margin-top: 10px;
    font-size: 13px;
    color: var(--frq-secondary-color);
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
}

.frq-button-primary {
    padding: 10px 25px;
    background-color: var(--frq-primary-color);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.frq-button-primary:hover:not(:disabled) {
    background-color: var(--frq-primary-hover);
}

.frq-button-primary:disabled {
    background-color: var(--frq-secondary-color);
    cursor: not-allowed;
}

.frq-button-primary .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -9px;
    margin-top: -9px;
}

.frq-button-primary.loading .button-text {
    visibility: hidden;
}

.frq-button-primary.loading .spinner {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.frq-button-secondary {
    display: inline-block;
    text-decoration: none;
    margin-top: 15px;
    padding: 10px 20px;
    background-color: var(--frq-secondary-color);
    color: #fff;
    border-radius: 5px;
    border: none;
    font-size: 14px;
    font-family: inherit;
    font-weight: bold;
    transition: background-color 0.2s;
    cursor: pointer;
}

.frq-button-secondary:hover {
    background-color: var(--frq-secondary-hover);
    color: #fff;
}

.frq-message {
    padding: 15px;
    margin: 20px 0 0 0;
    border-radius: 5px;
    border: 1px solid transparent;
}

.frq-message-error {
    color: var(--frq-error-color);
    background-color: var(--frq-error-bg);
    border-color: var(--frq-error-color);
}

@media (max-width: 600px) {
    .frq-previews-area {
        grid-template-columns: 1fr;
    }

    .frq-controls {
        flex-direction: column;
    }
}