/* --- Gallery & Content Container --- */
.csbd-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.csbd-gallery-container .csbd-item {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out;
}
.csbd-gallery-container .csbd-item:hover {
    transform: scale(1.03);
}
.csbd-gallery-container .csbd-item img {
    display: block;
    max-width: 100%;
    height: auto;
}
.csbd-item-checkbox {
    display: none; /* Hide the actual checkbox */
}

/* --- Checkbox Overlay for Gallery --- */
.csbd-checkbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background 0.2s ease;
}
.csbd-item input:checked + .csbd-checkmark {
    opacity: 1;
    transform: scale(1);
}
.csbd-item label:hover .csbd-checkbox-overlay {
    background: rgba(0, 0, 0, 0.2);
}
.csbd-item input:checked ~ .csbd-checkbox-overlay {
    background: rgba(0, 115, 230, 0.5);
    box-shadow: inset 0 0 0 3px white;
}
.csbd-checkmark {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease-in-out;
}
.csbd-checkmark::after {
    content: '';
    display: block;
    width: 8px;
    height: 14px;
    border: solid #0073e6;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

/* --- Checkbox for Content Links --- */
.csbd-link-item {
    display: inline-block;
    margin-right: 5px;
}
.csbd-link-item label {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    vertical-align: middle;
    position: relative;
}
.csbd-link-item input:checked + label {
    background-color: #0073e6;
    border-color: #0073e6;
}
.csbd-link-item input:checked + label::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.csbd-content-container a {
    vertical-align: middle;
}

/* --- Floating Download Button --- */
#csbd-downloader-ui { display: block !important; } /* Overwrite inline style once JS is ready */

#csbd-download-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #0073e6;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 115, 230, 0.4);
    z-index: 99998;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(150%);
    transition: transform 0.3s ease-in-out;
}
#csbd-download-btn.visible {
    transform: translateY(0);
}
.csbd-file-count {
    background-color: white;
    color: #0073e6;
    border-radius: 50%;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* --- Progress Modal --- */
#csbd-progress-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
#csbd-progress-modal-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}
#csbd-progress-modal {
    background: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.csbd-filename-container {
    margin: 15px 0;
}
.csbd-filename-container label {
    margin-right: 10px;
}
#csbd-zip-filename {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 60%;
}
.csbd-progress-bar-container {
    width: 100%;
    background-color: #e9ecef;
    border-radius: 50px;
    overflow: hidden;
    margin: 20px 0;
}
.csbd-progress-bar {
    width: 0%;
    height: 20px;
    background-color: #0073e6;
    transition: width 0.2s linear;
}
.csbd-progress-status {
    font-weight: bold;
    font-size: 18px;
}
.csbd-file-status {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
    height: 20px;
}