/* =========================
   MAIN CARD
========================= */
.pti-box{
    max-width: 680px;
    margin: 30px auto;
    padding: 26px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 10px 35px rgba(0,0,0,0.08);
    font-family: system-ui;
}

/* =========================
   TITLE
========================= */
.pti-box h2{
    text-align:center;
    font-size:22px;
    font-weight:700;
    margin-bottom:20px;
}

/* =========================
   FILE UPLOAD (BIG + MODERN)
========================= */
.pti-box input[type="file"]{
    width:100%;
    padding:18px;
    border:2px dashed #2563eb;
    border-radius:14px;
    background:#f8fbff;
    text-align:center;
    cursor:pointer;
    font-size:14px;
    margin-bottom:18px;
}

/* =========================
   MODE BUTTONS
========================= */
.mode{
    display:flex;
    justify-content:center;
    gap:12px;
    margin:15px 0;
}

.mode label{
    padding:10px 18px;
    border-radius:999px;
    background:#f1f5f9;
    cursor:pointer;
    font-size:14px;
}

/* =========================
   RANGE BOX SPACING FIX
========================= */

/* =========================
   RANGE BOX PERFECT ROW FIX
========================= */
/* RANGE */
#rangeBox{
    display:none;
    flex-direction:row;
    gap:10px;
    margin:10px 0;
}

#rangeBox input{
    flex:1;
    padding:10px;
    border:1px solid #ddd;
    border-radius:8px;
}

/* =========================
   RANGE BOX (DESKTOP FIX)
========================= */


/* =========================
   MOBILE FIX (FORCE SINGLE ROW SMALL SIZE)
========================= */

/* =========================
   DROPDOWN (SEPARATED)
========================= */
.pti-box select{
    width:100%;
    padding:12px;
    border-radius:10px;
    border:1px solid #ddd;
    margin-top:10px;
    margin-bottom:18px; /* 🔥 spacing fix */
    background:#fff;
}

.pti-box select option{
    padding:10px;
    font-size:14px;
    white-space:normal;
}

/* MOBILE FIX */
@media(max-width:600px){

    .pti-box select{
        font-size:13px;
        padding:10px;
    }
}

/* =========================
   CONVERT BUTTON (CENTER + BIG)
========================= */
.pti-box button{
    display:block;
    width:60%;
    margin:10px auto 25px auto; /* center */
    padding:14px;
    background:linear-gradient(135deg,#2563eb,#1d4ed8);
    color:#fff;
    border:none;
    border-radius:12px;
    font-size:16px;
    font-weight:600;
    cursor:pointer;
    text-align:center;
}

/* =========================
   DOWNLOAD ZIP POSITION
========================= */
#ptiResult a.download-btn{
    display:block;
    text-align:center;
    margin:15px auto;
    width:60%;
    padding:12px;
    background:#10b981;
    color:#fff;
    border-radius:10px;
    text-decoration:none;
}

/* =========================
   PREVIEW CARD (SIDE BY SIDE)
========================= */
#previewBox{
    display:none;
    margin-top:20px;
    padding:15px;
    border-radius:14px;
    background:#fafafa;
    border:1px solid #eee;
}

/* Preview title */
.preview-title{
    font-weight:600;
    margin-bottom:10px;
    font-size:15px;
}

/* GRID LAYOUT (SIDE BY SIDE) */
.preview-grid{
    display:flex !important;
    flex-wrap:wrap !important;
    gap:10px !important;
    justify-content:flex-start !important;
}

.preview-grid canvas{
    width:48% !important;
    border-radius:10px;
    box-shadow:0 3px 10px rgba(0,0,0,0.08);
}

/* =========================
   RESULT IMAGES (CLEAN GRID)
========================= */
.result-box{
    display:grid;
    grid-template-columns: repeat(2, 1fr);
    gap:12px;
    margin-top:15px;
}

.img-item{
    background:#fff;
    border-radius:12px;
    overflow:hidden;
    box-shadow:0 3px 10px rgba(0,0,0,0.08);
}

.img-item img{
    width:100%;
    display:block;
}

/* Download per image */
.single-download{
    display:block;
    text-align:center;
    padding:8px;
    background:#2563eb;
    color:#fff;
    text-decoration:none;
    font-size:13px;
}


/*Lodind converting Damaru show*/
#ptiLoader{
    text-align:center;
    margin:15px 0;
}

.damru{
    width:40px;
    height:40px;
    margin:auto;
    border-radius:50%;
    border:4px solid #ddd;
    border-top:4px solid #2563eb;
    animation:spin 0.8s linear infinite;
}

@keyframes spin{
    0%{transform:rotate(0deg);}
    100%{transform:rotate(360deg);}
}

#ptiLoader p{
    margin-top:8px;
    font-size:14px;
    color:#555;
}

/* =========================
   MOBILE FIX
========================= */
@media(max-width:600px){

    .pti-box button{
        width:100%;
    }

    #ptiResult a.download-btn{
        width:100%;
    }

    .preview-grid,
    .result-box{
        grid-template-columns: 1fr;
    }
    
    
    #rangeBox{
        flex-direction:column;
    }

}