/* =========================================
   IMAGE RESIZER
   ========================================= */

.tool-page {
    width: 100%;
    padding: 55px 20px 80px;
}

.tool-page-container {
    width: 100%;
    max-width: 1050px;
    margin: 0 auto;
}


/* =========================================
   PAGE HEADER
   ========================================= */

.tool-page-header {
    text-align: center;
    margin-bottom: 35px;
}

.section-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--gp-muted);
    margin-bottom: 10px;
}

.tool-page-header h1 {
    margin: 0;
    font-size: 42px;
    line-height: 1.15;
    font-weight: 750;
    color: var(--gp-navy);
}

.tool-page-header p {
    max-width: 650px;
    margin: 14px auto 0;
    font-size: 16px;
    line-height: 1.7;
    color: var(--gp-muted);
}


/* =========================================
   MAIN RESIZER CARD
   ========================================= */

.resizer-card {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--gp-border);
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0, 33, 74, 0.06);
}


/* =========================================
   UPLOAD AREA
   ========================================= */

.resizer-upload {
    border: 1.5px dashed var(--gp-border-2);
    border-radius: 14px;
    min-height: 300px;
    padding: 45px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--gp-bg-soft);
    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.resizer-upload:hover {
    border-color: var(--gp-muted-2);
    background: var(--gp-bg-soft);
}

.resizer-upload.drag-over {
    border-color: var(--gp-blue);
    background: var(--gp-bg-tint);
    transform: translateY(-1px);
}


/* =========================================
   UPLOAD ICON
   ========================================= */

.resizer-icon {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid var(--gp-border);
    color: var(--gp-blue);
    font-size: 30px;
    font-weight: 600;
    margin-bottom: 18px;
}

.resizer-upload h2 {
    margin: 0;
    font-size: 21px;
    font-weight: 700;
    color: var(--gp-navy);
}

.resizer-upload p {
    margin: 8px 0 20px;
    font-size: 14px;
    color: var(--gp-muted);
}

.upload-limit {
    margin-top: 15px;
    font-size: 12px;
    color: var(--gp-muted-2);
}


/* =========================================
   PRIMARY BUTTON
   ========================================= */

.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: 9px;
    background: var(--gp-gradient);
    color: #ffffff;
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.primary-btn:hover {
    background: var(--gp-gradient-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(0, 33, 74, 0.15);
}


/* =========================================
   SELECTED IMAGE INFORMATION
   ========================================= */

.resizer-info {
    display: none;
    align-items: center;
    gap: 20px;
    margin-top: 22px;
    padding: 16px;
    border: 1px solid var(--gp-border);
    border-radius: 13px;
    background: var(--gp-bg-soft);
}

.resizer-info.show {
    display: flex;
}

.resizer-preview {
    width: 100px;
    height: 80px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 9px;
    border: 1px solid var(--gp-border);
    background: var(--gp-bg-tint);
}

.resizer-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.resizer-file-info {
    min-width: 0;
}

.file-status {
    display: inline-block;
    margin-bottom: 5px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #16a34a;
}

.resizer-file-info h3 {
    margin: 0;
    max-width: 600px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 650;
    color: var(--gp-navy);
}

.resizer-file-info p {
    margin: 5px 0 0;
    font-size: 13px;
    color: var(--gp-muted);
}


/* =========================================
   RESIZE SETTINGS
   ========================================= */

.resize-settings {
    display: none;
    margin-top: 24px;
    padding: 24px;
    border: 1px solid var(--gp-border);
    border-radius: 14px;
    background: #ffffff;
}

.resize-settings.show {
    display: block;
}

.dimensions-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--gp-navy);
}

.dimensions-header p {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--gp-muted);
}


/* =========================================
   DIMENSION INPUTS
   ========================================= */

.dimension-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.dimension-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 650;
    color: var(--gp-text-2);
}

.input-unit {
    display: flex;
    align-items: center;
    width: 100%;
    height: 46px;
    overflow: hidden;
    border: 1px solid var(--gp-border-2);
    border-radius: 9px;
    background: #ffffff;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.input-unit:focus-within {
    border-color: var(--gp-blue);
    box-shadow: 0 0 0 3px rgba(0, 132, 250, 0.16);
}

.input-unit input {
    width: 100%;
    height: 100%;
    min-width: 0;
    padding: 0 13px;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--gp-navy);
    font-size: 14px;
}

