/* Saved Books Modal - Professional Floating Icon */

/* Floating Action Button */
.saved-books-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #a142d1 0%, #7b2cbf 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(161, 66, 209, 0.4);
    transition: all 0.3s ease;
    z-index: 9998;
    border: none;
}

.saved-books-fab:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 6px 30px rgba(161, 66, 209, 0.6);
}

.saved-books-fab i {
    font-size: 24px;
    color: white;
}

.saved-books-fab .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #c41e3a;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* Modal Overlay */
.saved-books-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.saved-books-modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

/* Modal Container */
.saved-books-modal {
    background: #ffffff;
    border-radius: 16px;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    border: 2px solid #e0e7ff;
}

/* Modal Header */
.saved-books-modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid #e0e7ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9ff;
}

.saved-books-modal-header h2 {
    margin: 0;
    color: #a142d1;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.saved-books-modal-header h2 i {
    font-size: 1.6rem;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: #666;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    padding: 5px 10px;
    transition: all 0.3s;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    color: #a142d1;
    background: rgba(161, 66, 209, 0.1);
    transform: rotate(90deg);
}

/* Modal Search */
.modal-search-bar {
    padding: 20px 30px;
    border-bottom: 2px solid #e0e7ff;
    display: flex;
    justify-content: center;
}

.modal-search-bar input {
    width: 100%;
    max-width: 500px;
    padding: 12px 16px;
    background: #ffffff;
    border: 2px solid #e0e7ff;
    border-radius: 8px;
    color: #333;
    font-size: 15px;
    transition: all 0.3s;
}

.modal-search-bar input:focus {
    outline: none;
    border-color: #a142d1;
    box-shadow: 0 0 0 3px rgba(161, 66, 209, 0.1);
}

/* Modal Body */
.saved-books-modal-body {
    padding: 20px 30px;
    overflow-y: auto;
    flex: 1;
    background: #fafbff;
}

/* Books List */
.modal-books-list {
    display: grid;
    gap: 15px;
}

.modal-book-item {
    background: #ffffff;
    border: 2px solid #e0e7ff;
    border-radius: 10px;
    padding: 18px;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.modal-book-item:hover {
    border-color: #a142d1;
    background: #f8f9ff;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(161, 66, 209, 0.1);
}

.modal-book-info {
    flex: 1;
    min-width: 0;
}

.modal-book-title {
    color: #a142d1;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-book-meta {
    display: flex;
    gap: 20px;
    font-size: 0.9rem;
    color: #666;
    flex-wrap: wrap;
}

.modal-book-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.modal-book-actions {
    display: flex;
    gap: 10px;
}

.modal-action-btn {
    padding: 10px 16px;
    background: #a142d1;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.modal-action-btn:hover {
    background: #7b2cbf;
    transform: translateY(-2px);
}

.modal-action-btn.delete {
    background: #c41e3a;
}

.modal-action-btn.delete:hover {
    background: #a01729;
}

.modal-action-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.modal-action-btn:disabled:hover {
    transform: none;
}

/* Empty State */
.modal-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.modal-empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #a142d1;
    opacity: 0.6;
}

.modal-empty-state h3 {
    color: #333;
    margin: 0 0 10px 0;
}

.modal-empty-state p {
    margin: 0;
}

/* Loading State */
.modal-loading {
    text-align: center;
    padding: 40px;
    color: #a142d1;
}

.modal-loading i {
    font-size: 3rem;
    animation: spin 1s linear infinite;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Icon Buttons */
.modal-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s;
    color: white;
}

.modal-icon-btn.purple {
    background: #a142d1;
}

.modal-icon-btn.purple:hover {
    background: #7b2cbf;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(161, 66, 209, 0.3);
}

.modal-icon-btn.red {
    background: #c41e3a;
}

.modal-icon-btn.red:hover {
    background: #a01729;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
}

.modal-icon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.modal-icon-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Edit Modal Overlay */
.edit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

/* Edit Modal */
.edit-modal {
    background: #ffffff;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    border: 2px solid #e0e7ff;
}

.edit-modal-header {
    padding: 20px 25px;
    border-bottom: 2px solid #e0e7ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9ff;
}

.edit-modal-header h3 {
    margin: 0;
    color: #a142d1;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.edit-close-btn {
    background: transparent;
    border: none;
    color: #666;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s;
}

.edit-close-btn:hover {
    color: #a142d1;
    background: rgba(161, 66, 209, 0.1);
    transform: rotate(90deg);
}

.edit-modal-body {
    padding: 25px;
    overflow-y: auto;
    flex: 1;
}

.edit-form-group {
    margin-bottom: 20px;
}

.edit-form-group:last-child {
    margin-bottom: 0;
}

.edit-form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-form-group label i {
    color: #a142d1;
}

.edit-form-group input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e7ff;
    border-radius: 8px;
    font-size: 15px;
    color: #333;
    transition: all 0.3s;
}

.edit-form-group input[type="text"]:focus {
    outline: none;
    border-color: #a142d1;
    box-shadow: 0 0 0 3px rgba(161, 66, 209, 0.1);
}

/* Dropzone Styling */
.dropzone {
    width: 100%;
    min-height: 150px;
    border: 3px dashed #e0e7ff;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    background: #fafbff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropzone:hover {
    border-color: #a142d1;
    background: #f8f9ff;
}

.dropzone.dragover {
    border-color: #a142d1;
    background: linear-gradient(135deg, rgba(161, 66, 209, 0.05), rgba(123, 44, 191, 0.05));
    transform: scale(1.02);
}

.dropzone-content {
    text-align: center;
    padding: 30px;
}

.dropzone-content i {
    font-size: 3rem;
    color: #a142d1;
    margin-bottom: 15px;
    display: block;
}

.dropzone-text {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
    font-weight: 500;
}

.dropzone-formats {
    color: #999;
    font-size: 13px;
}

.dropzone-preview {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    border-radius: 8px;
    margin: 15px;
}

.dropzone-preview i {
    font-size: 2rem;
    color: #a142d1;
}

.dropzone-preview .preview-filename {
    flex: 1;
    color: #333;
    font-weight: 500;
    word-break: break-word;
}

.remove-file-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #c41e3a;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.remove-file-btn:hover {
    background: #a01729;
    transform: rotate(90deg);
}

.current-file-info {
    display: block;
    margin-top: 8px;
    color: #666;
    font-size: 13px;
}

.edit-modal-footer {
    padding: 20px 25px;
    border-top: 2px solid #e0e7ff;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: #fafbff;
}

.edit-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-btn.cancel {
    background: #e0e7ff;
    color: #666;
}

.edit-btn.cancel:hover {
    background: #d0d7ef;
    color: #333;
}

.edit-btn.save {
    background: #a142d1;
    color: white;
}

.edit-btn.save:hover {
    background: #7b2cbf;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(161, 66, 209, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .saved-books-fab {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }

    .saved-books-fab i {
        font-size: 22px;
    }

    .saved-books-modal {
        width: 95%;
        max-height: 90vh;
    }

    .saved-books-modal-header {
        padding: 20px;
    }

    .saved-books-modal-header h2 {
        font-size: 1.4rem;
    }

    .modal-search-bar {
        padding: 15px 20px;
    }

    .saved-books-modal-body {
        padding: 15px 20px;
    }

    .modal-book-item {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-book-actions {
        width: 100%;
    }

    .modal-action-btn {
        flex: 1;
        justify-content: center;
    }

    .modal-book-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-icon-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .edit-modal {
        width: 95%;
    }
    
    .edit-modal-footer {
        flex-direction: column;
    }
    
    .edit-btn {
        width: 100%;
    }
}
