/* ==========================================================================
   Weight Calculator Styles
   ========================================================================== */

/* Hero */
.calc-hero {
  position: relative;
  background: linear-gradient(135deg, #1A202C 0%, #2d3748 100%);
  min-height: 280px;
  display: flex;
  align-items: center;
  margin-top: 80px;
  overflow: hidden;
  width: 100%;
}
.calc-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../img/grevinox-webp-imags/pipes-and-tubes/pipes-and-tubes.webp') center/cover no-repeat;
  opacity: 0.15;
}
.calc-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(26,32,44,0.8), rgba(13,16,22,0.9));
}
.calc-hero-content {
  position: relative;
  z-index: 2;
  color: var(--white);
  padding: 4rem 0;
}
.calc-hero-content h1 { font-size: 3rem; margin-bottom: 0.5rem; }
.calc-hero-content h1 span { color: var(--primary); }
.calc-hero-content p { font-size: 1.1rem; color: var(--gray-light); margin-bottom: 1.5rem; }

/* Tabs */
.calc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2rem;
}
.calc-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border: 2px solid var(--gray-light);
  border-radius: 8px;
  background: var(--white);
  color: var(--dark);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.25s ease;
}
.calc-tab:hover { border-color: var(--primary); color: var(--primary); }
.calc-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}
.calc-tab i { font-size: 0.85rem; }

/* Layout */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  align-items: start;
  width: 100%;
  min-width: 0;
}

/* Form Panel */
.calc-form-wrap {
  background: var(--white);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  min-width: 0;
  overflow: hidden;
}
.calc-panel { display: none; }
.calc-panel.active { display: block; }
.calc-panel h3 {
  font-size: 1.4rem;
  color: var(--dark);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.calc-panel h3 i { color: var(--primary); }
.calc-formula {
  font-size: 0.82rem;
  color: var(--gray);
  background: var(--light);
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  border-left: 3px solid var(--primary);
  margin-bottom: 1.5rem;
  font-family: monospace;
}

/* Fields */
.calc-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}
.calc-field { display: flex; flex-direction: column; gap: 0.4rem; }
.calc-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--dark);
  display: flex;
  justify-content: space-between;
}
.calc-field label span {
  font-weight: 400;
  color: var(--gray);
  font-size: 0.78rem;
}
.calc-field input,
.calc-field select {
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--gray-light);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  color: var(--dark);
  background: var(--white);
  transition: border-color 0.2s ease;
  outline: none;
}
.calc-field input:focus,
.calc-field select:focus { border-color: var(--primary); }

/* Calculate Button */
.calc-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 2rem;
  background: var(--grad-primary);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
}
.calc-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(188,35,37,0.3);
}

/* Result Box */
.calc-result-wrap { display: flex; flex-direction: column; gap: 1.5rem; }

.calc-result-box {
  background: var(--white);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-placeholder {
  text-align: center;
  color: var(--gray);
}
.result-placeholder i { font-size: 3rem; color: var(--gray-light); margin-bottom: 1rem; display: block; }
.result-placeholder p { font-size: 0.95rem; }

/* Result Content */
.result-content { width: 100%; }
.result-content h4 {
  font-size: 1rem;
  color: var(--gray);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.result-main {
  background: var(--grad-primary);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
}
.result-main .result-label { font-size: 0.85rem; color: rgba(255,255,255,0.8); margin-bottom: 0.3rem; }
.result-main .result-value {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--white);
  line-height: 1;
}
.result-main .result-unit { font-size: 1rem; color: rgba(255,255,255,0.8); margin-top: 0.3rem; }

.result-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}
.result-item {
  background: var(--light);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  border: 1px solid var(--gray-light);
}
.result-item .ri-label { font-size: 0.75rem; color: var(--gray); margin-bottom: 0.2rem; }
.result-item .ri-value { font-size: 1rem; font-weight: 700; color: var(--dark); }

.result-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
}
.result-actions button {
  flex: 1;
  padding: 0.6rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--gray-light);
  background: var(--white);
  color: var(--dark);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.result-actions button:hover { border-color: var(--primary); color: var(--primary); }

/* Density Table */
.density-table-box {
  background: var(--white);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}
.density-table-box h4 {
  font-size: 0.9rem;
  color: var(--dark);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.density-table-box h4 i { color: var(--primary); }
.density-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.density-table th {
  background: var(--primary);
  color: var(--white);
  padding: 0.5rem 0.8rem;
  text-align: left;
  font-weight: 600;
}
.density-table td { padding: 0.45rem 0.8rem; border-bottom: 1px solid var(--gray-light); color: var(--dark); }
.density-table tr:nth-child(even) { background: var(--light); }
.density-table tr:hover { background: #fff0f0; }

/* Responsive */
@media (max-width: 1024px) {
  .calc-layout { grid-template-columns: 1fr; }
  .calc-result-wrap { flex-direction: row; flex-wrap: wrap; }
  .calc-result-box { flex: 1; min-width: 280px; }
  .density-table-box { flex: 1; min-width: 280px; }
}
@media (max-width: 768px) {
  .calc-hero-content h1 { font-size: 2rem; }
  .calc-tabs { gap: 0.4rem; }
  .calc-tab { padding: 0.5rem 0.9rem; font-size: 0.8rem; }
  .calc-fields { grid-template-columns: 1fr; }
  .calc-form-wrap { padding: 1.5rem; }
  .result-breakdown { grid-template-columns: 1fr 1fr; }
  .calc-result-wrap { flex-direction: column; }
}
@media (max-width: 480px) {
  .calc-hero-content h1 { font-size: 1.6rem; }
  .result-main .result-value { font-size: 2.2rem; }
  .result-breakdown { grid-template-columns: 1fr; }
}
