/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f5f5f5;
  height: 100vh;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* App container */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

.app-banner {
  background-color: #3498db;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 340px 18px 150px;
  text-align: center;
}

.app-banner__stage-info {
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-banner__stage-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
}

.app-banner__stage-details {
  font-size: 14px;
  letter-spacing: 0.4px;
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.instruction-warning {
  color: #ffffff;
  font-weight: 600;
}

#clearButton {
  padding: 12px;
}

/* Main content */
.main-content {
  display: flex;
  margin-top: 0;
  flex: 1;
  background-color: #ffffff;
}

/* Right panel */
.right-panel {
  width: 300px;
  background-color: white;
  padding: 20px;
  overflow-y: auto;
  order: 2;
}

.app-footer {
  background-color: #1f2933;
  color: #ffffff;
  text-align: center;
  padding: 10px 16px;
  font-size: 13px;
  letter-spacing: 0.4px;
}

/* Breadcrumb navigation */
.breadcrumb-navigation {
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.breadcrumb-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  column-gap: 16px;
  row-gap: 6px;
  padding: 8px 38px 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  background-color: white;
  border: 1px solid #e5e7eb;
  background-color: #f8f9fa;
  color: #6c757d;
  width: 100%;
  border: none;
  text-align: left;
  min-height: 56px;
}

.breadcrumb-item:hover {
  background-color: #e9ecef;
}

.breadcrumb-item.active {
  background-color: #3498db;
  color: white;
}

.breadcrumb-item.active .step-subtitle span {
  color: white;
}

.breadcrumb-item.active .step-subtitle {
  display: flex;
}

.breadcrumb-item.disabled {
  background-color: #f1f3f4 !important;
  color: #9aa0a6 !important;
  cursor: not-allowed !important;
  opacity: 0.55 !important;
}

.breadcrumb-item.disabled:hover {
  background-color: #f1f3f4 !important;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  font-size: 14px;
  font-weight: 700;
  grid-row: 1;
  grid-column: 1;
  justify-self: center;
  align-self: center;
}

.breadcrumb-item.active .step-number {
  background-color: rgba(255, 255, 255, 0.3);
}

.step-content {
  display: contents;
}

.step-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: inherit;
  white-space: nowrap;
  grid-column: 2;
  grid-row: 1;
  align-self: center;
}

.step-subtitle {
  font-size: 13px;
  line-height: 1.35;
  color: #495057;
  text-transform: none;
  display: none;
  flex-direction: column;
  gap: 6px;
  grid-column: 1 / span 2;
  margin-left: 20px;
}

.step-subtitle span {
  color: #495057;
  position: relative;
  padding-left: 16px;
}

.step-subtitle span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid currentColor;
}

/* Controls */
.controls {
  border-top: 1px solid #eee;
  padding-top: 24px;
}

.btn {
  padding: 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s ease;
  width: 100%;
  margin-bottom: 10px;
  text-transform: uppercase;
}

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

.btn-secondary:hover {
  background-color: #5a6268;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
  font-weight: 600;
}

.btn-danger:hover {
  background-color: #c82333;
}

/* Modal styles */
.modal {
  display: none;
  position: absolute;
  z-index: 1000;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  text-align: center;
  animation: slideIn 0.3s ease;
}

.edge-style-modal__content {
  width: 420px;
  max-width: 420px;
  max-height: 360px;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.edge-style-modal .modal-header {
  padding: 18px 32px 8px 32px;
}

.edge-style-modal .modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.edge-style-modal .modal-body {
  padding: 12px 32px 8px 32px;
}

.edge-style-modal .config-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.edge-style-modal .radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}

.edge-style-modal .config-item label {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 16px;
  color: #333;
  font-weight: 500;
}

.corner-option-input {
  width: 80px;
  padding: 6px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  font-size: 16px;
  text-align: center;
  font-family: inherit;
}

