/**
 * SectorForm - Shared styles for sector/wall form fields
 *
 * These styles are designed to work within both SectorModal and WallModal.
 * The parent modal provides the dark theme context via its CSS class.
 *
 * Dark theme colors:
 * - Background: rgb(33, 37, 41)
 * - Input bg: rgb(45, 50, 55)
 * - Input focus: rgb(50, 55, 60)
 * - Primary: #b9ff66 (lime green)
 * - Text: rgba(255, 255, 255, 0.9)
 * - Muted text: rgba(255, 255, 255, 0.5)
 * - Border: rgba(255, 255, 255, 0.15)
 */

/* ============================================
   Base Form Styles
   ============================================ */
.sector-form {
  /* Container - inherits modal dark theme */
}

.sector-form--inline {
  /* Styles for desktop sidebar inline mode */
  padding: 0;
}

/* ============================================
   Media Selector Trigger (Image Picker)
   ============================================ */
.sector-form .media-selector-trigger {
  background: rgb(45, 50, 55);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
}

.sector-form .media-selector-trigger:hover {
  border-color: rgba(185, 255, 102, 0.5);
  background: rgba(185, 255, 102, 0.05);
}

.sector-form .media-selector-trigger:focus {
  outline: none;
  border-color: #b9ff66;
  box-shadow: 0 0 0 0.2rem rgba(185, 255, 102, 0.15);
}

/* Placeholder state */
.sector-form .media-selector-trigger .placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.5);
  padding: 24px;
}

.sector-form .media-selector-trigger .placeholder svg {
  font-size: 32px;
}

.sector-form .media-selector-trigger:hover .placeholder {
  color: rgba(185, 255, 102, 0.8);
}

/* Image preview state */
.sector-form .media-selector-trigger img {
  max-width: 100%;
  max-height: 200px;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
}

.sector-form .media-selector-trigger .position-relative {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 12px;
}

.sector-form .media-selector-trigger .position-absolute {
  position: absolute;
}

/* Remove button on image */
.sector-form .media-selector-trigger .btn-danger {
  background: rgba(220, 53, 69, 0.9);
  border: none;
  padding: 4px 8px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.sector-form .media-selector-trigger:hover .btn-danger {
  opacity: 1;
}

/* ============================================
   Map Shape Section
   ============================================ */

/* Sector variant */
.sector-modal__map-shape-section,
.wall-modal__map-shape-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sector-modal__map-shape-label,
.wall-modal__map-shape-label {
  display: flex;
  align-items: center;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
}

.sector-modal__map-shape-card,
.wall-modal__map-shape-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.sector-modal__map-shape-info,
.wall-modal__map-shape-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sector-modal__map-shape-name,
.wall-modal__map-shape-name {
  font-weight: 500;
  color: white;
}

.sector-modal__map-shape-type,
.wall-modal__map-shape-type {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: capitalize;
}

.sector-modal__map-shape-actions,
.wall-modal__map-shape-actions {
  display: flex;
  gap: 8px;
}

.sector-modal__map-shape-actions .btn,
.wall-modal__map-shape-actions .btn {
  padding: 6px 10px;
}

.sector-modal__map-shape-actions .btn-outline-light,
.wall-modal__map-shape-actions .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.8);
}

.sector-modal__map-shape-actions .btn-outline-light:hover,
.wall-modal__map-shape-actions .btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
}

.sector-modal__map-shape-actions .btn-outline-danger,
.wall-modal__map-shape-actions .btn-outline-danger {
  border-color: rgba(220, 53, 69, 0.5);
  color: #dc3545;
  background: transparent;
}

.sector-modal__map-shape-actions .btn-outline-danger:hover,
.wall-modal__map-shape-actions .btn-outline-danger:hover {
  background: rgba(220, 53, 69, 0.1);
  border-color: #dc3545;
}

/* Map Shape Empty State */
.sector-modal__map-shape-empty,
.wall-modal__map-shape-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  text-align: center;
}

.sector-modal__map-shape-empty-icon,
.wall-modal__map-shape-empty-icon {
  font-size: 2.5rem;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 12px;
  transition: color 0.2s ease, transform 0.2s ease;
}

.sector-modal__map-shape-empty-text,
.wall-modal__map-shape-empty-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 4px;
  transition: color 0.2s ease;
}

.sector-modal__map-shape-empty-hint,
.wall-modal__map-shape-empty-hint {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Clickable empty map shape card */
.sector-modal__map-shape-empty--clickable,
.wall-modal__map-shape-empty--clickable {
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  padding: 24px;
}

.sector-modal__map-shape-empty--clickable:hover,
.wall-modal__map-shape-empty--clickable:hover {
  border-color: #B9FF66;
  background: rgba(185, 255, 102, 0.1);
}

.sector-modal__map-shape-empty--clickable:hover .sector-modal__map-shape-empty-icon,
.wall-modal__map-shape-empty--clickable:hover .wall-modal__map-shape-empty-icon {
  color: #B9FF66;
  transform: scale(1.1);
}

.sector-modal__map-shape-empty--clickable:hover .sector-modal__map-shape-empty-text,
.wall-modal__map-shape-empty--clickable:hover .wall-modal__map-shape-empty-text {
  color: #B9FF66;
}

.sector-modal__map-shape-empty--clickable:hover .sector-modal__map-shape-empty-hint,
.wall-modal__map-shape-empty--clickable:hover .wall-modal__map-shape-empty-hint {
  color: rgba(185, 255, 102, 0.7);
}

/* ============================================
   Inline Mode (Desktop Sidebar)
   ============================================ */
.sector-form--inline .media-selector-trigger {
  min-height: 100px;
}

.sector-form--inline .media-selector-trigger img {
  max-height: 150px;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 576px) {
  .sector-form .media-selector-trigger img {
    max-height: 150px;
  }

  .sector-modal__map-shape-card,
  .wall-modal__map-shape-card {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .sector-modal__map-shape-actions,
  .wall-modal__map-shape-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
