/* Admin Styles - Modern & Professional */

/* Modal Overrides for Admin */
#admin-form-modal .modal-body {
  max-width: 900px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  padding: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

#admin-form-modal .modal-header {
  padding: 24px 32px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#admin-form-modal .modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.025em;
}

#admin-form-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.2s;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#admin-form-close:hover {
  background: #e2e8f0;
  color: #ef4444;
}

/* Dynamic Header Badge */
#admin-dynamic-header {
  background: #eff6ff;
  border-bottom: 1px solid #dbeafe;
  padding: 12px 32px;
  font-size: 0.875rem;
  color: #1e40af;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

#admin-dynamic-type {
  background: #2563eb;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Form Container */
#admin-conteudo-form {
  padding: 32px;
  overflow-y: auto;
  max-height: calc(90vh - 140px);
  background: white;
  box-shadow: none; /* Remove default card shadow */
}

/* Modern Inputs */
#admin-form-modal label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
}

#admin-form-modal input[type="text"],
#admin-form-modal input[type="url"],
#admin-form-modal input[type="number"],
#admin-form-modal input[type="password"],
#admin-form-modal select,
#admin-form-modal textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  outline: none;
}

#admin-form-modal input:focus,
#admin-form-modal select:focus,
#admin-form-modal textarea:focus {
  background: white;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Grid Layout Improvements */
#admin-form-modal .grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

@media (max-width: 640px) {
  #admin-form-modal .grid {
    grid-template-columns: 1fr;
  }
}

/* Quill Editor Customization */
.title-wrapper .ql-toolbar.ql-snow,
.summary-wrapper .ql-toolbar.ql-snow {
  border-color: #cbd5e1 !important;
  border-radius: 8px 8px 0 0;
  background: #f8fafc;
  padding: 8px 12px !important;
}

.title-wrapper .ql-container.ql-snow,
.summary-wrapper .ql-container.ql-snow {
  border-color: #cbd5e1 !important;
  border-radius: 0 0 8px 8px;
  font-family: inherit;
  font-size: 0.95rem;
  background: white;
}

.quill-wrapper {
  margin-bottom: 24px;
}

.title-wrapper .ql-editor,
.summary-wrapper .ql-editor {
  min-height: 60px !important; /* Override default 250px */
}

.ql-toolbar.ql-snow {
  border-color: #cbd5e1 !important;
  border-radius: 8px 8px 0 0;
  background: #f8fafc;
  padding: 12px !important;
  position: sticky;
  top: 0;
  z-index: 10; /* Keep toolbar on top when scrolling content */
}

.ql-container.ql-snow {
  border-color: #cbd5e1 !important;
  border-radius: 0 0 8px 8px;
  font-family: inherit;
  font-size: 1rem;
  background: white;
}

.ql-editor {
  min-height: 250px;
  font-size: 1rem;
  line-height: 1.6;
  color: #334155;
}

.ql-editor.ql-blank::before {
  color: #94a3b8;
  font-style: normal;
}

/* Media Selection Cards */
#admin-blog-media .card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 20px !important;
  box-shadow: none;
}

#admin-blog-media input[type="radio"] {
  accent-color: #2563eb;
  transform: scale(1.2);
}

#admin-blog-media label {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.2s;
  cursor: pointer;
}

#admin-blog-media label:hover {
  background: #e2e8f0;
}

/* Footer Actions */
.modal-footer {
  padding: 20px 32px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s;
  font-size: 0.95rem;
}

.btn.primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 8px -1px rgba(37, 99, 235, 0.3);
}

.btn:not(.primary) {
  background: white;
  border: 1px solid #cbd5e1;
  color: #64748b;
}

.btn:not(.primary):hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

#admin-form-delete {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border: 1px solid #fecaca !important;
}

#admin-form-delete:hover {
  background: #fecaca !important;
  color: #b91c1c !important;
}

/* Z-Index Fixes */
.modal {
  z-index: 9999 !important; /* Ensure it's above everything */
}

/* Quill Z-Index fixes for dropdowns and tooltips */
.ql-tooltip {
  z-index: 10000 !important; 
}

.ql-picker-options {
  z-index: 10005 !important;
}

/* Fix for Quill dropdowns being cut off or behind */
.ql-picker {
  z-index: 2;
}

.ql-picker.ql-expanded .ql-picker-options {
  display: block;
  margin-top: -1px;
  top: 100%;
  z-index: 10005 !important;
}
