/* ============================================
   BRICK CALCULATOR - BuildCostMate
   ============================================ */

/* ===== Mode Toggle ===== */
.mode-toggle {
  display: flex;
  gap: 10px;
  background: rgba(0, 0, 0, 0.15);
  padding: 8px;
  border-radius: 10px;
  margin-bottom: 15px;
}

.mode-toggle button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  transition: all 0.3s;
  background: transparent;
  color: #aaa;
}

.mode-toggle button.active {
  background: #00aaff;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 170, 255, 0.3);
}

.mode-toggle button:hover:not(.active) {
  background: rgba(255, 255, 255, 0.1);
}

/* ===== Advanced Inputs ===== */
.advanced-inputs {
  display: none;
}

.advanced-inputs.show {
  display: block;
}

/* ===== Wall Details ===== */
.wall-details-card {
  padding: 15px !important;
}

.wall-details-row {
  display: flex;
  gap: 15px;
  flex-wrap: nowrap;
  margin-top: 8px;
}

.wall-detail-item {
  flex: 1;
  min-width: 0;
}

.wall-detail-item label {
  margin-top: 0;
  font-size: 13px;
  color: #ccc;
}

.wall-detail-item input,
.wall-detail-item select {
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 10px;
  background: white;
  color: #333;
  font-size: 15px;
  transition: border-color 0.3s;
}

.wall-detail-item input:focus,
.wall-detail-item select:focus {
  outline: none;
  border-color: #2a5f8f;
  box-shadow: 0 0 8px rgba(42, 95, 143, 0.25);
}

/* ===== Deduction Row ===== */
.deduction-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.deduction-field {
  flex: 1;
  min-width: 80px;
}

.deduction-field label {
  margin-top: 0;
  font-size: 12px;
  color: #ccc;
}

.deduction-field input,
.deduction-field select {
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 10px;
  background: white;
  color: #333;
  font-size: 14px;
}

.deduction-field input:focus,
.deduction-field select:focus {
  outline: none;
  border-color: #2a5f8f;
  box-shadow: 0 0 8px rgba(42, 95, 143, 0.25);
}

.deduction-add {
  flex: 0.5;
  min-width: 70px;
}

.deduction-add button {
  width: 100%;
  padding: 10px 12px;
  margin-top: 4px;
  background: #ff9800;
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.deduction-add button:hover {
  background: #e68900;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.ded-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin-top: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.ded-item .ded-text {
  font-size: 14px;
  color: #fff;
}

.ded-item .del {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.ded-item .del:hover {
  background: #c82333;
  transform: scale(1.05);
}

/* ===== Advanced Walls ===== */
.adv-wall-group {
  background: rgba(0, 0, 0, 0.08);
  padding: 12px;
  border-radius: 8px;
  margin-top: 8px;
}

.adv-wall-group .wall-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.adv-wall-group .wall-header h4 {
  margin: 0;
  color: #fff;
}

.adv-wall-group .wall-header button {
  width: auto;
  padding: 4px 12px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
}

.adv-wall-group .wall-inputs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.adv-wall-group .wall-input-item {
  flex: 1;
  min-width: 100px;
}

.adv-wall-group .wall-input-item label {
  display: block;
  font-size: 12px;
  color: #aaa;
  margin-bottom: 3px;
}

.adv-wall-group .wall-input-item input,
.adv-wall-group .wall-input-item select {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: white;
  color: #333;
  font-size: 14px;
}

.adv-wall-group .wall-input-item input:focus,
.adv-wall-group .wall-input-item select:focus {
  outline: none;
  border-color: #2a5f8f;
}

.adv-wall-group .wall-similar {
  flex: 0.7;
  min-width: 80px;
}

/* ===== Collapse Header ===== */
.collapse-header {
  background: rgba(0, 0, 0, 0.25);
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
}

.collapse-content {
  display: none;
  margin-top: 10px;
}

/* ===== Results ===== */
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
  margin-top: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.result-grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 15px;
  margin-top: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.result-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
  margin-top: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.result-card {
  background: rgba(0, 0, 0, 0.1);
  padding: 15px 10px;
  border-radius: 8px;
  text-align: center;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.result-card .label {
  font-size: 13px;
  color: #aaa;
  display: block;
}

.result-card .value {
  font-size: 22px;
  font-weight: bold;
  display: block;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.result-card .unit {
  font-size: 11px;
  color: #aaa;
  display: block;
}

/* ===== Sankra Option ===== */
.sankra-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
}

.sankra-option input {
  width: 22px;
  height: 22px;
  appearance: none;
  -webkit-appearance: none;
  border: 3px solid #000;
  border-radius: 4px;
  cursor: pointer;
  background: #fff;
}

.sankra-option input:checked {
  background: #087dec;
}

.sankra-option label {
  margin: 0;
  cursor: pointer;
}

/* ===== Wall Deduction List ===== */
.adv-wall-ded-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  margin-top: 2px;
}

.adv-wall-ded-item span {
  font-size: 12px;
  color: #ddd;
}

.adv-wall-ded-item button {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 3px;
  padding: 0 8px;
  cursor: pointer;
}

/* ===== Wall List ===== */
.wall-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 5px;
  margin-top: 4px;
}

.wall-list-item span {
  font-size: 13px;
  color: #ddd;
}

.wall-list-item button {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 3px;
  padding: 0 10px;
  cursor: pointer;
  font-size: 14px;
}

.wall-list-item button:hover {
  background: #c82333;
}

/* ===== Custom Ratio ===== */
#advRatioCustom {
  margin-top: 8px;
}

#advRatioCustom input {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: white;
  color: #333;
  font-size: 14px;
}

#advRatioCustom input:focus {
  outline: none;
  border-color: #2a5f8f;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .wall-details-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  .wall-detail-item {
    flex: 1 1 calc(50% - 10px);
    min-width: 100px;
  }

  .deduction-row {
    flex-direction: column;
    align-items: stretch;
  }

  .deduction-add {
    flex: 1;
  }

  .result-grid,
  .result-grid-4,
  .result-grid-3 {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .adv-wall-group .wall-inputs {
    flex-direction: column;
  }

  .adv-wall-group .wall-input-item {
    min-width: unset;
  }
}

@media (max-width: 300px) {
  .result-grid,
  .result-grid-4,
  .result-grid-3 {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .result-card {
    padding: 10px 6px !important;
  }

  .result-card .value {
    font-size: 18px !important;
  }

  .result-card .label {
    font-size: 11px !important;
  }

  .result-card .unit {
    font-size: 10px !important;
  }
}