/******************************************
    HEIC TO JPG CONVERTER
******************************************/
.tool {
    
    box-shadow:
        0px 20px 20px -12px rgba(0, 0, 0, 0.04),
        0px 1px 2px 1px rgba(0, 0, 0, 0.04);
    width:100% !important;
    gap:24px !important;
    margin-top:32px;
    display:flex;
    flex-direction: column;

}

.tool .tool-area {

    display: flex;
    gap: 16px;
    width: 100%;
    border-radius:16px;

}
/* This one is for upper section */

.tool-section .hero {
    width: 100%;
    height:104px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 0 0;
}

.tool-section .hero-typography {
    display: flex;
    height:72px;
    flex-direction: column;
    align-items: center;
    gap: 8px;                   
    width: 100%;
}

.tool-section .hero-typography .hero-typography-heading {
    height:36px;
    width:100%
}

.tool-section .hero-typography .hero-typography-paragraph {
    height:28px;
    width:100%
}

.tool-section .hero-typography .hero-typography-heading h1 {
    line-height: 36px !important;
    color:#000000;
}

.tool-section .hero-typography .hero-typography-paragraph p {
    line-height: 28px !important;
    letter-spacing: 0px;
}

/* End for upper section */

.tool-section {
    background-color: var(--color-skyblue);
}

.slogan {
    color:#363942;
    font-weight:400;
}

.privacy-disclaimer{
    font-weight:500;
    line-height:20px !important;
}

.review-stars{
    height:20px !important;
}

.convert-btn:disabled {
    cursor: not-allowed;
}

.cropper-btn,.delete-btn
{
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    background-color: transparent;
    border: none;
    transition: all 0.15s ease-in-out;
    gap:8px;
}

.cropper-btn img {
    transition: all 0.15s ease-in-out;
}

.cropper-btn:hover
{
    background-color: #F4F5F5;
}

.cropper-btn:hover img {
    filter: invert(1);
}

.flex-basis-50-per {
    flex-basis: 50% !important;
}


.cropper-modal-content{
    width:512px !important;
    height:388px !important;
}

.cropper-modal-content #cropper-container{
    width:512px !important;
    height:316px !important;
}

.cropper-modal-content #cropper-container img{
    width:480px !important;
    height:300px !important;
}

.cropper-footer{
    height:72px !important;
    padding:16px;
}

.cropper-footer #resetCrop{
    width:89px !important;
}

.cropper-footer .cropper-action{
    width:170px !important;
}

.cropper-footer .cropper-action .rotate-btn {
    width:36px !important;
    padding:8px !important;
    gap:8px !important;
    background:#F1F2F7;
}

.cropper-footer .cropper-action .rotate-btn img{
    width:20px !important;
    height:20px !important;
    object-fit: contain;
}

.cropper-modal-content .cropper-container.cropper-bg {
    border: 1px solid #FFFFFF;
    border-radius: 8px;
}

#closeCropper{
    width:28px !important;
    height:28px !important;
}

/* Upload area */
.upload-section {
    position: relative;
    display: flex;
    align-items: stretch; 
    justify-content: center;
    flex: 1;
    min-height: 268px;
    border: 1.5px dashed #EADDF8;
    border-radius: 8px;
    transition: none;
}

.upload-section .before-upload.upload-area {
    display: flex;
    flex-direction: row;  
    align-items: center;
    justify-content: center;
    gap: 0;              
    flex: 1;             
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
}

.upload-section .upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 100% !important;
    
}

.upload-section .drag-n-drop-text {
    display: block;
    width: 100%;         
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    line-height: 28px;
    color: #000000;
    white-space: nowrap;  
}

.upload-section .privacy-disclaimer {

    font-size: 12px;
    font-style: italic;
    font-weight: 400;
    line-height: 16px !important;   /* !important add karein */
    color: #9DA2B5;
}

.upload-section > .drop-file-text {

    position: absolute;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: max-content;
    height: auto;
    margin: 0;
    z-index: 2;
    pointer-events: none;
    font-weight:500;
    line-height:28px;
    font-size:18px;
    color:#9DA2B5;

}

/* purana: .browse-dropbtn label { ... } */
.browse-dropbtn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    height: 40px;
}

.browse-dropbtn span {
    font-weight: 500;
    line-height: 24px;
}

.browse-dropbtn img {
    height:20px;
    width:20px;
}

.selection-div .browse-btn .browse-dropbtn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 130px;
    height: 40px;
    padding: 8px 24px;
    border: none;
    border-radius: 8px;
    background-color: #7D1AE8;
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

