:root {
    --download-btn-link: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --process-btn: linear-gradient(135deg, var(--primary-red) 0%, #dc2626 100%);
    --preview-bg: #f8fafc;
    --heading-color: #454b51;
    --rotate-btn: #007bff;
    --download-btn: #10b981;
    --remove-btn: rgb(239, 68, 68);
}


.header-watermark {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 19px 25px;
    border-bottom: 1px solid var(--border-color);
}

.watermark-modal {
    display: flex;
    flex-wrap: no-wrap;
    justify-content: flex-start;
    width: 100%;
    height: auto;
    padding: 10px 20px 20px 30px;
    overflow-y: auto;
    flex: 1;
    background: #eff3f8;
    flex-direction: column;
    align-content: space-around;
    align-items: center;
}

.watermark-options {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    padding: 1rem;
    border: 2px solid var(--primary-red);
    border-radius: 8px;
    background-color: #f9f9f9;
    flex: 1;
    margin-top: 25px;
    /* Allows it to take up available space */

    h3 {
        margin-bottom: 10px;
        text-align: center;
    }
}

#add-watermark-initial-upload-section {
    width: 100%;
    height: 70%;
    justify-content: center;
}

#add-watermark-drop-zone {
     flex-direction: column;
    align-items: center;
    height: 70%;
    width: 60%;
    border: 2px dashed #3b82f6;
    border-radius: 12px;
    padding: 60px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

#add-watermark-options-state{
    width: 650px;
    height: auto;
    justify-content: center;

}


.hidden-input {
    display: none;
}

h2 {
    /* margin: 0; */
    font-size: 2.2rem;
    font-weight: 700;
}

#drag-para {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 7px;
}

#add-watermark-upload-state {
    display: flex;
    justify-content: center;
    width: 100%;
    height: 100%;
} 
/* 
#add-watermark-drop-zone {
    width: 100%;
    padding: 55px 50px;
} */

.image-preview {
    width: 150px;
    height: 150px;
    border: 1px solid #ccc;
    margin: 0.5rem;
}

.image-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.form-group {
    display: flex;
    flex-direction: column;

    input {
        margin: 10px;
        padding: 10px;
        border: 1px solid #bdb3b3;
        border-radius: 5px;
    }
}

.form-group, .option-group {
    margin-bottom: 1rem;
    font-weight: 500;

    div {
        margin: 5px;
        display: flex;
        justify-content: space-between;
    }

    .radio-group {
        display: flex;
        flex-direction: column;
    }
}

.op2 {
    display: flex;
    flex-direction: column;

    select {
        margin: 10px;
        padding: 10px;
        border: 1px solid #ccc;
        border-radius: 5px;
    }
}


#add-watermark-add-more-btn {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    /* box-shadow: #3862d7; */
    margin-top: 20px;
    width: 330px;
}

#add-watermark-add-more-btn:hover:not(:disabled) {
    /* transform: translateY(-2px); */
    box-shadow: 0 8px 20px rgba(46, 37, 37, 0.4);
}

#add-watermark-process-btn {
    width: 100%;
    /* background: linear-gradient(135deg, var(--primary-red) 0%, #dc2626 100%); */
    color: white;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 24px;
    transition: all 0.3s ease;
    /* box-shadow: 0 4px 12px rgba(229, 50, 45, 0.3); */
    justify-content: center;

}

.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); */
}

#add-watermark-process-btn:enabled {
    background: linear-gradient(135deg, var(--primary-red) 0%, #dc2626 100%);
    width: 330px;
}

#add-watermark-process-btn:hover:not(:disabled) {
    /* transform: translateY(-2px); */
    box-shadow: 0 8px 20px rgba(46, 37, 37, 0.4);
}

#add-watermark-process-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#modal-body {
    position: relative;
}

/* watermark-loader */

#add-watermark-loader {
    /* position: absolute; */
    /* flex-direction: column-reverse;
    justify-content: center;
    align-items: center; */
}

/* --- Horizontal Scroll Preview --- */
.input-file-preview-grid {
    display: flex;
    flex-direction: column;
    align-content: flex-start;
    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: 330px;
    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 */
}

/* Hide scrollbar for WebKit browsers
.input-file-preview-grid::-webkit-scrollbar {
    display: none;
} */

