/* Reset & Base Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #FF6B35;
  --primary-dark: #E85A2A;
  --secondary: #004E89;
  --secondary-dark: #003D6B;
  --accent: #FFD23F;
  --success: #10B981;
  --text-dark: #1F2937;
  --text-medium: #6B7280;
  --text-light: #9CA3AF;
  --bg-primary: #FFFFFF;
  --bg-secondary: #F9FAFB;
  --bg-tertiary: #F3F4F6;
  --border-light: #E5E7EB;
  --border-medium: #D1D5DB;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-attachment: fixed;
  color: var(--text-dark);
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

/* Header Section */
.header-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 3rem 2rem;
  margin: -2rem -2rem 2rem -2rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  color: white;
  box-shadow: var(--shadow-lg);
}

.header-content h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-icon {
  width: 48px;
  height: 48px;
  stroke-width: 2.5;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.subtitle {
  font-size: 1.1rem;
  opacity: 0.95;
  font-weight: 300;
  margin-left: 64px;
}

.admin-link {
  position: absolute;
  top: 2rem;
  right: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  font-weight: 600;
  transition: var(--transition);
}

.admin-link:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.admin-link svg {
  width: 20px;
  height: 20px;
}

.header-section {
  position: relative;
}

/* Main Grid Layout */
.configurator-grid {
  display: grid;
  grid-template-columns: 1fr 450px;
  gap: 2rem;
  margin-top: 5 px;
}

/* Section Cards */
.section-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.section-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.section-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--bg-tertiary);
}

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Form Elements */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
  font-size: 0.9rem;
}

.select-wrapper {
  position: relative;
  display: block;
}

.styled-select {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 12px !important;
  font-weight: 600 !important;
  background: var(--bg-primary);
  color: var(--text-dark);
  cursor: pointer;
  transition: var(--transition);
  appearance: none;
}

.styled-select:hover {
  border-color: var(--border-medium);
}

.styled-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.select-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--text-medium);
  pointer-events: none;
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.styled-input {
  flex: 1;
  padding: 0.75rem 3rem 0.75rem 1rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 12px !important;
  font-weight: 600 !important;
}

.styled-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.unit-label {
  position: absolute;
  right: 1rem;
  font-weight: 600;
  color: var(--text-medium);
  font-size: 0.9rem;
}

.range-slider {
  margin-top: 0.75rem;
}

.range-slider input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  outline: none;
  -webkit-appearance: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: var(--transition);
}

.range-slider input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  background: var(--primary-dark);
}

/* Radio Groups */
.radio-group-modern {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.75rem;
}

.radio-group-modern label {
  position: relative;
  display: block;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  background: var(--bg-primary);
}

.radio-group-modern label:hover {
  border-color: var(--primary);
  background: rgba(255, 107, 53, 0.05);
}

.radio-group-modern input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.radio-group-modern input[type="radio"]:checked + label,
.radio-group-modern label:has(input[type="radio"]:checked) {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

/* Angle Selector */
.angle-selector {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.angle-selector label {
  position: relative;
  flex: 1;
  min-width: 80px;
  padding: 0.75rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.angle-selector label::before {
  content: '';
  display: block;
  width: 30px;
  height: 30px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.7;
  transition: var(--transition);
}

.angle-selector label:hover {
  border-color: var(--primary);
  background: rgba(255, 107, 53, 0.05);
}

.angle-selector input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.angle-selector input[type="radio"]:checked + label,
.angle-selector label:has(input[type="radio"]:checked) {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  color: white;
  border-color: var(--secondary);
  box-shadow: var(--shadow-md);
}

.angle-selector input[type="radio"]:checked + label::before,
.angle-selector label:has(input[type="radio"]:checked)::before {
  opacity: 1;
  filter: brightness(0) invert(1);
}

/* Ends Grid */
.ends-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.end-config {
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 2px solid var(--border-light);
}

.end-config h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--primary);
  color: white;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Checkbox */
.checkbox-modern {
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.checkbox-modern:hover {
  background: var(--bg-tertiary);
}

.checkbox-modern input[type="checkbox"] {
  position: absolute;
  opacity: 0;
}

.checkmark {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
  flex-shrink: 0;
}

.checkbox-modern input[type="checkbox"]:checked ~ .checkmark {
  background: var(--success);
  border-color: var(--success);
}

.checkbox-modern input[type="checkbox"]:checked ~ .checkmark::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-label {
  font-weight: 600;
  color: var(--text-dark);
}

/* Preview Panel */
.preview-panel {
  position: relative;
}

.sticky-preview {
  position: sticky;
  top: 2rem;
}

.preview-card, .price-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.5rem;
}

.preview-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
}

.hose-preview {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-bottom: 1.5rem;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#hoseSVG {
  width: 100%;
  height: auto;
  max-height: 200px;
}

.preview-specs {
  display: grid;
  gap: 0.75rem;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.spec-label {
  font-weight: 600;
  color: var(--text-medium);
  font-size: 0.9rem;
}

.spec-value {
  font-weight: 700;
  color: var(--text-dark);
}

/* Price Card */
.price-breakdown {
  border-bottom: 2px solid var(--bg-tertiary);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  color: var(--text-dark);
}

.price-row span:first-child {
  color: var(--text-medium);
}

.price-row span:last-child {
  font-weight: 600;
  font-family: 'Courier New', monospace;
}

.price-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.total-amount {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: 'Courier New', monospace;
  font-weight: 800;
}

.btn-primary {
  width: 100%;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.btn-primary svg {
  width: 24px;
  height: 24px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

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

/* Loading State */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 1200px) {
  .configurator-grid {
    grid-template-columns: 1fr;
  }

  .sticky-preview {
    position: static;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .header-section {
    padding: 2rem 1rem;
    margin: -1rem -1rem 1rem -1rem;
  }

  .header-content h1 {
    font-size: 1.75rem;
  }

  .subtitle {
    font-size: 0.95rem;
    margin-left: 0;
  }

  .ends-grid {
    grid-template-columns: 1fr;
  }

  .radio-group-modern {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   EUR/TRY FIYAT GOSTERIMI
   ============================================ */

.exchange-rate-card {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  color: white;
  box-shadow: var(--shadow-md);
}

.rate-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rate-label {
  font-weight: 500;
  opacity: 0.9;
}

.rate-value {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: 'Courier New', monospace;
}

.rate-date {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-top: 0.25rem;
  text-align: right;
}

/* Fiyat satırı - EUR/TRY yanyana */
.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  color: var(--text-dark);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.price-row > span:first-child {
  color: var(--text-medium);
  flex: 1;
  min-width: 120px;
}

.price-values {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.price-values .eur {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: var(--secondary);
  min-width: 90px;
  text-align: right;
}

.price-values .try {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: var(--text-dark);
  min-width: 100px;
  text-align: right;
}

/* Toplam satırı */
.price-total {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem 0 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.total-values {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.total-eur {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary);
  font-family: 'Courier New', monospace;
}

.total-try {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: 'Courier New', monospace;
}

/* Mevcut konfigurasyon bildirimi */
.existing-config-notice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  border: 2px solid var(--success);
  color: #065f46;
}

.existing-config-notice .notice-icon {
  font-size: 1.5rem;
}

.existing-config-notice strong {
  font-family: 'Courier New', monospace;
  background: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* Button disabled state */
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Responsive fiyat gösterimi */
@media (max-width: 480px) {
  .price-values {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
  }

  .price-values .eur,
  .price-values .try {
    min-width: auto;
  }

  .total-values {
    width: 100%;
    align-items: flex-end;
  }
}
