/* Admin Menu Editor */

.menu-form-container {
  background: white;
  border-radius: 0.8rem;
  padding: 3rem;
  box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.1);
}

.menu-form-container .form-group {
  margin-bottom: 2.4rem;
}

.menu-form-container .form-group:last-of-type {
  margin-bottom: 3rem;
}

.menu-form-container label {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.8rem;
}

.menu-form-container .form-control {
  width: 100%;
  padding: 1rem 1.4rem;
  font-size: 1.5rem;
  border: 0.1rem solid #d1d5db;
  border-radius: 0.6rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.menu-form-container .form-control:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 0.3rem rgba(59, 130, 246, 0.1);
}

.menu-form-container .form-text {
  display: block;
  font-size: 1.3rem;
  color: #6b7280;
  margin-top: 0.6rem;
}

.menu-form-container .form-actions {
  display: flex;
  gap: 1.2rem;
  padding-top: 2rem;
  border-top: 0.1rem solid #e5e7eb;
}

.menu-form-container .error-explanation {
  background: #fee2e2;
  border: 0.1rem solid #dc2626;
  border-radius: 0.6rem;
  padding: 1.6rem;
  margin-bottom: 2.4rem;
}

.menu-form-container .error-explanation h2 {
  font-size: 1.6rem;
  font-weight: 600;
  color: #991b1b;
  margin: 0 0 1rem 0;
}

.menu-form-container .error-explanation ul {
  margin: 0;
  padding-left: 2rem;
  color: #991b1b;
}

.menu-form-container .error-explanation li {
  font-size: 1.4rem;
  margin-bottom: 0.4rem;
}

.menu-form-container .info-box {
  background: #dbeafe;
  border: 0.1rem solid #3b82f6;
  border-radius: 0.6rem;
  padding: 1.2rem 1.6rem;
  font-size: 1.4rem;
  color: #1e40af;
}

/* Menu Editor Layout */
.menu-editor-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

/* Menu Settings Section */
.menu-settings-section {
  background: white;
  border-radius: 0.8rem;
  padding: 3rem;
  box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.1);
}

.menu-settings-section .collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.menu-settings-section .collapsible-header:hover h2 {
  color: #3b82f6;
}

.menu-settings-section .collapsible-header svg {
  color: #6b7280;
  flex-shrink: 0;
}

.menu-settings-section .collapsible-content {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 1000px;
  opacity: 1;
}

.menu-settings-section .collapsible-content.collapsed {
  max-height: 0;
  opacity: 0;
}

.menu-settings-section h2,
.menu-items-section h2 {
  font-size: 2rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 2rem 0;
  transition: color 0.2s;
}

/* Menu Items Section */
.menu-items-section {
  background: white;
  border-radius: 0.8rem;
  padding: 3rem;
  box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.1);
}

.menu-items-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.4rem;
  padding-bottom: 2rem;
  border-bottom: 0.1rem solid #e5e7eb;
}

.menu-items-header h2 {
  margin: 0;
}

.btn-add-menu-item {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.btn-add-menu-item img {
  filter: brightness(0) invert(1);
}

/* Menu Items List */
.menu-items-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Menu Item - scoped to admin menu editor */
.menu-items-list .menu-item {
  border: 0.2rem solid #e5e7eb;
  border-radius: 0.8rem;
  background: #f9fafb;
  transition: all 0.2s;
}

.menu-items-list .menu-item:hover {
  border-color: #3b82f6;
  box-shadow: 0 0.2rem 0.8rem rgba(59, 130, 246, 0.1);
}

.menu-item[data-level="child"] {
  margin-left: 4rem;
  background: #ffffff;
}

.menu-item-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.6rem;
}

.menu-item-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem;
  color: #9ca3af;
  cursor: grab;
  transition: color 0.2s;
  flex-shrink: 0;
}

.menu-item-drag-handle:hover {
  color: #6b7280;
}

.menu-item-drag-handle:active {
  cursor: grabbing;
}

.menu-item-info {
  flex: 1;
  min-width: 0;
}

.menu-item-title {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.6rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.6rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.menu-item-title-hidden {
  color: #9ca3af;
  font-style: italic;
}

.menu-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 1.3rem;
  color: #6b7280;
  align-items: center;
}

.menu-item-type-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 0.4rem;
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.menu-item-type-badge.page {
  background: #dbeafe;
  color: #1e40af;
}

.menu-item-type-badge.custom_url {
  background: #e0e7ff;
  color: #3730a3;
}

.menu-item-type-badge.external_link {
  background: #fce7f3;
  color: #831843;
}

.menu-item-type-badge.heading {
  background: #f3f4f6;
  color: #374151;
}

.menu-item-url {
  color: #6b7280;
  font-family: monospace;
  font-size: 1.2rem;
}

.menu-item-children-count {
  color: #9ca3af;
  font-size: 1.2rem;
}

.menu-item-actions {
  display: flex;
  gap: 0.6rem;
  flex-shrink: 0;
}

.menu-item-children {
  padding: 0.8rem 1.6rem 1.2rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* Empty State */
.menu-items-empty-state {
  text-align: center;
  padding: 6rem 2rem;
  color: #9ca3af;
}

.menu-items-empty-state img {
  margin-bottom: 2rem;
  filter: invert(88%) sepia(6%) saturate(269%) hue-rotate(182deg) brightness(93%) contrast(88%);
}

.menu-items-empty-state h3 {
  font-size: 2rem;
  font-weight: 600;
  margin: 0 0 0.8rem 0;
  color: #6b7280;
}

.menu-items-empty-state p {
  font-size: 1.5rem;
  color: #9ca3af;
  margin: 0;
}

/* Menu Location Section (on index page) */
.menu-location-section {
  margin-bottom: 4rem;
}

.menu-location-section:last-child {
  margin-bottom: 0;
}

.menu-location-section h2 {
  font-size: 2rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 1.6rem 0;
  padding-bottom: 1.2rem;
  border-bottom: 0.2rem solid #e5e7eb;
}

/* Button Icon Styles */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  height: 3.2rem;
  background: white;
  border: 0.1rem solid #d1d5db;
  border-radius: 0.6rem;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-icon:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #374151;
}

.btn-icon.btn-danger {
  color: #dc2626;
}

.btn-icon.btn-danger:hover {
  background: #fee2e2;
  border-color: #dc2626;
}

.btn-icon-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.8rem;
  height: 2.8rem;
  background: white;
  border: 0.1rem solid #d1d5db;
  border-radius: 0.4rem;
  color: #6b7280;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
}

.btn-icon-small:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #374151;
}

.btn-icon-small.btn-danger {
  color: #dc2626;
}

.btn-icon-small.btn-danger:hover {
  background: #fee2e2;
  border-color: #dc2626;
}

/* Responsive */
@media (max-width: 768px) {
  .menu-form-container {
    padding: 2rem;
  }

  .menu-items-section {
    padding: 2rem;
  }

  .menu-items-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1.6rem;
  }

  .btn-add-menu-item {
    width: 100%;
    justify-content: center;
  }

  .menu-item-header {
    flex-wrap: wrap;
  }

  .menu-item-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .menu-item[data-level="child"] {
    margin-left: 2rem;
  }
}
