:root {
    --primary-red: #e5322d;
    --primary-red-dark: #c42a25;
    --text-dark: #383e45;
    --text-light: #878d95;
    --border-color: #e8e8f0;
    --background-light: #f8fafc;
    --background-white: #ffffff;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --header-height: 60px;
    --navy: #1e293b;
    --cream: #f1f5f9;
    --gold: #f59e0b;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


/* Process Button */
.process-btn {
    width: 100%;
    align-items: center;
    color: white;
    gap: 10px;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    /* margin-top: 24px; */
    transition: all 0.3s ease;
    /* box-shadow: 0 4px 12px rgba(229, 50, 45, 0.3); */
}

#pdf-to-jpg-process-btn:enabled {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-red) 0%, #dc2626 100%);
    /* box-shadow: 0 4px 12px rgba(229, 50, 45, 0.3); */
    margin-top: 30px;
    width: 330px;
}

#add-more-files-btn {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    /* box-shadow: #3862d7; */
    margin-top: 20px;
    width: 330px;
}

#jpg-to-pdf-process-btn:enabled {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-red) 0%, #dc2626 100%);
    /* box-shadow: 0 4px 12px rgba(229, 50, 45, 0.3); */
    margin-top: 30px;
    width: 330px;
}

#add-more-files-btn-jpgToPdf {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    /* box-shadow: #3862d7; */
    margin-top: 20px;
    width: 330px;
}

#pdf-to-jpg-back-btn{
    margin-top: 30px;
    width: 200px;
    border-radius: 12px;
    font-size: 1rem;
}
.process-btn:hover:not(:disabled) {
    /* transform: translateY(-2px); */
    box-shadow: 0 8px 20px rgba(46, 37, 37, 0.4);
}

.process-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


/* Styles for PDF to JPG Input Preview */
.pdf-input-preview-grid,.jpg-to-pdf-pre-preview-grid {
     display: flex;
    flex-wrap: wrap;
    /* justify-content: space-evenly; */
    justify-content: center;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    /* margin-top: 15px; */
    height: 420px;
    width: 60%;
    overflow-y: auto;
    padding: 10px;
    border: 10px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--background-light);
    display: none;
    box-shadow: 0 3px 6px 0 rgba(0, 0, 0, .14);
    /* Hidden by default */
}

.pdf-input-preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* justify-content: space-evenly; */
    background-color: var(--background-white);
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
    height: 280px;
    /* For rotate button */
}

.pdf-input-preview-item canvas {
    width: 150px;
    height: 200px;
    border: 1px solid #eee;
    border-radius: 3px;
    /* margin-bottom: 8px; */
}

.pdf-input-preview-item p {
    font-size: 0.85rem;
    color: var(--text-dark);
    text-align: center;
    word-break: break-all;
    margin-bottom: 5px;
}

.pdf-input-preview-item .action-buttons-container {
    display: flex;
    width: 100%;
    gap: 15px;
}

.loader{
    width: 100%;
    height: 100%;
    display: flex;
}
/* .loader-percent{
    font-weight: 600;
} */
.loader-text{
    width: 100%;
    text-align: center;
}

/* Styles for JPG Output Preview (New) */
.jpg-output-preview-grid {
    flex-wrap: wrap;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 5px;
    margin-top: 20px;
    max-height: 370px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--background-light);
    display: none;
    /* Hidden by default */
}

.jpg-output-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--background-white);
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
    height: 350px;
    width: 180px;
}

.jpg-output-item img {
    max-width: 100%;
    height: 260px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 3px;
    margin-bottom: 8px;
    transition: transform 0.2s ease-out;
    /* For smooth rotation */
}

.jpg-output-item p {
    font-size: 0.65rem;
    color: var(--text-dark);
    text-align: center;
    word-break: break-all;
    margin-bottom: 10px;
}

.jpg-output-item .action-buttons-container {
    display: flex;
    gap: 5px;
    justify-content: space-evenly;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
}


.jpg-output-item .action-buttons-container button:hover{
    opacity: 0.9;
}

.pdf-input-preview-item .action-buttons-container .rotate-btn {
    background-color: #007bff;
    padding: 5px 15px;
    border: none;
    color: white;
    font-size: 15px;
    border-radius: 4px;
    cursor: pointer;

}

.pdf-input-preview-item .action-buttons-container .remove-btn {
    background-color: #ef4444;
    padding: 5px 15px;
    border: none;
    color: white;
    font-size: 15px;
    border-radius: 4px;
    cursor: pointer;
}

/* Styles for JPG to PDF pre-processing preview */
/* 
.jpg-to-pdf-pre-preview-grid {
    display: flex;
    flex-wrap: wrap;
    /* justify-content: space-evenly; 
    justify-content: center;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    /* margin-top: 15px; 
    height: 420px;
    width: 60%;
    overflow-y: auto;
    padding: 10px;
    border: 10px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--background-light);
    display: none;
    box-shadow: 0 3px 6px 0 rgba(0, 0, 0, .14);
    /* Hidden by default
}
 */