/* Selected files */
.after-img-upload {
    display: flex;
    flex-basis: 50%;
    flex-direction: column;
    gap: 16px;
    height: 350px;
    min-width: 300px;
    flex: 0 0 calc(50% - 8px);
    width: calc(50% - 8px);
    min-width: 0;
    box-sizing: border-box;
}

.selected-img-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: auto;
    min-height: 294px;
    max-height: 294px;
    overflow: auto;
   
}

.js-single-img-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 12px;
    gap: 12px;
    padding: 12px;
    border: 1px solid #EAEAEB;
    background: #FFFFFF;
    height:88px;
}

.js-single-img-preview:hover {
    background: #f5f7fb;
}

.js-single-img-preview * {
    font-size: 14px;
}

.js-single-img-preview .left-preview {
    display: flex;
    align-items: center;
    gap: 16px;          
    flex: 1 1 0;            
    min-width: 160px;
    height: 64px;
    width:464px;
}

.left-preview-inner {
   flex: 0 0 64px;
   width: 64px;
   height: 64px;     
}

.left-preview-inner img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;      
    display: block;
    border-radius: 8px; 
    border: 0.5px solid #EAEAEB; 
}


/* lightbox start */
.lightbox-container {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: #00000040;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0px 10px;
}

.close-lightbox {
    height: 28px;
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 99px;
    box-shadow: 0px 0px 5px 2px #0000004D;
    background-color: #ffffff;
    position: absolute;
    top: -10px;
    right: -10px;
    cursor: pointer;
}

.lightbox {
    height: 388px;
    width: 512px;
    border-radius: 12px;
    background-color: #ffffff;
    position: relative;
}

.lightbox .image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background-color: #ffffff;
    height: 100%;
    max-width: 100%;
    padding: 16px;
}

.lightbox .image-container img {
    max-height: 100%;
    max-width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: contain;
}


.detail-preview {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
      
.js-single-img-preview .img-preview-name {
    margin: 0;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
}

.js-single-img-preview .img-preview-size {
    color: #9da2b5;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
}

.right-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 36px;
}



/* Clear all */
.after-img-upload .images-clear {
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.images-clear .start-over-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 8px 24px;
    border: none;
    border-radius: 8px;
    background: #f1f2f7;
    font-size: 16px;
    line-height: 24px;
    cursor: pointer;
    transition: background 0.15s ease-in-out;
}

.images-clear .start-over-btn:hover {
    background: #e3e7ed;
}

.review-stars p{
    color:#9da2b5;
}
/* Conversion results */
.result-waiting {
   display: flex;
    flex-direction: column;
    gap: 8px;
    flex-basis: 100%;
    min-width: 0;
}

.result-waiting .header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin-bottom: 12px;
}

.result-waiting .result-text-download-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.result-title.d-none,
.converting-title.d-none,
.cancel-convert-btn.d-none {
    display: none !important;
}

.converting-title,
.result-title {
    font-size: 18px;
    font-weight: 500;
    line-height: 28px;
    color: #000000;
    height:28px;
}

/* Header buttons (Cancel / Start over / Download All) */
.result-waiting .result-text-download-all button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    transition: background 0.15s ease-in-out;
}

.result-waiting .result-text-download-all button span {
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
}

.result-waiting .result-text-download-all button img {
    width: 20px;
    height: 20px;
    vertical-align: text-bottom;
}

.result-waiting .result-text-download-all .start-over-btn {
    width:113px !important;
}

.result-waiting .cancel-convert-btn,
.result-waiting .result-text-download-all .start-over-btn {
    background: #F1F2F7;
    color: #000000;
}

.result-waiting .result-text-download-all .start-over-btn:hover {
    background: #d2d5db;
}

.result-waiting .download-all-btn {
    background: #000000;
    color: #ffffff;
}

.result-waiting .download-all-btn:hover {
    background: #363942;
}

.result-waiting .result-waiting-card {

    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    max-width: 100%;
    padding: 12px;
    border: 1px solid #EAEAEB;
    border-radius: 12px;
    background: #FFFFFF;
    height:68px;
    overflow: hidden;
    transition: height 0.3s ease, min-height 0.3s ease;
}


.result-waiting .result-waiting-card:has(.imagetotext-progress.d-none) {
    height: 64px;
}

.imagetotext-progress.d-none {
    display: none !important;
}

.result-waiting .img-title-text {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0;
    box-sizing: border-box;
}

.result-waiting .img-title {
    position: static;
    display: flex;
    flex: 1;
    align-items: center;
    gap: 12px;
    min-width: 160px;
    width: 50%;
    height:40px;
    padding: 0;
    border: none;
}