.input-unit input::placeholder {
    color: var(--gp-muted-2);
}

.input-unit span {
    flex-shrink: 0;
    padding: 0 13px;
    border-left: 1px solid var(--gp-border);
    color: var(--gp-muted);
    font-size: 13px;
    background: var(--gp-bg-soft);
    height: 100%;
    display: flex;
    align-items: center;
}


/* =========================================
   KEEP ASPECT RATIO
   ========================================= */

.aspect-option {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 18px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--gp-text-2);
}

.aspect-option input {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--gp-blue);
}


/* =========================================
   RESIZE BUTTON
   ========================================= */

.resize-button {
    width: 100%;
    height: 50px;
    margin-top: 24px;
    border: 0;
    border-radius: 10px;
    background: var(--gp-gradient);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.resize-button:hover:not(:disabled) {
    background: var(--gp-gradient-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 33, 74, 0.14);
}

.resize-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}


/* =========================================
   LOADING
   ========================================= */

.resizer-loading {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    padding: 28px 10px 5px;
}

.resizer-loading.show {
    display: flex;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--gp-border);
    border-top-color: var(--gp-blue);
    border-radius: 50%;
    animation: resizerSpin 0.8s linear infinite;
}

.resizer-loading p {
    margin: 0;
    font-size: 13px;
    color: var(--gp-muted);
}

@keyframes resizerSpin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================
   RESULT
   ========================================= */

.resizer-result {
    display: none;
    margin-top: 24px;
    padding: 30px;
    border: 1px solid #dcfce7;
    border-radius: 14px;
    background: #f0fdf4;
    text-align: center;
}

.resizer-result.show {
    display: block;
}

.result-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #bbf7d0;
    color: #16a34a;
    font-size: 24px;
    font-weight: 700;
}

.resizer-result h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #166534;
}

.resizer-result p {
    margin: 8px auto 0;
    max-width: 600px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gp-text-2);
}

.result-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}


/* =========================================
   SECONDARY BUTTON
   ========================================= */

.secondary-btn {
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid var(--gp-border-2);
    border-radius: 9px;
    background: #ffffff;
    color: var(--gp-text-2);
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.secondary-btn:hover {
    background: var(--gp-bg-soft);
    border-color: var(--gp-muted-2);
}


/* =========================================
   INFORMATION SECTION
   ========================================= */

.tool-information {
    margin-top: 45px;
}

.tool-information h2 {
    margin: 0 0 12px;
    font-size: 25px;
    font-weight: 700;
    color: var(--gp-navy);
}

.tool-information > p {
    max-width: 850px;
    margin: 0;
    font-size: 15px;
    line-height: 1.8;
    color: var(--gp-muted);
}

.information-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 25px;
}

.information-grid > div {
    padding: 20px;
    border: 1px solid var(--gp-border);
    border-radius: 12px;
    background: #ffffff;
}

.information-grid h3 {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: var(--gp-navy);
}

.information-grid p {
    margin: 0;
    font-size: 13px;
    line-height: 1.7;
    color: var(--gp-muted);
}


/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 768px) {

    .tool-page {
        padding: 40px 15px 60px;
    }

    .tool-page-header h1 {
        font-size: 34px;
    }

    .tool-page-header p {
        font-size: 14px;
    }

    .resizer-card {
        padding: 18px;
        border-radius: 14px;
    }

    .resizer-upload {
        min-height: 270px;
        padding: 35px 18px;
    }

    .dimension-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .information-grid {
        grid-template-columns: 1fr;
    }

    .resizer-info {
        align-items: flex-start;
    }

    .resizer-preview {
        width: 85px;
        height: 70px;
    }

}


@media (max-width: 480px) {

    .tool-page-header h1 {
        font-size: 29px;
    }

    .resizer-upload h2 {
        font-size: 18px;
    }

    .resizer-upload p {
        font-size: 13px;
    }

    .resizer-info {
        gap: 12px;
        padding: 12px;
    }

    .resizer-file-info h3 {
        max-width: 190px;
    }

    .resize-settings {
        padding: 18px;
    }

    .result-actions {
        flex-direction: column;
    }

    .result-actions .primary-btn,
    .result-actions .secondary-btn {
        width: 100%;
    }

}