/**
 * BoulderModal CSS
 * Boulder creation modal - source-agnostic version
 *
 * STRUCTURE:
 * - ImgEditorFrame is rendered at TOP LEVEL (its own fullscreen modal)
 * - Form modal is shown when editor is closed
 * - NO slide panels - simpler structure
 */

/* Form Modal container */
.boulder-form-modal {
  z-index: 100500 !important;
}

.boulder-form-modal .modal-dialog {
  margin: 0;
  max-width: 100%;
  height: 100%;
}

.boulder-form-modal .modal-content {
  background: rgba(33, 37, 41, 0.98);
  border: none;
  border-radius: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Header */
.boulder-form-modal .modal-header {
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
}

.boulder-form-modal .modal-title {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
  text-align: center;
}

.boulder-form-modal .btn-header-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.25rem;
  padding: 0.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.boulder-form-modal .btn-header-close:hover {
  color: #fff;
}

/* Body */
.boulder-form-modal .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: rgba(33, 37, 41, 0.98);
}

/* Form Container */
.boulder-form-container {
  max-width: 600px;
  margin: 0 auto;
}

/* Edited Image Preview - clickable to re-edit */
.edited-image-preview {
  position: relative;
  margin-bottom: 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.edited-image-preview:hover {
  transform: scale(1.01);
}

.edited-image-preview .preview-image {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
}

.edited-image-preview .btn-edit-holds {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.edited-image-preview .btn-edit-holds:hover {
  background: rgba(0, 0, 0, 0.85);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Form Styling */
.boulder-form-container .form-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.boulder-form-container .form-control {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.boulder-form-container .form-control:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: #9747ff;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(151, 71, 255, 0.2);
}

.boulder-form-container .form-control::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.boulder-form-container textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* Footer */
.boulder-form-modal .modal-footer {
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

/* Dual buttons container for create mode */
.boulder-modal-actions {
  display: flex;
  gap: 12px;
  flex: 1;
  max-width: 500px;
  flex-wrap: nowrap;
}

.boulder-modal-actions button {
  white-space: nowrap;
}

/* Save Draft button */
.btn-save-draft {
  flex: 1;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-save-draft:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Publish button (also used for Update in edit mode) */
.btn-publish {
  flex: 1;
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #b9ff66 0%, #a3e635 100%);
  color: #1a1a1a;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-publish:hover:not(:disabled) {
  background: linear-gradient(135deg, #a8e85c 0%, #84cc16 100%);
}

.btn-save-draft:disabled,
.btn-publish:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Secondary button styling */
.boulder-form-modal .modal-footer .btn-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #f8f9fa;
}

.boulder-form-modal .modal-footer .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Video Validation */
.boulder-form-container .video-validation-container {
  margin-top: 0.5rem;
}

/* Grade Dropdown Override */
.boulder-form-container .boulder-add-grade-dp {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}

.boulder-form-container .dropdown-menu {
  background: rgba(33, 37, 41, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.boulder-form-container .dropdown-item {
  color: #fff;
}

.boulder-form-container .dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Mobile Adjustments */
@media (max-width: 767px) {
  .boulder-form-container {
    padding: 0;
  }

  .edited-image-preview .preview-image {
    max-height: 200px;
  }

  /* Keep buttons on same line on mobile */
  .boulder-form-modal .modal-footer {
    flex-direction: row;
    gap: 0.75rem;
  }

  .boulder-form-modal .modal-footer .btn {
    flex: 1;
    min-width: 0;
  }
}

/* Legacy class for backward compatibility with SprayWall */
.spray-wall-boulder-modal,
.spray-wall-boulder-form-modal {
  z-index: 100500 !important;
}

.spray-wall-boulder-form-modal .modal-dialog {
  margin: 0;
  max-width: 100%;
  height: 100%;
}

.spray-wall-boulder-form-modal .modal-content {
  background: rgba(33, 37, 41, 0.98);
  border: none;
  border-radius: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.spray-wall-boulder-form-modal .modal-header {
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
}

.spray-wall-boulder-form-modal .modal-title {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
  text-align: center;
}

.spray-wall-boulder-form-modal .btn-header-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.25rem;
  padding: 0.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spray-wall-boulder-form-modal .btn-header-close:hover {
  color: #fff;
}

.spray-wall-boulder-form-modal .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: rgba(33, 37, 41, 0.98);
}

.spray-wall-boulder-form-modal .modal-footer {
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.spray-wall-boulder-form-modal .modal-footer .btn-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #f8f9fa;
}

.spray-wall-boulder-form-modal .modal-footer .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 767px) {
  .spray-wall-boulder-form-modal .modal-footer {
    flex-direction: row;
    gap: 0.75rem;
  }

  .spray-wall-boulder-form-modal .modal-footer .btn {
    flex: 1;
    min-width: 0;
  }
}
