
  body{
    margin:0;
    font-family:Arial, sans-serif;
    background: #f5f5fa;
    direction:rtl;
}
      
     


.controls{
    display:flex;
    gap:10px;
    align-items:center;
}

select, input{
    padding:8px;
    border-radius:10px;
    border:1px solid #ddd;
    outline:none;
}

/* UPLOAD */


.downloader__btn,
.uploader__btn{

    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:14px;

    width:360px;
    max-width:95%;

    height:74px;

    background: #e5322d;
    color:#fff;

    border:none;
    border-radius:22px;

    cursor:pointer;

    font-size:22px;
    font-weight:700;
    letter-spacing:.3px;

    user-select:none;

    position:relative;
    overflow:hidden;

    transition:
        transform .25s ease,
        box-shadow .25s ease,
        background .25s ease;

    box-shadow:
        0 10px 24px rgba(229,50,45,.25),
        inset 0 -3px 0 rgba(0,0,0,.12);
}

/* الشريط المضيء */
.downloader__btn::before,
.uploader__btn::before{

    content:"";

    position:absolute;

    top:0;
    left:-120%;

    width:70%;
    height:100%;

    background:linear-gradient(
        115deg,
        transparent,
        rgba(255,255,255,.28),
        transparent
    );

    transform:skewX(-25deg);

    transition:left .7s;
}

.downloader__btn:hover::before,
.uploader__btn:hover::before{

    left:150%;
}

/* Hover */

.downloader__btn:hover,
.uploader__btn:hover{

    transform:translateY(-4px);

    box-shadow:
        0 18px 36px rgba(229,50,45,.35),
        inset 0 -3px 0 rgba(0,0,0,.12);
}

/* ضغط الزر */

.downloader__btn:active,
.uploader__btn:active{

    transform:translateY(0) scale(.98);

    box-shadow:
        0 6px 16px rgba(229,50,45,.25),
        inset 0 3px 8px rgba(0,0,0,.15);
}

.upload-wrapper{

    display:flex;
    justify-content:center;
    margin:40px 0;
}
.upload-zone{

    max-width:900px;
    margin:30px auto;
    padding:45px 30px;

    border:2px dashed #d9d9d9;
    border-radius:22px;

    background:#fff;

    transition:.25s;

    text-align:center;
}

.upload-zone.dragover{

    border-color:#e5322d;

    background:#fff4f4;

    transform:scale(1.01);

    box-shadow:0 10px 30px rgba(229,50,45,.15);
}

.drop-text{

    margin-top:18px;

    color:#777;

    font-size:15px;
}

/* GRID */
.grid{
    max-width:1200px;
    margin:auto;
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
    gap:16px;
    padding:0 10px;
}

/* CARD */
.page{
    background:#fff;
    border-radius:16px;
    box-shadow:0 6px 18px rgba(0,0,0,0.08);
    position:relative;
    overflow:hidden;
    cursor:default;
    transition:0.25s ease;
}

.page:hover{
    transform:translateY(-4px);
    box-shadow:0 12px 30px rgba(0,0,0,0.12);
}

.page:active{
    cursor:grabbing;
}

/* drag effect */
.dragging{
    opacity:0.5;
    transform:scale(0.95);
}

.pagenum{
    position:absolute;
    top:10px;
    right:10px;
    width:28px;
    height:28px;
    background:#111;
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:50%;
    font-size:13px;
    z-index:2;
    box-shadow:0 4px 10px rgba(0,0,0,0.2);
}

.page img{
    width:100%;
    height:260px;
    object-fit:contain;
    background:#f8f9fb;
    transition:0.3s;
}

/* MODES */
.page.horizontal img{height:180px;}
.page.vertical img{height:320px;}
.page.auto img{height:260px;}

/* ACTIONS */
.actions{
    display:flex;
    justify-content:space-between;
    padding:10px;
    background:#fff;
    border-top:1px solid #eee;
}

.btn{
    border:none;
    padding:7px 10px;
    border-radius:8px;
    cursor:pointer;
    font-size:12px;
    transition:0.2s;
}

.btn:hover{
    transform:scale(1.05);
}

.del{background:#e74c3c;color:#fff;}
.rot{background:#2c2c2c;color:#fff;}
.view{background:#2980b9;color:#fff;}

/* ADD CARD */
.add-card{
    border:2px dashed #4a90e2;
    background:linear-gradient(145deg,#f5f9ff,#eaf2ff);
    transition:0.25s;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-direction:column;
    font-size:42px;
    color:#4a90e2;
    font-weight:bold;
}

.add-card:hover{
    background:#e6f0ff;
    transform:scale(1.05);
}

/* FOOTER */


.convert{
  background:#e5322d;
    color:#fff;
    padding:14px 24px;
    border:none;
    border-radius:12px;
    cursor:pointer;
    font-size:16px;
    box-shadow:0 6px 18px rgba(40,167,69,0.25);
    transition:0.25s;
}

.convert:hover{
    transform:translateY(-2px);
    box-shadow:0 10px 25px rgba(40,167,69,0.35);
}

/* MODAL */
.modal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.85);
    display:none;
    justify-content:center;
    align-items:center;
    z-index:999;
}

.modal img{
    max-width:92%;
    max-height:92%;
    border-radius:10px;
    box-shadow:0 10px 40px rgba(0,0,0,0.5);
}

/* PROGRESS */
#progressBox{
    box-shadow:0 6px 18px rgba(0,0,0,0.08);
}


/* PDF MODAL */
.pdf-modal{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,0.55);
    display:none;
    align-items:center;
    justify-content:center;
    z-index:9999;
    backdrop-filter:blur(4px);
}

