/* User Settings - Projects */
.card-md .unit.pending a {
    background: #431e1e;
    border: 1px solid #532a2aa6;
    color: #ffc5c5;
}
.card-md .unit:hover.pending a {
    background: #482424 !important;
    border: 1px solid #632b2b !important;
    color: #ffc5c5;
}

/* User Settings - Uploads */
.original.card-lg .unit.pending .inner {
    background: #431e1e;
    border: 1px solid #532a2aa6;
    color: #ffc5c5;
}
.original.card-lg .unit.pending .inner:hover {
    background: #482424 !important;
    border: 1px solid #632b2b !important;
    color: #ffc5c5;
}

/* Manga Single - Upload Chapter Page */
.upload-chapter-container {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 768px !important;
}

.upload-chapter-container h1 {
    color: white;
    text-align: center;
}

.upload-chapter-container #uploadChapterForm {
    width: 100%;
    margin-top: 1rem;
}

.upload-chapter-container .upload-chapter-rules {
    font-size: 0.875rem;
    text-align: right;
    margin-bottom: 2.5rem;
}

.upload-chapter-container .upload-chapter-rules .rules-head {
    color: #dc3545;
    font-weight: bold;
}

.upload-chapter-container .upload-chapter-rules ul {
    list-style-type: disc;
    margin-top: 0.25rem;
    padding-right: 2rem;
}

.upload-chapter-container .upload-chapter-rules .link {
    color: #3c8bc6;
}

.upload-chapter-container .upload-chapter-rules .link:hover {
    color: #5fb4f4;
}

.upload-chapter-container .form-group {
    width: 100%;
    text-align: center;
    margin-top: 0.5rem;
}

.upload-chapter-container .submit-chapter {
    width: 100%;
    margin-top: 0.25rem;
}

.upload-chapter-container .alert {
    margin-top: 0.75rem;
}

.upload-chapter-container .progress {
    margin-top: 0.75rem;
}

.upload-chapter-container .button-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.upload-chapter-container .up-chapter-btn {
    width: 100%;
    height: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: none;
    border-radius: 0.375rem;
    background-color: #4b5563;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

.upload-chapter-container .up-chapter-btn:hover {
    background-color: #374151;
}

.upload-chapter-container #imagePreviewContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

@media (min-width: 768px) {
    .upload-chapter-container #imagePreviewContainer {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .upload-chapter-container #imagePreviewContainer {
        grid-template-columns: repeat(4, 1fr);
    }
}

.upload-chapter-container #dropZone {
    border-width: 2px;
    border-style: dashed;
    border-color: #4b5563;
    border-radius: 0.5rem;
    text-align: center;
    transition: border-color 0.3s;
    aspect-ratio: 3 / 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-chapter-container #dropZone:hover {
    border-color: #3b82f6;
}

.upload-chapter-container #chapterImages {
    display: none;
}

.upload-chapter-container #dropZone label {
    cursor: pointer;
    height: 100%;
    width: 100%;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-chapter-container #dropZone svg {
    margin-left: auto;
    margin-right: auto;
    height: 2rem;
    width: 2rem;
    color: #6b7280;
}

.upload-chapter-container #dropZone p {
    margin-top: 0.25rem;
    margin-bottom: 0;
    font-size: 0.875rem;
    color: #9ca3af;
}

.upload-chapter-container #dropZone p + p {
    font-size: 0.75rem;
    color: #6b7280;
}

.upload-chapter-container #invalidFilesModal,
.upload-chapter-container #processingOverlay,
.upload-chapter-container #previewProcessingOverlay,
.upload-chapter-container #reorderOverlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.upload-chapter-container .modal-content,
.upload-chapter-container .processing-box,
.upload-chapter-container .preview-box,
.upload-chapter-container .reorder-box {
    background-color: #1f2937;
    border-radius: 0.5rem;
    padding: 1.5rem;
    max-width: 28rem;
    width: 100%;
    margin: 0 1rem;
    color: white;
    text-align: left;
}