.measurement-unit {
  font-size: 16px;
  color: #2c3e50;
  font-weight: 600;
}

.edge-style-modal .modal-footer {
  padding: 12px 32px 24px 32px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.edge-style-modal .btn-cancel,
.edge-style-modal .btn-save {
  min-width: 120px;
  padding: 10px 0;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.edge-style-modal .btn-cancel {
  background: #6c757d;
  color: #fff;
}

.edge-style-modal .btn-cancel:hover {
  background: #5a6268;
}

.edge-style-modal .btn-save {
  background: #28a745;
  color: #fff;
}

.edge-style-modal .btn-save:hover {
  background: #218838;
}

.fixture-label {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.fixture-select {
  width: 100%;
  padding: 10px 12px;
  margin-top: 10px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  font-size: 16px;
  font-family: inherit;
}

.fixture-select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.modal-content h3 {
  margin: 0 0 15px 0;
  color: #dc3545;
  font-size: 20px;
  font-weight: 600;
}

.modal-content p {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 16px;
  line-height: 1.4;
}

.modal-warning {
  color: #6c757d !important;
  font-size: 14px !important;
  margin-bottom: 25px !important;
}

.modal-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.modal-buttons .btn {
  width: auto;
  min-width: 100px;
  margin-bottom: 0;
}

/* Radio group styles for modals - matching edge details modal pattern */
.radio-group {
  margin: 20px 0;
  text-align: left;
}

.radio-group .config-item {
  margin: 8px 0;
}

.radio-group .config-item label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: #333;
  cursor: pointer;
  padding: 8px 0;
  transition: opacity 0.2s ease;
  margin: 0;
  border: none;
  border-radius: 0;
  background: none;
}

.radio-group .config-item label:hover {
  background: none;
}

.radio-group .config-item input[type="radio"] {
  margin: 0;
  transform: scale(1.2);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Right panel footer */
.right-panel-footer {
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid #e9ecef;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #495057;
  text-align: center;
}

/* Canvas container */
.canvas-container {
  flex: 1;
  position: relative;
  background-color: white;
  overflow: hidden;
  padding: 10px;
  margin-right: 20px;
  order: 1;
}

.canvas-wrapper {
  width: 100%;
  height: 100%;
}

.canvas-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  z-index: 20;
  transition: opacity 0.2s ease;
}

.canvas-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.submission-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 45, 56, 0.65);
  z-index: 30;
}

.submission-loader.hidden {
  display: none;
}

.submission-loader__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 28px 36px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.submission-loader__spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 5px solid rgba(52, 152, 219, 0.35);
  border-top-color: #3498db;
  animation: canvas-loader-spin 0.8s linear infinite;
}

.submission-loader__text {
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
  letter-spacing: 0.5px;
}

.canvas-loader__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 24px 32px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.canvas-loader__spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid #d0d5dd;
  border-top-color: #3498db;
  animation: canvas-loader-spin 0.8s linear infinite;
}

.canvas-loader__text {
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
  letter-spacing: 0.4px;
}

@keyframes canvas-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

#canvas {
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
}

.choose-range {
  height: 100%;
  overflow-y: auto;
  padding: 10px;
  background-color: white;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.installation-details {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(360px, 480px);
  justify-content: center;
  gap: 32px;
  height: 100%;
  background-color: white;
  padding: 20px 32px;
  overflow-y: auto;
  align-items: start;
}

.installation-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 440px;
  margin: 0 auto;
  width: 100%;
}

.installation-title {
  font-size: 26px;
  font-weight: 700;
  color: #2c3e50;
}

.installation-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.installation-field label {
  font-size: 14px;
  font-weight: 600;
  color: #34495e;
}

.installation-field input,
.installation-field textarea {
  padding: 10px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
}

.installation-submit {
  margin-top: 12px;
  padding: 12px 18px;
  background-color: #3498db;
  border: none;
  color: white;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  align-self: flex-start;
}

