/* =========================================
   IMAGE ENHANCER
   ========================================= */

.tool-page {
    min-height: calc(100vh - 70px);
    padding: 50px 20px 80px;
    background: #f7f8fa;
}

.tool-page-container {
    width: min(1100px, 100%);
    margin: 0 auto;
}


/* =========================================
   HEADER
   ========================================= */

.tool-page-header {
    text-align: center;
    margin-bottom: 35px;
}

.section-label {
    display: inline-block;
    margin-bottom: 10px;
    color: #667085;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.6px;
}

.tool-page-header h1 {
    margin: 0;
    color: #172033;
    font-size: 38px;
    line-height: 1.15;
    font-weight: 700;
}

.tool-page-header p {
    max-width: 680px;
    margin: 14px auto 0;
    color: #667085;
    font-size: 15px;
    line-height: 1.7;
}


/* =========================================
   MAIN CARD
   ========================================= */

.enhancer-card {
    padding: 28px;
    border: 1px solid #e4e7ec;
    border-radius: 18px;
    background: #ffffff;
    box-shadow:
        0 8px 30px rgba(16, 24, 40, 0.06);
}


/* =========================================
   UPLOAD
   ========================================= */

.enhancer-upload {
    min-height: 300px;
    padding: 35px 20px;
    border: 1.5px dashed #cfd5df;
    border-radius: 14px;
    background: #fafbfc;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.enhancer-upload.drag-over {
    border-color: #667085;
    background: #f2f4f7;
    transform: translateY(-1px);
}

.enhancer-upload-icon {
    width: 62px;
    height: 62px;
    margin-bottom: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 16px;
    background: #eef1f5;

    color: #344054;
    font-size: 27px;
}

.enhancer-upload h2 {
    margin: 0;
    color: #172033;
    font-size: 21px;
}

.enhancer-upload p {
    margin: 8px 0 20px;
    color: #667085;
    font-size: 14px;
}

.upload-note {
    margin-top: 14px;
    color: #98a2b3;
    font-size: 12px;
}


/* =========================================
   BUTTONS
   ========================================= */

.primary-btn,
.secondary-btn {
    min-height: 44px;
    padding: 0 20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    font-size: 14px;
    font-weight: 600;

    text-decoration: none;
    cursor: pointer;

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.primary-btn {
    border: 0;
    background: var(--gp-gradient);
    color: #ffffff;
}

.primary-btn:hover {
    background: var(--gp-gradient-hover);
    transform: translateY(-1px);
    box-shadow:
        0 5px 14px rgba(0, 132, 250, 0.30);
}

.primary-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.secondary-btn {
    border: 1px solid #d0d5dd;
    background: #ffffff;
    color: #344054;
}

.secondary-btn:hover {
    background: #f9fafb;
}


/* =========================================
   FILE INFO
   ========================================= */

.enhancer-info {
    margin-top: 22px;
    padding: 20px;

    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;

    border: 1px solid #eaecf0;
    border-radius: 14px;
    background: #fcfcfd;
}

.enhancer-preview-box {
    height: 190px;

    overflow: hidden;

    border-radius: 10px;

    background:
        linear-gradient(
            45deg,
            #f2f4f7 25%,
            transparent 25%
        ),
        linear-gradient(
            -45deg,
            #f2f4f7 25%,
            transparent 25%
        ),
        linear-gradient(
            45deg,
            transparent 75%,
            #f2f4f7 75%
        ),
        linear-gradient(
            -45deg,
            transparent 75%,
            #f2f4f7 75%
        );

    background-size: 20px 20px;

    background-position:
        0 0,
        0 10px,
        10px -10px,
        -10px 0;

    display: flex;
    align-items: center;
    justify-content: center;
}

.enhancer-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.enhancer-file-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-content: center;
}

.enhancer-file-details > div {
    padding: 14px;

    border: 1px solid #eaecf0;
    border-radius: 10px;

    background: #ffffff;
}

.detail-label {
    display: block;
    margin-bottom: 5px;

    color: #98a2b3;

    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.enhancer-file-details strong {
    display: block;

    color: #344054;
    font-size: 13px;

    word-break: break-word;
}

.status-ready {
    color: #344054 !important;
}


/* =========================================
   ENHANCER ACTION
   ========================================= */

.enhancer-action {
    margin-top: 22px;
    padding: 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    border: 1px solid #eaecf0;
    border-radius: 14px;

    background: #ffffff;
}

.enhancer-action-info {
    display: flex;
    align-items: center;
    gap: 13px;
}

.action-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 11px;

    background: #eef1f5;
    color: #344054;

    font-size: 19px;
}

.enhancer-action-info strong {
    display: block;
    color: #344054;
    font-size: 14px;
}

.enhancer-action-info p {
    margin: 4px 0 0;
    color: #667085;
    font-size: 12px;
}

.enhance-btn {
    min-width: 160px;
}


/* =========================================
   LOADING
   ========================================= */

.enhancer-loading {
    padding: 45px 20px;
    text-align: center;
}

.loading-spinner {
    width: 38px;
    height: 38px;

    margin: 0 auto 18px;

    border: 3px solid #e4e7ec;
    border-top-color: #344054;
    border-radius: 50%;

    animation: enhancerSpin 0.8s linear infinite;
}