.upload-chapter-container .modal-content h3,
.upload-chapter-container .processing-box h3,
.upload-chapter-container .preview-box h3,
.upload-chapter-container .reorder-box h3 {
    font-size: 1.125rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.upload-chapter-container .modal-content p,
.upload-chapter-container .processing-box p,
.upload-chapter-container .preview-box p,
.upload-chapter-container .reorder-box p {
    margin-bottom: 1rem;
    color: #d1d5db;
}

.upload-chapter-container #invalidFilesList,
.upload-chapter-container #processingStatus,
.upload-chapter-container #previewStatus {
    font-size: 0.875rem;
    color: #9ca3af;
    text-align: center;
    margin-top: 0.5rem;
}

.upload-chapter-container .progress-bar-bg {
    width: 100%;
    background-color: #374151;
    border-radius: 9999px;
    height: 0.625rem;
    overflow: hidden;
}

.upload-chapter-container .progress-bar-fill {
    background-color: #2563eb;
    height: 0.625rem;
    border-radius: 9999px;
    transition: width 0.3s;
}

.upload-chapter-container .modal-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.upload-chapter-container .modal-buttons button {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    color: white;
    transition: background-color 0.3s;
    width: 100%;
    margin-top: 12px;
}

.upload-chapter-container #skipInvalidFiles {
    background-color: #2563eb;
}

.upload-chapter-container #skipInvalidFiles:hover {
    background-color: #1d4ed8;
}

.upload-chapter-container #cancelUpload {
    background-color: #374151;
}

.upload-chapter-container #cancelUpload:hover {
    background-color: #4b5563;
}

.upload-chapter-container .draggable-item {
    position: relative;
    background-color: #1f2937;
    border-radius: 0.5rem;
    /* overflow: hidden; */
    flex-grow: 1;
    min-width: 150px;
    max-width: 1fr;
}

.upload-chapter-container .image-wrapper {
    position: relative;
}

.upload-chapter-container .image-preview {
    width: 100%;
    height: 15rem;
    object-fit: cover;
    border-radius: 0.5rem;
}

.upload-chapter-container .delete-image-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    padding: 0.25rem;
    z-index: 20;
    background-color: #dc2626;
    color: white;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 100%;
    transition: background-color 0.3s;
    border: none;
    font-size: 1rem;
    cursor: pointer;
}

.upload-chapter-container .delete-image-btn:hover {
    background-color: #b91c1c;
}

.upload-chapter-container .drag-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-chapter-container .drag-icon i {
    background-color: white;
    color: black;
    padding: 0.5rem;
    border-radius: 9999px;
    font-size: 1.25rem;
    opacity: 0.6;
}

.upload-chapter-container .image-name {
    font-size: 0.875rem;
    color: #d1d5db;
    margin: 0.25rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    justify-content: center;
}

@keyframes float {
    0% { transform: translateY(-3px); }
    50% { transform: translateY(3px); }
    100% { transform: translateY(-3px); }
}

.upload-chapter-container .sortable-ghost {
    background-color: #4e698e82;
    animation: float 0.6s ease-in-out infinite;
}

.upload-chapter-container .sortable-ghost * {
    visibility: hidden;
}

.upload-chapter-container .image-placeholder {
    width: 100%;
    height: 15rem;
    border-radius: 0.5rem;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #23272f;
    /* fallback color */
}

/* Hide previews when preview-hidden is set */
.preview-hidden .upload-chapter-container .image-placeholder {
    background-image: none !important;
}

.upload-chapter-page main {
    background: none;
}

/* Manual toggle class for preview visibility */
.preview-manually-toggled .upload-chapter-container .draggable-item {
    height: auto;
}

.preview-hidden .upload-chapter-container .draggable-item {
    height: 60px;
}

.preview-hidden .image-wrapper .image-placeholder {
    height: 50px;
}

.preview-hidden #dropZone {
    aspect-ratio: auto;
}
/* .preview-hidden #dropZone label p {
    display: none;
} */



/* User Settings - Projects */
.card-md .unit.pending a {
    background: #431e1e;
    border: 1px solid #532a2aa6;
    color: #ffc5c5;
}
.card-md .unit:hover.pending a {
    background: #482424 !important;
    border: 1px solid #632b2b !important;
    color: #ffc5c5;
}

/* User Settings - Uploads */
.original.card-lg .unit.pending .inner {
    background: #431e1e;
    border: 1px solid #532a2aa6;
    color: #ffc5c5;
}
.original.card-lg .unit.pending .inner:hover {
    background: #482424 !important;
    border: 1px solid #632b2b !important;
    color: #ffc5c5;
}