.pdf-box{
    width:340px;
    background:#fff;
    border-radius:18px;
    padding:25px;
    box-shadow:0 15px 40px rgba(0,0,0,0.2);
    text-align:center;
    animation:pop .25s ease;
}
.account-bar{
    background:#222;
    color:white;
    padding:10px;
    display:flex;
    justify-content:flex-end;
    gap:15px;
}

.account-bar a{
    color:white;
    text-decoration:none;
}

@keyframes pop{
    from{
        transform:scale(.9);
        opacity:0;
    }
    to{
        transform:scale(1);
        opacity:1;
    }
}

.pdf-title{
    font-size:18px;
    font-weight:bold;
    margin-bottom:20px;
    color:#222;
}

.pdf-progress{
    height:14px;
    background:#eee;
    border-radius:30px;
    overflow:hidden;
    margin-bottom:12px;
}

#progressBar{
    height:100%;
    width:0%;
    background:linear-gradient(90deg,#28a745,#2ecc71);
    transition:.25s;
    border-radius:30px;
}

.pdf-percent{
    font-size:14px;
    color:#666;
    margin-bottom:18px;
}

/* CLOSE BUTTON */
.close-pdf-modal{
    position:absolute;
    top:12px;
    left:12px;
    width:34px;
    height:34px;
    border:none;
    border-radius:50%;
    background:#f1f1f1;
    cursor:pointer;
    font-size:16px;
    transition:.2s;
    display:flex;
    align-items:center;
    justify-content:center;
}

.close-pdf-modal:hover{
    background:#e74c3c;
    color:#fff;
}

/* IMPORTANT */
.pdf-box{
    position:relative;
}
.img-error{
    position:absolute;
    top:8px;
    left:8px;
    right:8px;
    background:#e74c3c;
    color:#fff;
    font-size:11px;
    padding:6px 8px;
    border-radius:8px;
    z-index:10;
    text-align:center;
    
}
#errorMsg{
    display:none;
    background:#e74c3c;
    color:#fff;
    padding:12px;
    margin:15px auto;
    max-width:500px;
    border-radius:10px;
    text-align:center;
    font-weight:bold;
    box-shadow:0 4px 12px rgba(0,0,0,0.15);
    animation:fadeIn .25s ease;
}

@keyframes fadeIn{
    from{
        opacity:0;
        transform:translateY(-10px);
    }
    to{
        opacity:1;
        transform:translateY(0);
    }
}

.tool-title{
    max-width:1200px;
    margin:20px auto 10px;
    text-align:center;
    font-weight:bold;
    font-size:30px;
    color:#444343;
}

.tool-desc{
    margin-top:8px;
    font-size:14px;
    font-weight:normal;
    color:#555;
    line-height:1.6;
}


.top{
    max-width:1200px;
    margin:20px auto;
    padding:14px 18px;
    background:#fff;
    border-radius:14px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    flex-wrap:wrap;
    gap:12px;
    box-shadow:0 8px 25px rgba(0,0,0,0.06);
}
/* ===========================================================
   MOBILE
=========================================================== */

@media (max-width:768px){

    body{
        overflow-x:hidden;
    }



    /* ---------- Buttons ---------- */

    .uploader__btn,
    .downloader__btn{

        width:100%;

        max-width:none;

        height:60px;

        font-size:18px;

        border-radius:18px;

    }

    /* ---------- Upload ---------- */

    .upload-zone{

        margin:15px;

        padding:25px 15px;

    }

    .drop-text{

        font-size:13px;

    }

    /* ---------- Titles ---------- */

    .tool-title{

        font-size:22px;

        line-height:1.4;

        padding:0 12px;

    }

    .tool-desc{

        font-size:14px;

        padding:0 12px;

    }

    /* ---------- Controls ---------- */

    .controls{

        flex-direction:column;

        align-items:stretch;

        width:100%;

        gap:10px;

    }

    .controls select,
    .controls input{

        width:100%;

        box-sizing:border-box;

    }

    /* ---------- Grid ---------- */

    .grid{

        grid-template-columns:repeat(2,1fr);

        gap:12px;

        padding:10px;

    }

    .page img{

        height:160px;

    }

    .actions{

        flex-wrap:wrap;

        gap:6px;

    }

    .btn{

        flex:1;

        font-size:11px;

        padding:8px;

    }

    /* ---------- Top Box ---------- */

    .top{

        flex-direction:column;

        align-items:stretch;

    }

    /* ---------- PDF ---------- */

    .pdf-box{

        width:92%;

        padding:20px;

    }

    /* ---------- Menu ---------- */



}

/* DEUXPDF V2 — staged result */
#deuxReadyBox{display:none;max-width:920px;margin:22px auto;padding:0 18px}.deux-ready-card{display:flex;align-items:center;gap:14px;background:#fff;border:1px solid #dce7e1;border-radius:18px;padding:16px 18px;box-shadow:0 14px 45px rgba(25,55,42,.10)}.deux-ready-icon{width:44px;height:44px;border-radius:14px;background:#eaf6ef;color:#24734d;display:grid;place-items:center;font-size:24px;font-weight:900}.deux-ready-card>div:nth-child(2){flex:1}.deux-ready-card strong{display:block;color:#17231d;font-size:16px}.deux-ready-card small{display:block;color:#6c776f;margin-top:5px}.deux-ready-card button{border:0;border-radius:12px;background:#17231d;color:#fff;padding:12px 18px;font-weight:800;cursor:pointer}@media(max-width:650px){.deux-ready-card{align-items:stretch;flex-direction:column}.deux-ready-card button{width:100%}}
