/* Editor styles for authenticated users */

/* Editable element indicators */
[data-editable] {
  position: relative;
}

.authenticated [data-editable]:hover {
  outline: 2px dashed #007bff;
  cursor: pointer;
}

.authenticated [data-editable]:hover::after {
  content: 'Click to edit: ' attr(data-editable);
  position: absolute;
  top: -30px;
  left: 0;
  background: #007bff;
  color: white;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 3px;
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
}

/* Modal overlay */
.editor-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

/* Modal content */
.editor-modal-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 800px;
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Modal header */
.editor-modal-header {
  padding: 20px 20px 10px 20px;
  border-bottom: 1px solid #eee;
}

.editor-modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: #333;
}

/* Editor container */
.editor-container {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
  max-height: calc(70vh - 180px); /* Account for header and footer */
  min-height: 200px;
}

/* Quill editor customizations */
.ql-editor {
  min-height: 120px;
  max-height: 300px;
  font-size: 16px;
  line-height: 1.5;
  overflow-y: auto;
}

.ql-toolbar {
  border-top: 1px solid #ccc;
  border-left: 1px solid #ccc;
  border-right: 1px solid #ccc;
}

.ql-container {
  border-bottom: 1px solid #ccc;
  border-left: 1px solid #ccc;
  border-right: 1px solid #ccc;
}

/* Modal footer */
.editor-modal-footer {
  padding: 15px 20px;
  border-top: 1px solid #eee;
  background: #fafafa;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  min-height: 60px;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #545b62;
}

.btn-primary {
  background-color: #007bff;
  color: white;
}

.btn-primary:hover {
  background-color: #0056b3;
}

.btn-primary:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

/* Login modal */
.login-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-modal-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 400px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-weight: bold;
  color: #333;
}

.form-group input {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 16px;
}

.form-group input:focus {
  outline: none;
  border-color: #007bff;
}

.error-message {
  color: #dc3545;
  font-size: 14px;
  margin-top: 10px;
}

/* Success feedback */
.save-success {
  background-color: #d4edda;
  color: #155724;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
}

/* Loading state */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Admin indicator */
.admin-indicator {
  position: fixed;
  top: 10px;
  right: 10px;
  background: #28a745;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 1000;
}

/* Responsive design */
@media (max-width: 768px) {
  .editor-modal {
    padding: 10px;
  }
  
  .editor-modal-content {
    max-width: 100%;
    max-height: 90vh;
  }
  
  .editor-container {
    padding: 15px;
    max-height: calc(90vh - 180px);
  }
  
  .ql-editor {
    min-height: 120px;
    max-height: 300px;
  }
}