/* Manga Single - Upload Chapter Page */
.upload-chapter-container {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 768px !important;
}

.upload-chapter-container h1 {
    color: white;
    text-align: center;
}

.upload-chapter-container #uploadChapterForm {
    width: 100%;
    margin-top: 1rem;
}

.upload-chapter-container .upload-chapter-rules {
    font-size: 0.875rem;
    text-align: right;
    margin-bottom: 2.5rem;
}

.upload-chapter-container .upload-chapter-rules .rules-head {
    color: #dc3545;
    font-weight: bold;
}

.upload-chapter-container .upload-chapter-rules ul {
    list-style-type: disc;
    margin-top: 0.25rem;
    padding-right: 2rem;
}

.upload-chapter-container .upload-chapter-rules .link {
    color: #3c8bc6;
}

.upload-chapter-container .upload-chapter-rules .link:hover {
    color: #5fb4f4;
}

.upload-chapter-container .form-group {
    width: 100%;
    text-align: center;
    margin-top: 0.5rem;
}

.upload-chapter-container .submit-chapter {
    width: 100%;
    margin-top: 0.25rem;
}

.upload-chapter-container .alert {
    margin-top: 0.75rem;
}

.upload-chapter-container .progress {
    margin-top: 0.75rem;
}

.upload-chapter-container .button-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.upload-chapter-container .up-chapter-btn {
    width: 100%;
    height: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: none;
    border-radius: 0.375rem;
    background-color: #4b5563;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

.upload-chapter-container .up-chapter-btn:hover {
    background-color: #374151;
}

.upload-chapter-container #imagePreviewContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

@media (min-width: 768px) {
    .upload-chapter-container #imagePreviewContainer {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .upload-chapter-container #imagePreviewContainer {
        grid-template-columns: repeat(4, 1fr);
    }
}

.upload-chapter-container #dropZone {
    border-width: 2px;
    border-style: dashed;
    border-color: #4b5563;
    border-radius: 0.5rem;
    text-align: center;
    transition: border-color 0.3s;
    aspect-ratio: 3 / 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-chapter-container #dropZone:hover {
    border-color: #3b82f6;
}

.upload-chapter-container #chapterImages {
    display: none;
}

.upload-chapter-container #dropZone label {
    cursor: pointer;
    height: 100%;
    width: 100%;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-chapter-container #dropZone svg {
    margin-left: auto;
    margin-right: auto;
    height: 2rem;
    width: 2rem;
    color: #6b7280;
}

.upload-chapter-container #dropZone p {
    margin-top: 0.25rem;
    margin-bottom: 0;
    font-size: 0.875rem;
    color: #9ca3af;
}

.upload-chapter-container #dropZone p + p {
    font-size: 0.75rem;
    color: #6b7280;
}

.upload-chapter-container #invalidFilesModal,
.upload-chapter-container #processingOverlay,
.upload-chapter-container #previewProcessingOverlay,
.upload-chapter-container #reorderOverlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.upload-chapter-container .modal-content,
.upload-chapter-container .processing-box,
.upload-chapter-container .preview-box,
.upload-chapter-container .reorder-box {
    background-color: #1f2937;
    border-radius: 0.5rem;
    padding: 1.5rem;
    max-width: 28rem;
    width: 100%;
    margin: 0 1rem;
    color: white;
    text-align: left;
}

.upload-chapter-container .modal-content h3,
.upload-chapter-container .processing-box h3,
.upload-chapter-container .preview-box h3,
.upload-chapter-container .reorder-box h3 {
    font-size: 1.125rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.upload-chapter-container .modal-content p,
.upload-chapter-container .processing-box p,
.upload-chapter-container .preview-box p,
.upload-chapter-container .reorder-box p {
    margin-bottom: 1rem;
    color: #d1d5db;
}

.upload-chapter-container #invalidFilesList,
.upload-chapter-container #processingStatus,
.upload-chapter-container #previewStatus {
    font-size: 0.875rem;
    color: #9ca3af;
    text-align: center;
    margin-top: 0.5rem;
}

.upload-chapter-container .progress-bar-bg {
    width: 100%;
    background-color: #374151;
    border-radius: 9999px;
    height: 0.625rem;
    overflow: hidden;
}

