* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}


body {
    font-family: Arial, Helvetica, sans-serif;

    background: #08090d;

    color: #ffffff;

    min-height: 100vh;
}


/* ================================
   HEADER
================================ */

.topbar {

    height: 72px;

    display: flex;

    align-items: center;

    gap: 15px;

    padding: 0 20px;

    border-bottom: 1px solid #1c1e26;

    background: #0c0d12;
}


.back-btn {

    width: 42px;
    height: 42px;

    display: flex;

    align-items: center;
    justify-content: center;

    color: white;

    text-decoration: none;

    border: 1px solid #282b35;

    border-radius: 12px;

    font-size: 24px;

    transition: 0.2s;
}


.back-btn:hover {

    background: #171923;
}


.topbar h1 {

    font-size: 20px;
}


.topbar p {

    color: #8d91a0;

    font-size: 12px;

    margin-top: 3px;
}


/* ================================
   CONTAINER
================================ */

.container {

    width: 100%;

    max-width: 900px;

    margin: auto;

    padding: 30px 18px 60px;
}


.tool-box {

    background: #101218;

    border: 1px solid #20232d;

    border-radius: 22px;

    padding: 30px;
}


.icon {

    font-size: 48px;

    margin-bottom: 15px;
}


.tool-box h2 {

    font-size: 28px;

    margin-bottom: 10px;
}


.description {

    color: #9da1ae;

    line-height: 1.6;

    margin-bottom: 25px;
}


/* ================================
   UPLOAD
================================ */

.upload-area {

    min-height: 190px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    border: 2px dashed #343844;

    border-radius: 18px;

    cursor: pointer;

    transition: 0.2s;
}


.upload-area:hover,
.upload-area.dragging {

    border-color: #73b4ff;

    background: #111421;
}


.upload-icon {

    font-size: 42px;

    margin-bottom: 12px;
}


.upload-area strong {

    font-size: 18px;
}


.upload-area span {

    color: #858997;

    font-size: 14px;

    margin-top: 7px;
}


/* ================================
   OPTIONS
================================ */

.options {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 15px;

    margin-top: 20px;
}


.options label {

    color: #aeb2bf;

    font-size: 14px;
}


select {

    width: 100%;

    margin-top: 8px;

    padding: 13px;

    border-radius: 10px;

    border: 1px solid #2a2d37;

    background: #171922;

    color: white;

    outline: none;
}


/* ================================
   FILE INFO
================================ */

.file-info {

    margin-top: 20px;

    padding: 14px;

    background: #171922;

    border: 1px solid #292c36;

    border-radius: 12px;

    color: #c5c8d1;

    display: none;

    line-height: 1.6;
}


/* ================================
   CONVERT BUTTON
================================ */

.convert-btn {

    width: 100%;

    margin-top: 20px;

    padding: 15px;

    border: none;

    border-radius: 12px;

    background: #ffffff;

    color: #08090d;

    font-size: 16px;

    font-weight: bold;

    cursor: pointer;

    transition: 0.2s;
}


.convert-btn:hover:not(:disabled) {

    transform: translateY(-1px);
}


.convert-btn:disabled {

    opacity: 0.35;

    cursor: not-allowed;
}


/* ================================
   PROGRESS
================================ */

.progress-box {

    margin-top: 22px;
}


.progress-text {

    display: flex;

    justify-content: space-between;

    color: #aeb2bf;

    font-size: 13px;

    margin-bottom: 8px;
}


.progress-bar {

    width: 100%;

    height: 9px;

    background: #20232d;

    border-radius: 20px;

    overflow: hidden;
}


#progressFill {

    width: 0%;

    height: 100%;

    background: #ffffff;

    transition: width 0.2s;
}


/* ================================
   BATCH CONTROLS
================================ */

.batch-controls {

    margin-top: 28px;

    padding: 20px;

    background: #171922;

    border: 1px solid #292c36;

    border-radius: 16px;
}


.selection-header {

    display: flex;

    justify-content: space-between;

    margin-bottom: 15px;
}


.selection-header h3 {

    font-size: 18px;

    margin-bottom: 5px;
}


.selection-header p {

    color: #858997;

    font-size: 13px;
}


.selection-buttons {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 10px;

    margin-bottom: 12px;
}


.secondary-btn {

    padding: 11px;

    border-radius: 10px;

    border: 1px solid #343844;

    background: #101218;

    color: white;

    cursor: pointer;

    font-size: 14px;
}


.secondary-btn:hover {

    background: #20232d;
}


.download-actions {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 10px;
}


.action-btn {

    padding: 13px;

    border: none;

    border-radius: 10px;

    background: #ffffff;

    color: #08090d;

    font-weight: bold;

    cursor: pointer;

    transition: 0.2s;
}


.action-btn:hover {

    transform: translateY(-1px);
}


.action-btn:disabled {

    opacity: 0.35;

    cursor: not-allowed;

    transform: none;
}


/* ================================
   RESULTS
================================ */

.results {

    margin-top: 25px;

    display: grid;

    gap: 18px;
}


.result-card {

    position: relative;

    background: #171922;

    border: 1px solid #292c36;

    border-radius: 16px;

    padding: 15px;
}


.result-top {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    margin-bottom: 12px;
}


.page-select {

    display: flex;

    align-items: center;

    gap: 10px;

    cursor: pointer;

    color: #d9dbe2;

    font-size: 14px;
}


.page-checkbox {

    width: 20px;
    height: 20px;

    accent-color: #ffffff;

    cursor: pointer;
}


.result-card img {

    width: 100%;

    display: block;

    border-radius: 10px;

    background: white;
}


.result-bottom {

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 12px;

    margin-top: 12px;
}


.page-name {

    color: #bfc2cc;

    font-size: 14px;
}


.download-btn {

    border: none;

    background: white;

    color: #08090d;

    padding: 9px 14px;

    border-radius: 9px;

    font-weight: bold;

    cursor: pointer;
}


.download-btn:hover {

    opacity: 0.85;
}


/* Selected page */

.result-card.selected {

    border-color: #ffffff;

    box-shadow: 0 0 0 1px #ffffff;
}


/* ================================
   HIDDEN
================================ */

.hidden {

    display: none;
}


/* ================================
   MOBILE
================================ */

@media (max-width: 600px) {

    .container {

        padding: 18px 12px 40px;
    }


    .tool-box {

        padding: 20px;

        border-radius: 18px;
    }


    .tool-box h2 {

        font-size: 23px;
    }


    .options {

        grid-template-columns: 1fr;
    }


    .upload-area {

        min-height: 170px;
    }


    .selection-buttons {

        grid-template-columns: 1fr;
    }


    .download-actions {

        grid-template-columns: 1fr;
    }


    .result-bottom {

        flex-direction: column;

        align-items: stretch;
    }


    .download-btn {

        width: 100%;
    }

}