.result-waiting .img-title img {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    min-width: 40px;
    min-height: 40px;
}

.result-waiting .img-title .jpg-file-name {
    margin: 0;
    color: #000000;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    
}

.result-waiting .jpg-file-meta {
    flex-shrink: 0;
    margin-left: auto;
    color: #888A92;
    font-size: 12px;
    line-height: 16px;
    white-space: nowrap;
    font-weight:400;
}

.result-waiting .result-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    width: 50%;
    height:36px;
    min-width:160px; 
    flex-shrink: 0;
    transition: opacity 0.3s ease;
}

/* Download individual JPG */
.result-waiting .result-actions .single-jpg-download {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px 8px 12px;
    border: 1px solid #EAEAEB;
    border-radius: 8px;
    background: #ffffff;
    color: #000000;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    text-decoration: none;
    white-space: nowrap;
    box-sizing: border-box;
}

.result-waiting .result-actions .single-jpg-download::before {
    content: "";
    display: inline-block;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: no-repeat center / contain;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M12 15V3'/%3E%3C/svg%3E");
}

.result-waiting .result-actions .single-jpg-download:hover {
    border-color: #d5d5d5;
    background: #f8f8f8;
}

/* Conversion progress */
.imagetotext-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 4px;
    border-radius: 4px;
    background: #EAEAEB;
    overflow: hidden;
    gap:10px;
}

.imagetotext-progress::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 500px;
    height: 4px;
    border-radius: 4px;
    background: #7D1AE8;
    animation: heic-progress 2s linear infinite;
}


.tool .bottom-review-section {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.tool .bottom-review-section .privacy-disclaimer {
    margin: 0;
}

@keyframes heic-progress {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}

/* Error messages */
.error-message {
    color: red;
}

/* Responsive styles */
@media (max-width: 600px) {

    .img-preview-name{
        font-size:15px !important;
    }

    .result-waiting .result-actions {
        flex: 0 0 100%;
        width: 100%;
        justify-content: space-between;
    }
    .result-waiting .result-waiting-card {
        height: 68px !important;
        min-height: 68px;
        overflow: hidden;
    }

    .result-waiting .result-actions .jpg-file-meta {
        flex: 1;
        margin-left: 0;
        text-align: left;
        white-space: nowrap; 
    }

    
    .result-waiting .result-waiting-card:has(.imagetotext-progress.d-none) {
        height: 112px !important;
        min-height: 112px;
    }

    .tool-area {
        flex-direction: column;
        gap: 1.5rem;
    }

    .tool-section .hero .h1 {
        line-height: 30px;
        font-size: 22px;
    }

    .selected-img-preview {
        width: 100%;
        box-sizing: border-box; 
        min-height:auto;
    }

    .after-img-upload {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .result-waiting .result-text-download-all .start-over-btn span,
    .result-waiting .result-text-download-all .download-all-btn span {
        display: none;
    }

    .result-waiting .result-text-download-all .start-over-btn,
    .result-waiting .result-text-download-all .download-all-btn {
        width: auto;
        height: auto;
        padding: 6px;
        border-radius: 6px;
    }

    .result-waiting .result-text-download-all .start-over-btn {
        height:32px !important;
        width:32px !important;
        gap: 6px;
    }

    .result-waiting .result-text-download-all .download-all-btn {
        gap: 2px;
    }

    .result-waiting .result-waiting-card .img-title-text {
        flex-wrap: wrap;
    }

    .result-waiting .img-title {
        flex: 0 0 100%;
    }

    .result-waiting .result-actions .jpg-file-meta {
        flex: 1;
        margin-left: 0;
        text-align: left;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .result-waiting .result-actions .single-jpg-download {
        margin-left: auto;
    }

    .tool .bottom-review-section {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        flex-direction: column;
        align-items: stretch;
    }

    .tool .bottom-review-section > * {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .tool .bottom-review-section .review-stars {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .privacy-disclaimer{
        font-weight:400;

    }
    .cropper-modal-content{
        height:388px !important;
        width:343px !important;
    }

    .cropper-modal-content #cropper-container {
        width: 100% !important;
        height: 316px !important;
        box-sizing: border-box;
    }
    .tool-section .hero {
        height:126px !important;
        width:355px !important;
    }
    .tool-section .hero-typography {
        height:94px !important;
        width:355px !important;

    }
}

@media (max-width: 425px) {

    .img-preview-name{
        font-size: 14px !important;
    }

    .images-clear .start-over-btn {
        padding: 8px 16px;
    }

}