/**
 * Door Configurator Enhanced Styling
 * Professional styling for the door configurator UI with improved visual appearance
 */

:root {
  /* Color palette */
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e67e22;
  --light-color: #ecf0f1;
  --dark-color: #2c3e50;
  --success-color: #2ecc71;
  --danger-color: #e74c3c;
  --warning-color: #f39c12;
  --info-color: #3498db;
  
  /* Door color variables for swatches */
  --natural-color: #c19a6b;
  --stejar-color: #b68c3c;
  --nuc-color: #7a4f30;
  --mahon-color: #632a16;
  --alb-color: #ffffff;
  --gri-color: #808080;
  --negru-color: #000000;
  --albastru-color: #1e73be;
  --roșu-color: #c41e3a;
  --verde-color: #228b22;
}

body {
  font-family: 'Roboto', 'Segoe UI', sans-serif;
  color: var(--dark-color);
}

/* Main container */
.configurator-container {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 40px;
}

/* Header styling */
.configurator-header {
  padding: 20px 0;
  border-bottom: 1px solid #eee;
}

.configurator-header h1 {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.2rem;
}

.configurator-header p {
  color: #666;
}

/* Card styling */
.model-card {
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  height: 100%;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-radius: 8px;
  background-color: #fff;
}

.model-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.model-card.selected {
  border-color: var(--secondary-color);
  background-color: rgba(52, 152, 219, 0.05);
}

.model-card img {
  height: 180px;
  object-fit: cover;
  width: 100%;
  border-bottom: 1px solid #eee;
}

.model-card .card-body {
  padding: 15px;
}

.model-card .card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.model-card .card-text {
  color: #666;
  line-height: 1.4;
}

/* Preview container */
.preview-container {
  min-height: 450px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #f8f9fa;
  overflow: hidden;
  position: relative;
  margin-bottom: 20px;
}

.preview-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255,255,255,0.8);
  flex-direction: column;
  z-index: 5;
}

/* Door visualization */
.door-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 15px;
}

.preview-image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

.door-svg {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 5px 15px rgba(0,0,0,0.2));
}

/* Specifications */
.specifications {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
}

.specifications h5 {
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--primary-color);
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

.specs-list {
  list-style-type: none;
  padding-left: 0;
  margin-bottom: 0;
}

.specs-list li {
  padding: 8px 0;
  border-bottom: 1px dashed #eee;
  display: flex;
  justify-content: space-between;
}

.specs-list li:last-child {
  border-bottom: none;
}

.specs-list strong {
  margin-right: 5px;
  color: var(--dark-color);
}

/* Color swatches */
.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.color-option {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 60px;
}

.color-option input[type="radio"] {
  display: none;
}

.color-swatch {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: block;
  margin: 0 auto 5px;
  border: 2px solid #ddd;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch.selected {
  border-color: var(--secondary-color);
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.25);
}

.color-option input[type="radio"]:checked + .color-swatch {
  border-color: var(--secondary-color);
  transform: scale(1.1);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.25);
}

.color-option input[type="radio"]:checked + .color-swatch::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
  font-size: 18px;
  font-weight: bold;
}

.color-name {
  font-size: 12px;
  display: block;
  color: #666;
  margin-top: 5px;
}

/* Tab styling */
.nav-tabs {
  border-bottom: 1px solid #dee2e6;
}

.nav-tabs .nav-item {
  margin-bottom: -1px;
}

.nav-tabs .nav-link {
  border: 1px solid transparent;
  border-top-left-radius: .25rem;
  border-top-right-radius: .25rem;
  color: #6c757d;
  font-weight: 500;
  padding: 0.75rem 1rem;
  position: relative;
}

.nav-tabs .nav-link::before {
  content: attr(data-step);
  display: inline-block;
  width: 24px;
  height: 24px;
  background-color: #e9ecef;
  border-radius: 50%;
  text-align: center;
  line-height: 24px;
  margin-right: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
  border-color: #e9ecef #e9ecef #dee2e6;
  color: var(--dark-color);
}

.nav-tabs .nav-link:hover::before {
  background-color: #dee2e6;
}