.upload-chapter-container .progress-bar-fill {
    background-color: #2563eb;
    height: 0.625rem;
    border-radius: 9999px;
    transition: width 0.3s;
}

.upload-chapter-container .modal-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.upload-chapter-container .modal-buttons button {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    color: white;
    transition: background-color 0.3s;
    width: 100%;
    margin-top: 12px;
}

.upload-chapter-container #skipInvalidFiles {
    background-color: #2563eb;
}

.upload-chapter-container #skipInvalidFiles:hover {
    background-color: #1d4ed8;
}

.upload-chapter-container #cancelUpload {
    background-color: #374151;
}

.upload-chapter-container #cancelUpload:hover {
    background-color: #4b5563;
}

.upload-chapter-container .draggable-item {
    position: relative;
    background-color: #1f2937;
    border-radius: 0.5rem;
    /* overflow: hidden; */
    flex-grow: 1;
    min-width: 150px;
    max-width: 1fr;
}

.upload-chapter-container .image-wrapper {
    position: relative;
}

.upload-chapter-container .image-preview {
    width: 100%;
    height: 15rem;
    object-fit: cover;
    border-radius: 0.5rem;
}

.upload-chapter-container .delete-image-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    padding: 0.25rem;
    z-index: 20;
    background-color: #dc2626;
    color: white;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 100%;
    transition: background-color 0.3s;
    border: none;
    font-size: 1rem;
    cursor: pointer;
}

.upload-chapter-container .delete-image-btn:hover {
    background-color: #b91c1c;
}

.upload-chapter-container .drag-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-chapter-container .drag-icon i {
    background-color: white;
    color: black;
    padding: 0.5rem;
    border-radius: 9999px;
    font-size: 1.25rem;
    opacity: 0.6;
}

.upload-chapter-container .image-name {
    font-size: 0.875rem;
    color: #d1d5db;
    margin: 0.25rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    justify-content: center;
}

@keyframes float {
    0% { transform: translateY(-3px); }
    50% { transform: translateY(3px); }
    100% { transform: translateY(-3px); }
}

.upload-chapter-container .sortable-ghost {
    background-color: #4e698e82;
    animation: float 0.6s ease-in-out infinite;
}

.upload-chapter-container .sortable-ghost * {
    visibility: hidden;
}

.upload-chapter-container .image-placeholder {
    width: 100%;
    height: 15rem;
    border-radius: 0.5rem;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #23272f;
    /* fallback color */
}

/* Hide previews when preview-hidden is set */
.preview-hidden .upload-chapter-container .image-placeholder {
    background-image: none !important;
}

.upload-chapter-page main {
    background: none;
}

/* Manual toggle class for preview visibility */
.preview-manually-toggled .upload-chapter-container .draggable-item {
    height: auto;
}

.preview-hidden .upload-chapter-container .draggable-item {
    height: 60px;
}

.preview-hidden .image-wrapper .image-placeholder {
    height: 50px;
}

.preview-hidden #dropZone {
    aspect-ratio: auto;
}
/* .preview-hidden #dropZone label p {
    display: none;
} */



#imagePreviewContainer {
    padding: 0 20px;
    transition: max-height 0.3s ease;
}

/* Preview Controls Layout */
.upload-chapter-container .preview-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.upload-chapter-container .preview-controls .btn {
    width: 100%;
}

/* Images Summary (shown when images are hidden) */
.images-summary {
    margin-top: 1rem;
    padding: 1.5rem;
    background-color: rgba(60, 139, 198, 0.1);
    border: 1px solid rgba(60, 139, 198, 0.3);
    border-radius: 8px;
    text-align: center;
}

.images-summary .summary-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.images-summary .summary-content i {
    font-size: 2.5rem;
    color: #3c8bc6;
}

.images-summary .summary-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.images-summary .summary-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.images-summary .summary-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.images-summary .summary-value {
    color: #fff;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .images-summary .summary-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .images-summary .summary-content i {
        font-size: 2rem;
    }
    
    .images-summary .summary-info {
        width: 100%;
    }
}

/* Fixed Scroll to Bottom Button */
.scroll-to-bottom-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #3c8bc6;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
}

.scroll-to-bottom-btn:hover {
    background-color: #5fb4f4;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.scroll-to-bottom-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .scroll-to-bottom-btn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .upload-chapter-container .preview-controls {
        grid-template-columns: 1fr;
    }
}

