/* WYSIWYG Editor Styles */ .wysiwyg-container { position: relative; } .wysiwyg-editor { min-height: 400px; border: 1px solid #d1d5db; border-radius: 6px; background-color: white; } .wysiwyg-toolbar { border: 1px solid #d1d5db; border-bottom: none; border-radius: 6px 6px 0 0; background-color: #f9fafb; padding: 8px; display: flex; flex-wrap: wrap; gap: 4px; } .wysiwyg-btn { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 4px; background-color: white; cursor: pointer; font-size: 12px; transition: all 0.2s; } .wysiwyg-btn:hover { background-color: #f3f4f6; border-color: #9ca3af; } .wysiwyg-btn.active { background-color: #3b82f6; color: white; border-color: #3b82f6; } .wysiwyg-separator { width: 1px; height: 24px; background-color: #d1d5db; margin: 0 4px; } .wysiwyg-select { padding: 4px 8px; border: 1px solid #d1d5db; border-radius: 4px; background-color: white; font-size: 12px; } .wysiwyg-content { padding: 12px; min-height: 350px; font-family: inherit; font-size: 14px; line-height: 1.5; border: none; outline: none; resize: vertical; } .wysiwyg-content:focus { outline: 2px solid #3b82f6; outline-offset: -2px; } /* Form integration */ .publication-form .form-group:has(.wysiwyg-container) { margin-bottom: 20px; } .wysiwyg-label { display: block; margin-bottom: 8px; font-weight: 600; color: #374151; } /* Character count */ .wysiwyg-char-count { margin-top: 8px; font-size: 12px; color: #6b7280; text-align: right; } /* Image Gallery */ .image-gallery { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); z-index: 1000; overflow-y: auto; } .image-gallery.open { display: block; } .gallery-container { max-width: 1200px; margin: 50px auto; background: white; border-radius: 8px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); } .gallery-header { padding: 20px; border-bottom: 1px solid #ddd; display: flex; justify-content: space-between; align-items: center; } .gallery-title { font-size: 18px; font-weight: bold; margin: 0; } .gallery-close { background: #dc3545; color: white; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 14px; } .gallery-close:hover { background: #c82333; } .gallery-content { padding: 20px; } .gallery-tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid #ddd; } .gallery-tab { padding: 10px 20px; background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; font-size: 14px; font-weight: 500; } .gallery-tab.active { border-bottom-color: #007bff; color: #007bff; } .gallery-tab:hover { color: #007bff; } .gallery-upload { display: none; padding: 20px; border: 2px dashed #ddd; border-radius: 4px; text-align: center; } .gallery-upload.active { display: block; } .upload-area { padding: 40px; border: 2px dashed #007bff; border-radius: 4px; background: #f8f9fa; cursor: pointer; transition: all 0.3s ease; } .upload-area:hover { background: #e3f2fd; border-color: #0056b3; } .upload-area.dragover { background: #e3f2fd; border-color: #0056b3; } .upload-icon { font-size: 48px; color: #007bff; margin-bottom: 10px; } .upload-text { font-size: 16px; color: #333; margin-bottom: 10px; } .upload-hint { font-size: 14px; color: #666; } .file-input { display: none; } .gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 15px; max-height: 400px; overflow-y: auto; } .gallery-item { position: relative; border: 1px solid #ddd; border-radius: 4px; overflow: hidden; cursor: pointer; transition: all 0.3s ease; } .gallery-item:hover { border-color: #007bff; box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3); } .gallery-item.selected { border-color: #007bff; box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.5); } .gallery-image { width: 100%; height: 120px; object-fit: cover; display: block; } .gallery-info { padding: 8px; font-size: 12px; color: #666; background: #f8f9fa; } .gallery-name { font-weight: 500; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .gallery-size { color: #666; } .gallery-actions { padding: 15px; border-top: 1px solid #ddd; display: flex; justify-content: space-between; align-items: center; } .gallery-insert { background: #007bff; color: white; border: none; padding: 10px 20px; border-radius: 4px; cursor: pointer; font-size: 14px; } .gallery-insert:hover:not(:disabled) { background: #0056b3; } .gallery-insert:disabled { background: #6c757d; cursor: not-allowed; } .gallery-upload-btn { background: #28a745; color: white; border: none; padding: 10px 20px; border-radius: 4px; cursor: pointer; font-size: 14px; } .gallery-upload-btn:hover { background: #218838; } .upload-progress { margin-top: 15px; display: none; } .upload-progress.active { display: block; } .progress-bar { width: 100%; height: 8px; background: #e9ecef; border-radius: 4px; overflow: hidden; } .progress-fill { height: 100%; background: #007bff; width: 0%; transition: width 0.3s ease; } .upload-status { margin-top: 10px; font-size: 14px; color: #666; } .upload-status.success { color: #28a745; } .upload-status.error { color: #dc3545; } /* Responsive Design */ @media (max-width: 768px) { .gallery-container { margin: 20px; max-width: none; } .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; } .gallery-image { height: 80px; } .gallery-header { flex-direction: column; gap: 10px; text-align: center; } .gallery-actions { flex-direction: column; gap: 10px; } .gallery-insert, .gallery-upload-btn { width: 100%; } } @media (max-width: 768px) { .wysiwyg-toolbar { padding: 6px; gap: 2px; } .wysiwyg-btn { padding: 4px 6px; font-size: 11px; } .wysiwyg-content { padding: 8px; min-height: 300px; } } /* Image Resizing */ .wysiwyg-content img { max-width: 100%; height: auto; display: inline-block; cursor: move; } .wysiwyg-content img.resizing { outline: 2px solid #007bff; outline-offset: 2px; } .resize-container { position: relative; display: inline-block; cursor: move; } .resize-container.resizing { outline: 2px solid #007bff; outline-offset: 2px; } .resize-handle { position: absolute; background: #007bff; border: 1px solid #fff; border-radius: 50%; width: 8px; height: 8px; z-index: 1000; } .resize-handle:hover { background: #0056b3; transform: scale(1.2); } .resize-handle.nw { top: -4px; left: -4px; cursor: nw-resize; } .resize-handle.ne { top: -4px; right: -4px; cursor: ne-resize; } .resize-handle.sw { bottom: -4px; left: -4px; cursor: sw-resize; } .resize-handle.se { bottom: -4px; right: -4px; cursor: se-resize; } .resize-handle.n { top: -4px; left: 50%; transform: translateX(-50%); cursor: n-resize; } .resize-handle.s { bottom: -4px; left: 50%; transform: translateX(-50%); cursor: s-resize; } .resize-handle.w { top: 50%; left: -4px; transform: translateY(-50%); cursor: w-resize; } .resize-handle.e { top: 50%; right: -4px; transform: translateY(-50%); cursor: e-resize; } .resize-handle.nw:hover, .resize-handle.ne:hover, .resize-handle.sw:hover, .resize-handle.se:hover { transform: scale(1.2); } .resize-handle.n:hover, .resize-handle.s:hover { transform: translateX(-50%) scale(1.2); } .resize-handle.w:hover, .resize-handle.e:hover { transform: translateY(-50%) scale(1.2); } .size-display { position: absolute; bottom: -25px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, 0.8); color: white; padding: 2px 6px; border-radius: 3px; font-size: 11px; font-family: monospace; pointer-events: none; z-index: 1001; white-space: nowrap; } .aspect-ratio-toggle { position: absolute; top: -30px; right: 0; background: #007bff; color: white; border: none; padding: 4px 8px; border-radius: 3px; font-size: 11px; cursor: pointer; z-index: 1001; } .aspect-ratio-toggle:hover { background: #0056b3; } .aspect-ratio-toggle.locked { background: #28a745; } .aspect-ratio-toggle.locked:hover { background: #218838; } @media (max-width: 768px) { .wysiwyg-toolbar { padding: 6px; gap: 2px; } .wysiwyg-btn { padding: 4px 6px; font-size: 11px; } .resize-handle { width: 10px; height: 10px; } .size-display { font-size: 10px; bottom: -20px; } }