@keyframes enhancerSpin {
    to {
        transform: rotate(360deg);
    }
}

.enhancer-loading h3 {
    margin: 0;
    color: #172033;
    font-size: 17px;
}

.enhancer-loading p {
    margin: 7px 0 0;
    color: #667085;
    font-size: 13px;
}


/* =========================================
   RESULT
   ========================================= */

.enhancer-result {
    margin-top: 24px;
    padding: 24px;

    border: 1px solid #eaecf0;
    border-radius: 14px;

    background: #fcfcfd;
}

.result-heading {
    margin-bottom: 22px;
}

.result-heading h2 {
    margin: 0;
    color: #172033;
    font-size: 22px;
}

.result-comparison {
    display: grid;
    grid-template-columns: 1fr 45px 1fr;
    align-items: center;
    gap: 15px;
}

.result-image-box {
    min-width: 0;
}

.result-image-label {
    margin-bottom: 8px;

    color: #667085;

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}

.result-image-wrapper {
    height: 300px;

    overflow: hidden;

    border: 1px solid #e4e7ec;
    border-radius: 12px;

    background:
        linear-gradient(
            45deg,
            #f2f4f7 25%,
            transparent 25%
        ),
        linear-gradient(
            -45deg,
            #f2f4f7 25%,
            transparent 25%
        ),
        linear-gradient(
            45deg,
            transparent 75%,
            #f2f4f7 75%
        ),
        linear-gradient(
            -45deg,
            transparent 75%,
            #f2f4f7 75%
        );

    background-size: 20px 20px;

    background-position:
        0 0,
        0 10px,
        10px -10px,
        -10px 0;

    display: flex;
    align-items: center;
    justify-content: center;
}

.result-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.result-arrow {
    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #eef1f5;
    color: #344054;

    font-size: 18px;
}

.result-dimensions {
    margin-top: 9px;

    color: #667085;

    font-size: 12px;
    text-align: center;
}


/* =========================================
   RESULT META
   ========================================= */

.result-meta {
    margin-top: 22px;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.result-meta > div {
    padding: 13px;

    border: 1px solid #eaecf0;
    border-radius: 9px;

    background: #ffffff;

    text-align: center;
}

.result-meta span {
    display: block;
    margin-bottom: 5px;

    color: #98a2b3;
    font-size: 11px;
}

.result-meta strong {
    color: #344054;
    font-size: 14px;
}


/* =========================================
   RESULT ACTIONS
   ========================================= */

.result-actions {
    margin-top: 22px;

    display: flex;
    justify-content: center;
    align-items: center;

    gap: 10px;

    flex-wrap: wrap;
}


/* =========================================
   ERROR
   ========================================= */

.enhancer-error {
    margin-top: 20px;
    padding: 15px 17px;

    display: flex;
    align-items: flex-start;
    gap: 12px;

    border: 1px solid #e4e7ec;
    border-radius: 10px;

    background: #fafafa;
}

.error-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #eef1f5;
    color: #344054;

    font-weight: 700;
}

.enhancer-error strong {
    color: #344054;
    font-size: 13px;
}

.enhancer-error p {
    margin: 4px 0 0;

    color: #667085;
    font-size: 12px;
}


/* =========================================
   INFORMATION
   ========================================= */

.enhancer-information {
    margin-top: 45px;
}

.enhancer-information h2 {
    margin: 0;

    color: #172033;
    font-size: 26px;
}

.enhancer-information > p {
    max-width: 750px;

    margin: 10px 0 25px;

    color: #667085;
    font-size: 14px;
    line-height: 1.7;
}

.enhancer-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.feature-item {
    padding: 18px;

    border: 1px solid #e4e7ec;
    border-radius: 12px;

    background: #ffffff;
}

.feature-item strong {
    display: block;

    color: #344054;
    font-size: 14px;
}

.feature-item span {
    display: block;

    margin-top: 6px;

    color: #667085;
    font-size: 12px;
    line-height: 1.5;
}


/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 800px) {

    .tool-page {
        padding: 35px 15px 60px;
    }

    .tool-page-header h1 {
        font-size: 30px;
    }

    .enhancer-card {
        padding: 18px;
    }

    .enhancer-info {
        grid-template-columns: 1fr;
    }

    .enhancer-preview-box {
        height: 220px;
    }

    .enhancer-action {
        align-items: stretch;
        flex-direction: column;
    }

    .enhance-btn {
        width: 100%;
    }

    .result-comparison {
        grid-template-columns: 1fr;
    }

    .result-arrow {
        margin: 0 auto;
        transform: rotate(90deg);
    }

    .result-meta {
        grid-template-columns: 1fr;
    }

    .enhancer-features {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 520px) {

    .tool-page-header h1 {
        font-size: 26px;
    }

    .enhancer-upload {
        min-height: 260px;
        padding: 25px 15px;
    }

    .enhancer-file-details {
        grid-template-columns: 1fr;
    }

    .result-image-wrapper {
        height: 240px;
    }

    .result-actions {
        flex-direction: column;
    }

    .result-actions .primary-btn,
    .result-actions .secondary-btn {
        width: 100%;
    }
}


/* The HTML "hidden" attribute must win over the display rules above,
   otherwise the preview, error and result boxes are all visible on load. */
[hidden] {
    display: none !important;
}
