/* =========================================
   PAGE LAYOUT (same pattern the other tool pages use)
   ========================================= */

.tool-page {
    min-height: calc(100vh - 70px);
    padding: 50px 20px 80px;
    background: #f7f8fa;
}

.tool-page-container {
    width: min(860px, 100%);
    margin: 0 auto;
}

.tool-page-header {
    text-align: center;
    margin-bottom: 35px;
}

.tool-page-header .section-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.6px;
    color: #667085;
    margin-bottom: 10px;
}

.tool-page-header h1 {
    margin: 0;
    font-size: 38px;
    line-height: 1.15;
    font-weight: 700;
    color: #172033;
}

.tool-page-header p {
    max-width: 650px;
    margin: 14px auto 0;
    color: #667085;
    font-size: 15px;
    line-height: 1.7;
}

@media (max-width: 640px) {

    .tool-page {
        padding: 36px 16px 60px;
    }

    .tool-page-header h1 {
        font-size: 28px;
    }
}


/* =========================================================
   FORMAT CONVERTER (shared by every /xxx-to-yyy page)
========================================================= */

.format-converter-card {
    background: #ffffff;
    border: 1px solid var(--gp-border, #e4e7ec);
    border-radius: 16px;
    box-shadow: var(--gp-shadow, 0 10px 30px rgba(16, 24, 40, 0.06));
    padding: 32px;
    margin-bottom: 40px;
}


/* ---------------------------------------------------------
   UPLOAD AREA
--------------------------------------------------------- */

.format-upload-area {
    border: 2px dashed #d0d5dd;
    border-radius: 14px;
    padding: 48px 24px;
    text-align: center;
    background: #f9fafb;
    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.format-upload-area.drag-over {
    border-color: var(--gp-blue, #0084fa);
    background: var(--gp-bg-tint, #eef6ff);
}

.format-upload-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--gp-bg-tint, #eef6ff);
    color: var(--gp-blue, #0084fa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.format-upload-area h2 {
    margin: 0 0 6px;
    font-size: 18px;
    color: #172033;
}

.format-upload-area p {
    margin: 0 0 20px;
    color: #667085;
    font-size: 14px;
}

.format-upload-area .primary-btn {
    border: 0;
    cursor: pointer;
}

.format-upload-hint {
    display: block;
    margin-top: 14px;
    color: #98a2b3;
    font-size: 12px;
}


/* ---------------------------------------------------------
   FILE LIST
--------------------------------------------------------- */

.format-file-list {
    margin-top: 20px;
    display: grid;
    gap: 10px;
}

.format-file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid #e4e7ec;
    border-radius: 10px;
    background: #f9fafb;
}

.format-file-row-info {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.format-file-row-info strong {
    font-size: 13.5px;
    color: #172033;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.format-file-row-info span {
    font-size: 12px;
    color: #98a2b3;
}

.format-file-remove {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #e4e7ec;
    background: #ffffff;
    color: #667085;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.format-file-remove:hover {
    border-color: #f04438;
    color: #f04438;
}


/* ---------------------------------------------------------
   NOTE
--------------------------------------------------------- */

.format-note {
    margin: 16px 2px 0;
    color: #667085;
    font-size: 13px;
}


/* ---------------------------------------------------------
   ERROR
--------------------------------------------------------- */

.format-error {
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fecdca;
}

.format-error strong {
    display: block;
    color: #b42318;
    font-size: 13.5px;
    margin-bottom: 2px;
}

.format-error p {
    margin: 0;
    color: #b42318;
    font-size: 13px;
}


/* ---------------------------------------------------------
   ACTIONS
--------------------------------------------------------- */

.format-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.format-actions .primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* ---------------------------------------------------------
   RESULT
--------------------------------------------------------- */

.format-result {
    text-align: center;
    padding: 20px 10px 6px;
}

.format-result-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--gp-gradient, linear-gradient(135deg, #00adf3 0%, #0084fa 52%, #0058d6 100%));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.format-result h3 {
    margin: 0 0 4px;
    color: #172033;
    font-size: 18px;
}

.format-result > p {
    margin: 0 0 20px;
    color: #667085;
    font-size: 14px;
}

.format-result-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.format-result-actions .primary-btn {
    text-decoration: none;
}


/* The HTML "hidden" attribute must win over the display rules above,
   otherwise sections meant to stay hidden can show up at once. */
[hidden] {
    display: none !important;
}


/* ---------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------- */

@media (max-width: 640px) {

    .format-converter-card {
        padding: 22px;
    }

    .format-upload-area {
        padding: 34px 16px;
    }

    .format-actions {
        flex-direction: column-reverse;
    }

    .format-actions .primary-btn,
    .format-actions .secondary-btn {
        width: 100%;
    }

    .format-result-actions {
        flex-direction: column;
    }

    .format-result-actions .primary-btn,
    .format-result-actions .secondary-btn {
        width: 100%;
    }
}