.installation-submit:hover {
  background-color: #2d83bd;
}

.installation-submit[disabled] {
  opacity: 0.65;
  cursor: not-allowed;
}

.installation-feedback {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 8px;
}

.installation-feedback.success {
  background-color: rgba(40, 167, 69, 0.1);
  color: #1e7e34;
  border: 1px solid rgba(40, 167, 69, 0.3);
}

.installation-feedback.error {
  background-color: rgba(220, 53, 69, 0.1);
  color: #b21f2d;
  border: 1px solid rgba(220, 53, 69, 0.3);
}

.installation-preview {
  width: 100%;
  background-color: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e1e7ef;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.installation-preview-title {
  font-size: 20px;
  font-weight: 700;
  color: #2c3e50;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.installation-preview h3 {
  font-size: 16px;
  font-weight: 600;
  color: #34495e;
}

.installation-preview-images {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.installation-preview-image-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.installation-preview-label {
  font-size: 14px;
  font-weight: 700;
  color: #2c3e50;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.installation-preview-image {
  width: 100%;
  border: 1px solid #d9dee6;
  border-radius: 8px;
  background-color: white;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(31, 45, 61, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  aspect-ratio: 4 / 3;
  color: #6c757d;
}

.installation-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.required-indicator {
  color: #d9534f;
  font-weight: 700;
  margin-left: 2px;
}

.installation-field input:required,
.installation-field textarea:required {
  border-color: #d0d5dd;
}

.installation-field input:required:focus,
.installation-field textarea:required:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

@media (max-width: 1024px) {
  .installation-details {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 20px;
  }

  .installation-form {
    max-width: 100%;
  }

  .installation-preview {
    max-width: 520px;
    margin: 0 auto;
  }

  .installation-field-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .installation-details {
    padding: 16px;
  }

  .installation-preview {
    padding: 16px;
  }

  .installation-form {
    gap: 14px;
  }
}

.choose-range-title {
  font-size: 33px;
  color: #2c3e50;
}

.range-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  padding-bottom: 10px;
}

.range-card {
  display: flex;
  flex-direction: column;
  background-color: #f8f9fa;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  cursor: pointer;
}

.range-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.range-card.selected {
  box-shadow: 0 0 0 3px #28a745;
}

.range-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.range-selection-overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: none;
  padding: 16px;
}

.range-card.selected .range-selection-overlay {
  display: flex;
}

.thickness-toggle {
  display: inline-flex;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 4px;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.thickness-option {
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: #2c3e50;
  background-color: transparent;
  transition: all 0.2s ease;
}

.thickness-option.active {
  background-color: #28a745;
  color: #fff;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.4);
}

.thickness-option:not(.active):hover {
  background-color: rgba(40, 167, 69, 0.15);
}

.range-selection-overlay .confirm-button {
  background-color: rgba(40, 167, 69, 0.95);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.range-selection-overlay .confirm-button:hover {
  background-color: #218838;
}

.range-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.range-card-name {
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
}

.range-card-type {
  font-size: 13px;
  font-weight: 500;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kitchen-fixtures-cursor {
  cursor: crosshair !important;
}

.kitchen-fixtures-cursor * {
  cursor: crosshair !important;
}

/* Popup styles */
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  max-width: 400px;
  text-align: center;
}

.popup p {
  margin-bottom: 15px;
  color: #495057;
}

.popup button {
  padding: 8px 20px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.popup button:hover {
  background-color: #2980b9;
}

/* Responsive design */
@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
  }

  .right-panel {
    width: 100%;
    height: auto;
    max-height: 200px;
    order: 1;
  }

  .canvas-container {
    order: 2;
  }

  .breadcrumb-navigation {
    display: flex;
    overflow-x: auto;
    margin-bottom: 15px;
  }

  .breadcrumb-item {
    min-width: 120px;
    margin-right: 8px;
    margin-bottom: 0;
  }
}
