/* Notes Editor Styles */
.notes-editor-container {
    position: relative;
    margin-bottom: 1rem;
}

.notes-editor {
    min-height: 200px;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.75rem;
    background-color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
    overflow-y: auto;
}

.notes-editor:focus {
    outline: none;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.notes-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 0.5rem 0;
}

.notes-editor p {
    margin: 0 0 1rem 0;
}

.notes-editor p:last-child {
    margin-bottom: 0;
}

.notes-editor-toolbar {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
    border-radius: 0.375rem 0.375rem 0 0;
}

.notes-editor-toolbar button {
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    color: #6c757d;
    font-size: 14px;
}

.notes-editor-toolbar button:hover {
    background-color: #e9ecef;
    color: #495057;
}

.notes-editor-toolbar button.active {
    background-color: var(--primary-color);
    color: white;
}

/* Attachments */
.attachments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    background-color: #f8f9fa;
    font-size: 14px;
}

.attachment-item .attachment-info {
    flex: 1;
}

.attachment-item .attachment-name {
    font-weight: 500;
    color: #495057;
}

.attachment-item .attachment-size {
    color: #6c757d;
    font-size: 12px;
}

.attachment-item .attachment-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
}

.attachment-item .attachment-remove:hover {
    background-color: #f5c6cb;
}

.attachment-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.attachment-buttons .btn {
    font-size: 13px;
    padding: 0.375rem 0.75rem;
}

/* Image thumbnails in editor */
.notes-editor .image-placeholder {
    display: inline-block;
    width: 150px;
    height: 100px;
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 4px;
    text-align: center;
    line-height: 100px;
    color: #6c757d;
    margin: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notes-editor .image-placeholder:hover {
    background-color: #e9ecef;
    border-color: var(--primary-color);
}

.notes-editor .image-placeholder i {
    font-size: 24px;
}

/* Drag and drop */
.notes-editor.dragover {
    border-color: var(--primary-color);
    background-color: #f8f9ff;
}

.notes-editor.dragover::before {
    content: "Drop images here";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary-color);
    font-weight: 500;
    font-size: 16px;
    pointer-events: none;
    z-index: 10;
}

/* Loading states */
.attachment-item.loading {
    opacity: 0.6;
}

.attachment-item.loading .attachment-info::after {
    content: "Uploading...";
    color: var(--primary-color);
    font-size: 12px;
    margin-left: 0.5rem;
}

/* Error states */
.attachment-item.error {
    border-color: #dc3545;
    background-color: #f8d7da;
}

.attachment-item.error .attachment-info::after {
    content: "Upload failed";
    color: #dc3545;
    font-size: 12px;
    margin-left: 0.5rem;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .notes-editor {
        min-height: 150px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .attachment-buttons {
        flex-direction: column;
    }
    
    .attachment-buttons .btn {
        width: 100%;
        text-align: left;
    }
    
    .attachments-list {
        flex-direction: column;
    }
    
    .attachment-item {
        width: 100%;
    }
}

/* Rich text formatting */
.notes-editor strong {
    font-weight: 600;
}

.notes-editor em {
    font-style: italic;
}

.notes-editor ul, .notes-editor ol {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.notes-editor ul {
    list-style-type: disc;
}

.notes-editor ol {
    list-style-type: decimal;
}

.notes-editor li {
    margin: 0.25rem 0;
}

.notes-editor blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1rem 0;
    color: #6c757d;
    font-style: italic;
}

.notes-editor hr {
    border: none;
    border-top: 1px solid #dee2e6;
    margin: 1rem 0;
}

/* Placeholder text */
.notes-editor[data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: #6c757d;
    font-style: italic;
    pointer-events: none;
}

/* Notes Content Display (detail pages) */
.notes-content {
    padding: 0.5rem 0;
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
}

.notes-content p {
    margin: 0 0 0.75rem 0;
}

.notes-content p:last-child {
    margin-bottom: 0;
}

.notes-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 0.5rem 0;
}

.notes-content ul, .notes-content ol {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.notes-content li {
    margin: 0.25rem 0;
}

.notes-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1rem 0;
    color: #6c757d;
    font-style: italic;
}