/**
 * Glass Railing Calculator Styles
 * Clean, modern design without overlaps or duplicates
 */

/* ============================================
   CALCULATOR CONTAINER
   ============================================ */
.price-calculator-container {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Allow text selection only in inputs */
.price-calculator-container input,
.price-calculator-container select,
.price-calculator-container textarea {
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
}

/* ============================================
   CALCULATOR HEADER
   ============================================ */
.calc-header-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #F3F4F6;
}

.calc-header-wrapper svg {
  color: #D4AF37;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.calc-header-wrapper h2 {
  margin: 0;
  color: #0F172A;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
}

/* ============================================
   FORM GROUPS
   ============================================ */
.calc-group {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #FAFBFC;
  border-radius: 8px;
  border: 1px solid #F3F4F6;
}

.calc-group:last-child {
  margin-bottom: 0;
}

.calc-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #1F2937;
  margin-bottom: 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calc-group label svg {
  width: 18px;
  height: 18px;
  color: #3B82F6;
  flex-shrink: 0;
}

/* ============================================
   INPUT GRID
   ============================================ */
.calc-size-input-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: end;
}

.calc-unit-selector {
  min-width: 160px;
}

/* ============================================
   INPUTS & SELECTS
   ============================================ */
.calc-input,
.calc-select {
  width: 100%;
  padding: 0.875rem 1rem;
  background: #FFFFFF;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  color: #111827;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.calc-input:focus,
.calc-select:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.calc-input:hover,
.calc-select:hover {
  border-color: #3B82F6;
}

.calc-input::placeholder {
  color: #9CA3AF;
}

.calc-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233B82F6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

/* ============================================
   HELPER TEXT
   ============================================ */
.calc-helper-text {
  color: #64748B;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  line-height: 1.5;
}

.calc-info-text {
  color: #94A3B8;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

/* ============================================
   AREA & LENGTH DISPLAY
   ============================================ */
#calc-area-display {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  color: #FFFFFF;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
}

#calc-length-display {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: #EFF6FF;
  color: #3B82F6;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  border: 1px solid #DBEAFE;
}

/* ============================================
   LENGTH ROWS
   ============================================ */
#calc-lengths-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.calc-length-row {
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 0.75rem;
  align-items: end;
  padding: 1rem;
  background: #FFFFFF;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.calc-length-row:hover {
  border-color: #3B82F6;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.calc-length-label {
  display: block;
  font-size: 0.75rem;
  color: #64748B;
  margin-bottom: 0.375rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calc-length-input {
  width: 100%;
}

.calc-remove-length-btn {
  padding: 0.625rem;
  background: #FEF2F2;
  border: 1.5px solid #FEE2E2;
  border-radius: 8px;
  color: #EF4444;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
}

.calc-remove-length-btn:hover {
  background: #FEE2E2;
  border-color: #FECACA;
  transform: scale(1.05);
}

.calc-remove-length-btn:active {
  transform: scale(0.95);
}

/* ============================================
   ADD LENGTH BUTTON
   ============================================ */
#calc-add-length-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.875rem 1rem;
  background: #EFF6FF;
  border: 2px dashed #3B82F6;
  border-radius: 8px;
  color: #3B82F6;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

#calc-add-length-btn:hover {
  background: #DBEAFE;
  border-color: #2563EB;
  color: #2563EB;
  transform: translateY(-1px);
}

#calc-add-length-btn:active {
  transform: translateY(0);
}

/* ============================================
   SELECT WITH MARGIN (for finish selects)
   ============================================ */
.calc-select-margin {
  margin-top: 0.75rem;
}

/* ============================================
   INFO BOX
   ============================================ */
.calc-info-box {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: #F0F9FF;
  border: 1px solid #BAE6FD;
  border-left: 4px solid #3B82F6;
  border-radius: 8px;
}

.calc-info-box strong {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #1E40AF;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.calc-info-box strong svg {
  width: 18px;
  height: 18px;
}

.calc-info-box p {
  margin: 0.5rem 0;
  color: #475569;
  font-size: 0.85rem;
  line-height: 1.6;
}

.calc-info-box p:last-child {
  margin-bottom: 0;
}

/* ============================================
   PRICE DISPLAY
   ============================================ */
.calc-price-display {
  margin-top: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
  border: 1px solid #E2E8F0;
  border-radius: 12px;
}

.calc-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 0;
  border-bottom: 1px solid #E2E8F0;
}

.calc-price-row:last-child {
  border-bottom: none;
  padding-top: 1rem;
  margin-top: 0.5rem;
  border-top: 2px solid #CBD5E1;
}

.calc-price-label {
  color: #475569;
  font-size: 0.95rem;
  font-weight: 500;
}

.calc-price-value {
  color: #1E40AF;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
}

.calc-price-row:last-child .calc-price-value {
  font-size: 1.75rem;
  color: #1E3A8A;
}

/* ============================================
   USER FORM
   ============================================ */
.calc-user-form {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  display: grid;
  gap: 1rem;
}

.calc-user-form input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: #FFFFFF;
  border: 1.5px solid #E5E7EB;
  border-radius: 8px;
  color: #111827;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.calc-user-form input:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.calc-user-form input::placeholder {
  color: #9CA3AF;
}

.calc-submit-btn {
  width: 100%;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  border: none;
  border-radius: 8px;
  color: #FFFFFF;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.calc-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.calc-submit-btn:active {
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .price-calculator-container {
    padding: 1.5rem;
  }
  
  .calc-group {
    padding: 0.875rem;
  }
  
  .calc-size-input-grid {
    grid-template-columns: 1fr;
  }
  
  .calc-unit-selector {
    width: 100%;
    min-width: auto;
  }
  
  .calc-length-row {
    grid-template-columns: 1fr 44px;
    padding: 0.875rem;
  }
  
  .calc-price-display {
    padding: 1.25rem;
  }
  
  .calc-price-value {
    font-size: 1.1rem;
  }
  
  .calc-price-row:last-child .calc-price-value {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .price-calculator-container {
    padding: 1rem;
  }
  
  .calc-header-wrapper h2 {
    font-size: 1.25rem;
  }
  
  .calc-input,
  .calc-select {
    font-size: 16px; /* Prevent zoom on iOS */
  }
}

