/* Component-specific styles for spines */

/* Notices and alerts */
.changes-notice {
    border: 2px solid #ff6600;
    background: #fff3e0;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 12px;
}

.changes-notice code {
    background: #f0f0f0;
    padding: 2px 4px;
    font-family: inherit;
    border: 1px solid #ccc;
}

.review-notice {
    border: 2px solid #0066cc;
    background: #f0f8ff;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 12px;
}

.review-link {
    color: #0066cc;
    text-decoration: none;
    font-weight: bold;
    margin-left: 10px;
}

.review-link:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    border: 1px solid black;
    background: white;
    padding: 4px 8px;
    font-family: inherit;
    font-size: 10px;
    cursor: pointer;
}

.btn:hover {
    background: #f0f0f0;
}

.btn.primary {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
}

.btn.primary:hover {
    background: #004499;
}

.process-button {
    border: 2px solid #006600;
    background: #006600;
    color: white;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    margin-left: 10px;
    font-weight: bold;
}

.process-button:hover {
    background: #004400;
}

.process-button:disabled {
    background: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

.process-status {
    margin-left: 10px;
    font-weight: bold;
}

/* Upload zone */
.upload-zone {
    border: 2px dashed #ccc;
    background: #fafafa84;
    padding: 40px;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #0066cc;
    background: #f0f8ff30;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.upload-text {
    font-size: 14px;
}

.browse-button {
    background: none;
    border: 1px solid #0066cc;
    color: #0066cc;
    padding: 4px 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
}

.browse-button:hover {
    background: #0066cc;
    color: white;
}

.upload-progress {
    margin-top: 15px;
}

.upload-status {
    margin-top: 10px;
    font-weight: bold;
}

/* Progress bars */
.progress-bar {
    border: 1px solid black;
    height: 20px;
    background: white;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: #0066cc;
    transition: width 0.3s ease;
    width: 0%;
}

.process-progress {
    margin-top: 15px;
    border: 1px solid #ccc;
    background: #f8f8f8;
    padding: 10px;
}

.progress-details {
    font-size: 11px;
    margin-bottom: 10px;
    font-weight: bold;
}

/* File lists */
.file-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    background: white;
    padding: 5px;
}

.file-item {
    padding: 3px 0;
    font-size: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-item:last-child {
    border-bottom: none;
}

.file-name {
    flex: 1;
    margin-right: 10px;
    word-break: break-all;
}

.file-status {
    font-weight: bold;
    padding: 1px 4px;
    font-size: 9px;
}

.file-status.processing {
    color: #0066cc;
}

.file-status.success {
    color: #006600;
}

.file-status.failed {
    color: #cc0000;
}

.file-status.error {
    color: #cc0000;
}

/* Filters */
.filters {
    border: 2px solid black;
    padding: 15px;
    margin-bottom: 20px;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#search {
    border: 1px solid black;
    padding: 5px 10px;
    font-family: inherit;
    font-size: 12px;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-controls label {
    font-weight: bold;
}

.sort-controls select {
    padding: 5px;
    border: 1px solid black;
    font-family: inherit;
    font-size: 12px;
    background: white;
}

/* Book grid */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* Book cards */
.book-card {
    border: 2px solid black;
    background: #ffffff8f;
    padding: 15px;
    position: relative;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    transition: background-color 0.2s;
}

.book-card:hover {
    background: #f8f8f8;
}

.book-card.editing {
    border-color: #0066cc;
    background: #f8f8ff;
}

.book-spine {
    flex: 1;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.book-title, .book-author, .book-year, .book-isbn {
    cursor: pointer;
    padding: 2px;
    border: 1px solid transparent;
}

.book-title:hover, .book-author:hover, .book-year:hover, .book-isbn:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.book-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
    line-height: 1.2;
}

.book-author {
    font-size: 14px;
    margin-bottom: 3px;
    color: #333;
}

.book-year {
    font-size: 11px;
    color: #666;
}

.book-isbn {
    font-size: 10px;
    color: #666;
    font-style: italic;
}

.book-meta {
    font-size: 10px;
    color: #666;
    margin-bottom: 10px;
}

.book-meta div {
    margin-bottom: 2px;
}

.contributor {
    color: #0066cc !important;
    font-weight: bold;
}

.related-copies {
    color: #666 !important;
    font-style: italic;
}

.read-status {
    color: #006600 !important;
    font-weight: bold;
}

.tags {
    font-style: italic;
}

.book-link {
    position: absolute;
    top: 10px;
    right: 10px;
    border: 1px solid black;
    background: white;
    padding: 3px 8px;
    text-decoration: none;
    color: black;
    font-size: 10px;
}

.book-link:hover {
    background: black;
    color: white;
}

/* Edit controls */
.edit-controls {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: none;
}

.book-card.editing .edit-controls {
    display: block;
}

.edit-controls button {
    border: 1px solid black;
    background: white;
    padding: 2px 6px;
    font-family: inherit;
    font-size: 9px;
    cursor: pointer;
    margin-left: 2px;
}

.edit-controls button:hover {
    background: #e0e0e0;
}

.edit-controls .save {
    background: #006600;
    color: white;
}

.edit-controls .cancel {
    background: #cc0000;
    color: white;
}

.editable-input {
    border: 1px solid #0066cc;
    background: white;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    width: 100%;
    padding: 1px 3px;
}

/* Processing Queue */
.processing-queue {
    margin-bottom: 20px;
}

/* Upload Progress */
.upload-progress {
    margin-top: 15px;
    border: 1px solid #ccc;
    background: #f8f8f8;
    padding: 10px;
}

.upload-status {
    font-size: 11px;
    margin-top: 5px;
    font-weight: bold;
}

/* MetadataEditor Component Styles */
.metadata-value.editable {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 2px 4px;
    margin: -2px -4px;
    border-radius: 2px;
}

.metadata-value.editable:hover {
    background-color: #f5f5f5;
    outline: 1px dashed #ccc;
}

.metadata-value.editable:focus-within {
    background-color: #e3f2fd;
    outline: 2px solid #2196f3;
}

.metadata-input {
    width: 100%;
    border: 2px solid black;
    background: white;
    padding: 4px 6px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 12px;
    outline: none;
    transition: border-color 0.15s ease;
}

.metadata-input:focus {
    border-color: #2196f3;
    background-color: #fafafa;
    box-shadow: 0 0 0 1px #2196f3;
}

.metadata-value.saving {
    opacity: 0.7;
    background-color: #fff3cd;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.9; }
}

.metadata-feedback {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 8px 12px;
    border: 1px solid black;
    background: white;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 11px;
    z-index: 1000;
    max-width: 250px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.metadata-feedback:not([style*="display: none"]) {
    transform: translateX(0);
}

.metadata-feedback.success {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.metadata-feedback.error {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.metadata-feedback.info {
    background-color: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* Ensure metadata and related text wraps properly on all viewports */
.book-title,
.book-author,
.book-year,
.book-isbn,
.book-meta,
.metadata-value,
.metadata-input,
.metadata-label {
    /* Allow long words / strings to break and wrap */
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Ensure anchors inside metadata also wrap */
.metadata-value a {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Prevent metadata grid from widening viewport on small screens */
.metadata-grid {
    /* Ensure any long content wraps within grid */
    overflow-wrap: anywhere;
    word-break: break-word;
}

.metadata-grid .metadata-value {
    /* Allow the 1fr column to shrink instead of enforcing min-content width */
    min-width: 0;
}

/* Editable fields should only occupy the space their text needs */
.editable-field {
    display: inline-block;
} 