.jpg-to-pdf-pre-preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background-color: var(--background-white);
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    width: 180px;
    height: 315px;
    /* For positioning buttons */
}

.jpg-to-pdf-pre-preview-item img {
    width: 150px;
    height: 200px;
    border: 1px solid #eee;
    border-radius: 3px;
    margin-bottom: 8px;
    transform: rotate(0deg);
    /* Default rotation */
    transition: transform 0.2s ease-out;
}

.jpg-to-pdf-pre-preview-item p {
    font-size: 0.65rem;
    color: var(--text-dark);
    margin-bottom: 5px;
    text-align: center;
    word-break: break-all;
    z-index: 10;
    overflow: hidden;
}

.jpg-to-pdf-pre-preview-item .action-buttons-container {
    display: flex;
    gap: 5px;
    margin-top: 5px;
    justify-content: center;
    width: 100%;
}

#jpg-to-pdf-download-link{
      display: inline-flex;
      align-items: center;
      background-color: #0cab77;
      color: white;
      padding: 17px 48px;
      font-weight: 200;
      font-size: 24px;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      box-shadow: 0 3px 6px 0 rgba(0, 0, 0, .14);
      transition: background 0.3s ease;
      text-decoration: none; /* for <a> */
}

.jpg-to-pdf-pre-preview-item .action-buttons-container button {
    background-color: #007bff;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.8rem;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}
#jpg-to-pdf-back-btn{
    margin-top: 30px;
    width: 200px;
    border-radius: 8px;
    font-size: 1rem;
}
#pdf-output-preview-grid {
    display: flex;
    /* flex-wrap: wrap; */
    justify-content: flex-start;
    gap: 10px;
    overflow: auto;
    background-color: var(--background-light);
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.pdf-page-preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f2efef94;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
    width: 200px;
    height: 300px;
}

.jpg-preview-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex-direction: row;
    align-items: center;


    i {
        padding: 10px 20px;
        color: white;
        cursor: pointer;
    }

    .rotate-btn {
        background-color: #007bff;
        border: none;
        border-radius: 4px;

        &:hover {
            background-color: #248eff;
        }
    }

    .delete-btn {
        background-color: #EF4444;
        border: none;
        border-radius: 4px;

        &:hover {
            background-color: #ff4343;
        }
    }

    .download-btn {
        background-color: #10B981;
        border: none;
        border-radius: 4px;

        &:hover {
            background-color: #1cc68d;
        }
    }


}

.page-number {
    font-size: 0.75rem;
    margin: 5px;
}

/* add watermark pdf */
.remove-page-btn {
    background-color: #007bff;
    padding: 5px;
    border-radius: 3px;
    border: none;
    color: white;
    width: 25px;
    margin-right: 2px;
    margin-bottom: 5px;
}

.rotate-page-btn {
    background-color: #007bff;
    padding: 5px;
    border-radius: 3px;
    border: none;
    color: white;
    width: 25px;
    margin-right: 2px;
    margin-bottom: 5px;
}

.download-page-btn {
    background-color: #007bff;
    padding: 5px;
    border-radius: 3px;
    border: none;
    color: white;
    width: 25px;
    margin-right: 2px;
    margin-bottom: 5px;
}

@media screen and (max-width: 735px) {
    .pdf-input-preview-grid,.jpg-to-pdf-pre-preview-grid  {
        width: 90%;
        height: 350px;
    }
    .tool-options{
        width: 90%;
    }
    .title-header #output-heading {
        font-size: 1.3rem;
    }
    .title-header #preview-heading {
        font-size: 1.3rem;
    }
    .title-header h2 {
        font-size: 1.5rem;
    }
    .download-link{
        font-size: 15px;
        padding: 18px 30px;
    }
    #jpg-to-pdf-download-link{
        font-size: 20px;
        padding: 15px 26px;
    }
    #jpg-to-pdf-back-btn,#pdf-to-jpg-back-btn
    {
        width: 190px;
    }
}
@media screen and (max-width: 490px) {
    .pdf-input-preview-grid,.jpg-to-pdf-pre-preview-grid  {
        width: 250px;
        height: 350px;
    }
    /* .jpg-to-pdf-pre-preview-grid {
        width: 250px;
        height: 330px;
    } */
    .modal-body {
       padding: 20px;
    }
    #add-more-files-btn,#pdf-to-jpg-process-btn:enabled {
        width: 70%;
    }
    #add-more-files-btn-jpgToPdf, #jpg-to-pdf-process-btn:enabled {
        width: 70%;
    }
    .process-btn{
        font-size: 1rem;
    }
}