.nav-tabs .nav-link.active {
  color: var(--secondary-color);
  background-color: #fff;
  border-color: #dee2e6 #dee2e6 #fff;
  font-weight: 600;
}

.nav-tabs .nav-link.active::before {
  background-color: var(--secondary-color);
  color: white;
}

.tab-content {
  padding: 20px 0;
}

.tab-pane {
  animation: fadeIn 0.5s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Price display */
.price-box {
  background-color: #f8f9fa;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
}

.price-display {
  font-size: 32px;
  font-weight: 700;
  color: var(--success-color);
  display: block;
  text-align: right;
}

.price-label {
  font-weight: 600;
  font-size: 18px;
  color: var(--dark-color);
}

/* Dimension buttons */
.dimension-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.dimension-buttons .btn {
  flex: 1 1 calc(50% - 8px);
  min-width: 100px;
  margin-bottom: 8px;
  text-align: center;
  font-weight: 500;
}

/* Form styling */
.form-group {
  margin-bottom: 1.5rem;
}

.form-control {
  border-radius: 4px;
  border-color: #ced4da;
  padding: 0.5rem 0.75rem;
  height: auto;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-check {
  padding-left: 30px;
  margin-bottom: 12px;
}

.form-check-input {
  margin-left: -30px;
  width: 20px;
  height: 20px;
}

.form-check-label {
  line-height: 20px;
  vertical-align: middle;
  cursor: pointer;
  padding-left: 8px;
}

/* Button styling */
.btn {
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 0.5rem 1.25rem;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.btn-primary {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-primary:hover, .btn-primary:focus {
  background-color: #2980b9;
  border-color: #2980b9;
  box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.btn-outline-primary {
  color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-outline-primary:hover {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  color: white;
}

.btn-secondary {
  background-color: #95a5a6;
  border-color: #95a5a6;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
  border-color: #7f8c8d;
}

.btn-success {
  background-color: var(--success-color);
  border-color: var(--success-color);
}

.btn-success:hover {
  background-color: #27ae60;
  border-color: #27ae60;
}

.next-tab, .prev-tab {
  min-width: 100px;
}

/* Modal styling */
.modal-content {
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  border: none;
}

.modal-header {
  border-bottom: 1px solid #eee;
  padding: 1.25rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid #eee;
  padding: 1.25rem;
}

.modal-title {
  font-weight: 600;
}

/* Saved configuration styling */
.saved-config-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  transition: background-color 0.2s ease;
}

.saved-config-item:hover {
  background-color: #f8f9fa;
}

.config-info {
  flex-grow: 1;
  margin-right: 15px;
}

.config-actions {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
  .preview-container {
    min-height: 350px;
  }
  
  .door-svg {
    max-height: 350px;
  }
}

@media (max-width: 767.98px) {
  .nav-tabs .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 14px;
  }
  
  .nav-tabs .nav-link::before {
    width: 20px;
    height: 20px;
    line-height: 20px;
    font-size: 12px;
  }
  
  .model-card img {
    height: 140px;
  }
  
  .dimension-buttons .btn {
    font-size: 12px;
    padding: 0.375rem 0.5rem;
  }
  
  .price-display {
    font-size: 24px;
  }
  
  .form-group {
    margin-bottom: 1rem;
  }
}

@media (max-width: 575.98px) {
  .model-card {
    max-width: 240px;
    margin: 0 auto;
  }
  
  .color-swatches {
    justify-content: center;
  }
  
  .price-box {
    text-align: center;
  }
  
  .price-display {
    text-align: center;
  }
  
  .door-svg {
    max-height: 300px;
  }
  
  .tab-content {
    padding: 15px 0;
  }
}

/* Door Preview Styling */
.door-preview .preview-details {
  width: 100%;
  text-align: center;
}

.door-preview .preview-details .price-estimate {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 10px 15px;
  margin-top: 20px;
  display: inline-block;
}

.door-preview .preview-details .price-label {
  font-weight: 600;
  margin-right: 10px;
}

.door-preview .preview-details .price-value {
  font-size: 24px;
  font-weight: bold;
  color: var(--success-color);
}

/* 3D View Container */
#3dViewContainer {
  width: 100%;
  height: 400px;
  background-color: #f8f9fa;
  border-radius: 8px;
}
