/* MyLibrary Popup Styles - Matching books popup style */
.mylibrary-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mylibrary-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
}

.mylibrary-popup-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    height: 85%;
    max-height: 800px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 10001;
}

.mylibrary-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid #e1e5e9;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.mylibrary-popup-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.mylibrary-popup-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mylibrary-popup-close:hover {
    background: #e1e5e9;
    color: #333;
}

.mylibrary-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mylibrary-popup-body::-webkit-scrollbar {
    width: 10px;
}

.mylibrary-popup-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.mylibrary-popup-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

.mylibrary-popup-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Upload Section */
.mylibrary-upload-section {
    border: 2px dashed #e1e5e9;
    border-radius: 8px;
    padding: 24px;
    background: #f8f9fa;
}

.mylibrary-upload-section h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.mylibrary-upload-area {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mylibrary-upload-area:hover {
    border-color: #4f46e5;
}

.mylibrary-upload-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.mylibrary-upload-placeholder svg {
    margin: 0 auto 16px;
    color: #4f46e5;
}

.mylibrary-upload-placeholder p {
    margin: 8px 0;
    font-size: 14px;
}

.mylibrary-upload-hint {
    font-size: 12px;
    color: #999;
}

.mylibrary-upload-progress {
    margin-top: 16px;
}

.mylibrary-progress-bar {
    width: 100%;
    height: 8px;
    background: #e1e5e9;
    border-radius: 4px;
    overflow: hidden;
}

.mylibrary-progress-fill {
    height: 100%;
    background: #4f46e5;
    transition: width 0.3s ease;
    width: 0%;
}

.mylibrary-upload-progress p {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* File List Section */
.mylibrary-list-section {
    flex: 1;
    min-height: 0;
}

.mylibrary-list-section h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.mylibrary-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.mylibrary-loading .spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4f46e5;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.mylibrary-file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.mylibrary-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.mylibrary-file-item:hover {
    background: #f0f0f0;
    border-color: #4f46e5;
}

.mylibrary-file-info {
    flex: 1;
    min-width: 0;
}

.mylibrary-file-name {
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 4px 0;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mylibrary-file-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #666;
}

.mylibrary-file-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.mylibrary-file-status.uploading {
    background: #fff3cd;
    color: #856404;
}

.mylibrary-file-status.analyzing {
    background: #cfe2ff;
    color: #084298;
}

.mylibrary-file-status.converting {
    background: #cfe2ff;
    color: #084298;
}

.mylibrary-file-status.completed {
    background: #d1e7dd;
    color: #0f5132;
}

.mylibrary-file-status.failed {
    background: #f8d7da;
    color: #842029;
}

.mylibrary-file-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.mylibrary-use-btn {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mylibrary-use-btn:hover {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.mylibrary-use-btn:active {
    transform: translateY(0);
}

.mylibrary-use-btn:disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.mylibrary-delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mylibrary-delete-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.mylibrary-delete-btn:active {
    transform: translateY(0);
}

.mylibrary-empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.mylibrary-empty p {
    margin: 8px 0;
    font-size: 14px;
}

