/* Knowledge photos styling */
.knowledge-photos {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0.5rem 0;
    align-items: flex-start;
}

.photo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
}

.photo-thumbnail {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
    margin-bottom: 4px;
}

.photo-thumbnail:hover {
    transform: scale(1.05);
}

.photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-delete-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.photo-thumbnail:hover .photo-delete-btn {
    opacity: 1;
}

.photo-delete-btn:hover {
    background: rgba(255, 0, 0, 1);
}

.add-photo-btn {
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.add-photo-btn:hover {
    background: #e0e0e0;
    border-color: #2E7D32;
}

.photo-filename {
    font-size: 0.75rem;
    color: #666;
    text-align: center;
    width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* When there are existing photos, make the add button smaller */
.knowledge-photos .photo-item + .add-photo-btn {
    width: 80px;
    height: 80px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 20px; /* Align with photo thumbnails */
}

.knowledge-photos .photo-item + .add-photo-btn span {
    font-size: 24px;
}

/* Photo viewer modal */
.photo-modal .modal-content {
    max-width: 90vw;
    max-height: 90vh;
}

.photo-viewer .modal-body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.photo-viewer img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

/* Adjust knowledge item layout when photos are present */
.knowledge-item.has-photos .knowledge-content {
    padding-bottom: 1rem;
}

/* Document upload area in Documents tab */
#documentsSection .file-upload-section {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

#documentsSection .upload-area {
    background: white;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
}

#documentsSection .upload-area.drag-over {
    border-color: #2E7D32;
    background: #f0f8f0;
}

.divider {
    text-align: center;
    margin: 2rem 0;
    color: #ccc;
    position: relative;
}

#documentsSection h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #333;
}