/* General Styles */
html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Merriweather Sans", sans-serif;
  color: #0f172a;
  background: #f8fafc;
  -webkit-font-smoothing: antialiased;
}

#main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 32px;
  box-sizing: border-box;
}

h1 {
  margin: 0 0 32px;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
}

#user-info {
  max-width: 420px;
  margin: 0 auto 40px;
  padding: 32px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#user-info:hover {
  transform: translateY(-2px);
  box-shadow: 0 25px 55px rgba(15, 23, 42, 0.12);
}

#user-info h2 {
  margin: 0 0 24px;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
}

#user-info form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#user-info label {
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
}

#user-info input {
  padding: 12px 14px;
  border: 1px solid #cbd5f5;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#user-info input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
  background: #ffffff;
}

#user-info button {
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: #0f172a;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#user-info button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.18);
}

.flex {
  display: flex;
  flex: 1;
  min-height: 620px;
  gap: 24px;
}

.configurator {
  display: flex;
  flex: 1;
  gap: 32px;
  padding: 32px;
  border-radius: 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.08);
  box-sizing: border-box;
}

.tabs {
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tab-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: #1e293b;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease,
    transform 0.2s ease;
}

.tab-button:hover {
  transform: translateX(4px);
  border-color: #0ea5e9;
}

.tab-button.active {
  background: #0f172a;
  color: #ffffff;
  border-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.tab-button span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5f5;
  flex-shrink: 0;
}

.tab-button.active span {
  background: #38bdf8;
}

.tabs .mobile {
  display: none;
}

.tab-content {
  display: none;
  flex: 1;
  flex-direction: column;
  gap: 24px;
}

.tab-content.active {
  display: flex;
}

.tab-content h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.tab-content .tabs-outside,
.tab-content .tabs-inside {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}

.tab-button-outside,
.tab-button-inside {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: #f1f5f9;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.tab-button-outside.active,
.tab-button-inside.active {
  background: #0f172a;
  color: #ffffff;
}

.tab-content-outside,
.tab-content-inside {
  display: none;
  width: 100%;
  overflow: hidden;
}

.tab-content-outside.active,
.tab-content-inside.active {
  display: flex;
}

.tab-content-outside > div,
.tab-content-inside > div,
#brand-container,
#door-styles-container,
#frame-styles-container,
#glass-designs-container,
#handles-container {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  padding: 4px;
  overflow-y: auto;
}

.option-card,
button {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

button img {
  width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: contain;
  border-radius: 12px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
  border-color: #0ea5e9;
}

button.selected {
  border-color: transparent;
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.95),
    rgba(15, 23, 42, 0.85)
  );
  color: #ffffff;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.16);
}

.outside-color,
.inside-color {
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 12px;
  gap: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.outside-color:hover,
.inside-color:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
  border-color: #38bdf8;
}

.outside-color div,
.inside-color div {
  width: 90%;
  height: 70px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
}

.outside-color.selected,
.inside-color.selected {
  border-color: transparent;
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.95),
    rgba(30, 41, 59, 0.85)
  );
  color: #ffffff;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
}

.outside-color.selected div,
.inside-color.selected div {
  border-color: rgba(255, 255, 255, 0.15);
}

.door-composition {
  position: sticky;
  top: 32px;
  display: flex;
  flex-direction: column;
  width: 640px;
  border-radius: 24px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.08);
}

.door-header {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 24px 24px 0 0;
}

.toggle-button {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  font-size: 13px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.toggle-button.active {
  background: #0f172a;
  color: #ffffff;
}

.toggle-button:not(.active):hover {
  border-color: #0ea5e9;
  color: #0f172a;
}

.door-canvas {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 32px;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  border-radius: 0 0 24px 24px;
}

.image-container {
  position: relative;
  width: 480px;
  height: 580px;
}

.image-container div {
  border-radius: 18px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.bg-glass,
.glass-top,
.glass-side,
.glass-door,
.door,
.frame,
.door-texture,
.frame-texture,
.handle {
  position: absolute;
  inset: 0;
}

/* Responsive */
@media (max-width: 1200px) {
  #main {
    padding: 24px;
  }

  .flex {
    flex-direction: column;
  }

  .door-composition {
    position: static;
    width: 100%;
  }
}

@media (max-width: 768px) {
  #main {
    padding: 20px;
  }

  .configurator {
    flex-direction: column;
    padding: 24px;
  }

  .tabs {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }

  .tab-button {
    flex: 1 1 calc(50% - 12px);
  }

  .tabs .mobile {
    display: flex;
  }

  .tab-content-outside > div,
  .tab-content-inside > div,
  #brand-container,
  #door-styles-container,
  #frame-styles-container,
  #glass-designs-container,
  #handles-container {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .image-container {
    width: 260px;
    height: 470px;
  }
}

@media (max-width: 540px) {
  .tab-button {
    flex: 1 1 100%;
  }

  .image-container {
    width: 100%;
    height: 400px;
  }
}

/* Get a quote button styling */
.save-button {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  transition: all 0.3s ease;
  background-clip: padding-box;
}

.save-button::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #3b82f6, #1e40af, #3b82f6, #1e40af);
  background-size: 400% 400%;
  border-radius: 14px;
  z-index: -1;
}

.save-button:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.save-button:active {
  transform: translateX(-50%) translateY(0px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

@keyframes movingBorder {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