add-watermark-input-preview-area {
    display: flex;
}

.file-preview-container {
    display: flex;
    flex-direction: row;
    gap: 15px;
}

.page-canvas-container {
    background: white;
    padding: 10px;
    width: 170px;
    height: 250px;
    /* border-radius: 8px; */
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.file-preview-item img {
    width: 125px;
    height: 200px;
    border: 1px solid #eee;
    margin-bottom: 10px;
}

.file-preview-item.file-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 150px;
    /* Consistent height for placeholders */
    background-color: #f0f0f0;
    border-style: dashed;
}

.file-name {
    font-size: 0.65rem;
    color: #555;
    word-break: break-all;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Add to your existing CSS file */
.error-message {
    color: #e74c3c;
    font-size: 0.875rem;
    margin-top: 5px;
    display: block;
    /* Ensures the span appears on a new line */
}

.input-error {
    border: 2px solid #e74c3c;
}

#watermark-text-error-message {
    color: red;
    font-weight: normal;
}

.output-actions, .file-action-buttons {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#add-watermark-file-management-section {
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: auto;
}

#add-watermark-output-state {
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: 12px;
    border: 1px solid #10b981;
    width: 60%;
    

    h3 {
        color: green;
        margin-bottom: 10px;
    }
}

/* File Preview Grid Styles */

/* Add this to your existing CSS */
.file-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    /* NEW: Add these properties for scrollability */
    max-height: 330px;
    /* Adjust this height as needed */
    overflow-y: auto;
    overflow-x: auto;
    align-content: flex-start;
    flex-direction: column;
}

.file-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;
}

.output-actions, .file-action-buttons {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    gap: 15px;
}

#add-watermark-reprocess-btn:enabled {
    background: linear-gradient(135deg, var(--primary-red) 0%, #dc2626 100%);
    display: flex;
    justify-content: center;
    gap: 10px;
}

#add-watermark-download-btn {
    background-color: #0cab77;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* .jpg-preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-wrap: wrap;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
    width: 150px;
    height: 250px;

} */

.pageNumber {
    font-size: 0.65rem;
    margin: 5px;
    text-align: center;
}

#add-watermark-back-to-upload-btn {
    display: flex;
    gap: 10px;
    justify-content: center;
    width: 200px;
    font-size: 1rem;
}

#add-watermark-file-management-section #add-watermark-input-preview-area .file-preview-container .page-preview-item .page-canvas-container canvas{
    width: 150px;
    height: 200px;
    border: 1px solid #eee;
    border-radius: 3px;
}

@media screen and (max-width: 735px) {
    .input-file-preview-grid{
        width: 90%;
    }
    .title-header #output-heading {
        font-size: 1.3rem;
    }
    .title-header #preview-heading {
        font-size: 1.3rem;
    }
    #add-watermark-options-state{
        width: 90%;
    }
    #add-watermark-output-state {
        width: 92%;
    }
    #add-watermark-back-to-upload-btn {
        width: 50%;
        font-size: 1rem;
    }
}

@media (max-width: 580px){
        #add-watermark-drop-zone {
        flex-direction: column;
        align-items: center;
        height: 70%;
        width: 100%;
        border: 2px dashed #3b82f6;
        border-radius: 12px;
        padding: 20px 20px;
        cursor: pointer;
        transition: all 0.3s ease;
        text-align: center;
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    }
    #add-watermark-drop-zone p {
        font-size: 1rem;
    }
    .upload-icon {
        width: 60px;
        height: 60px;
    }
    .select-file-btn {
        font-size: 0.8rem;
    }
    .modal-body{
        padding: 20px;
    }
}


@media screen and (max-width: 490px) {
    #add-watermark-add-more-btn, #add-watermark-process-btn:enabled{
        width: 100%;
        font-size: 1rem;
        padding: 15px 30px;
    }
    #add-watermark-back-to-upload-btn {
        width: 70%;
        font-size: 1rem;
    }
    #add-watermark-download-btn{
        font-size: 5vw;
    }
}

.delete-page-icon{
    display: flex;
    justify-content: center;
    /* margin-top: 15px; */
    padding: 5px;
    background: var(--remove-btn);
    color: white;
    /* border-radius: 8px; */
    cursor: pointer;
}