/* ─── Variables & Reset ─────────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── Base ──────────────────────────────────────────────────────────────────── */
.sc-page {
  background: #1a1a1a url('../img/solar/camper-sun.png') no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
  color: #ffffff;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  position: relative;
}

.sc-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 0;
  pointer-events: none;
}

.sc-page > * {
  position: relative;
  z-index: 1;
}

.sc-hidden {
  display: none !important;
}

/* ─── Header ────────────────────────────────────────────────────────────────── */
.sc-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.sc-header__back {
  color: #ff652f;
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: all 0.3s ease-in-out;
}

.sc-header__back:hover {
  color: #ff8a5c;
}

.sc-header__title {
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ─── Tabs ───────────────────────────────────────────────────────────────────── */
.sc-tabs {
  display: flex;
  width: 100%;
  border-bottom: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.sc-tabs__btn {
  flex: 1;
  padding: 0.7rem 0.2rem;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

.sc-tabs__btn:hover {
  color: rgba(255, 255, 255, 0.85);
}

.sc-tabs__btn--active {
  color: #ffffff;
  border-bottom-color: #ff652f;
}

/* ─── Panels ─────────────────────────────────────────────────────────────────── */
.sc-panel {
  display: none;
  padding: 1.5rem 1.25rem 6rem;
  max-width: 640px;
  margin: 0 auto;
}

.sc-panel--active {
  display: block;
}

.sc-panel__title {
  font-size: 1rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.5rem;
}

.sc-panel__note {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.25rem;
  margin-bottom: 1rem;
}

/* ─── Fields ─────────────────────────────────────────────────────────────────── */
.sc-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.sc-field__label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.6);
}

.sc-field__select,
.sc-field__input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  color: #ffffff;
  font-size: 1rem;
  padding: 0.65rem 0.75rem;
  width: 100%;
  transition: border-color 0.3s ease-in-out;
  -webkit-appearance: none;
  appearance: none;
}

.sc-field__select:focus,
.sc-field__input:focus {
  outline: none;
  border-color: #ff652f;
}

.sc-field__select option {
  background: #272727;
  color: #ffffff;
}

/* ─── Solar Map & Hour Bar ───────────────────────────────────────────────────── */
.sc-solar-map {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sc-hour-bar {
  width: 100%;
  display: block;
  margin-bottom: 1.25rem;
  border-radius: 4px;
}

/* ─── Component Images ───────────────────────────────────────────────────────── */
.sc-component-img {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sc-component-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.sc-component-card h3 {
  font-size: 0.9rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.5rem;
}

.sc-component-card p {
  font-size: 1rem;
  line-height: 1.5;
}

/* ─── Battery Tab ────────────────────────────────────────────────────────────── */
.sc-autonomy-btns {
  border: none;
  padding: 0;
  margin-bottom: 1.25rem;
}

.sc-autonomy-btns legend {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.5rem;
  display: block;
  width: 100%;
}

.sc-autonomy-btns-row {
  display: flex;
}

.sc-autonomy-btn {
  flex: 1;
  padding: 0.65rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

.sc-autonomy-btn:first-of-type { border-radius: 6px 0 0 6px; }
.sc-autonomy-btn:last-of-type  { border-radius: 0 6px 6px 0; }

.sc-autonomy-btn--active {
  background: #ff652f;
  border-color: #ff652f;
  color: #ffffff;
}

.sc-battery__result {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.sc-battery__recommendation {
  background: rgba(255, 101, 47, 0.1);
  border: 1px solid rgba(255, 101, 47, 0.3);
  border-radius: 8px;
  padding: 1rem;
}

.sc-battery__rec-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ff652f;
  margin-bottom: 0.5rem;
  font-weight: 400;
}

/* ─── Summary Tab ────────────────────────────────────────────────────────────── */
.sc-summary__section {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.sc-summary__section h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #ff652f;
  font-weight: 400;
  margin-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 101, 47, 0.2);
  padding-bottom: 0.4rem;
}

.sc-summary__section p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
}

/* ─── Demands Tab ────────────────────────────────────────────────────────────── */
.sc-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 0.5rem;
}

.sc-toggle-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
}

.sc-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.sc-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.sc-toggle__slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 26px;
  transition: all 0.3s ease-in-out;
}

.sc-toggle__slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.3s ease-in-out;
}

.sc-toggle input:checked + .sc-toggle__slider {
  background: #ff652f;
}

.sc-toggle input:checked + .sc-toggle__slider::before {
  transform: translateX(22px);
}

.sc-load-summary {
  font-size: 1rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ─── Buttons ────────────────────────────────────────────────────────────────── */
.sc-btn {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: #ffffff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  text-align: center;
}

.sc-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.sc-btn--primary {
  background: #ff652f;
  border-color: #ff652f;
}

.sc-btn--primary:hover {
  background: #e55526;
}

.sc-btn--danger {
  background: rgba(229, 83, 83, 0.2);
  border-color: rgba(229, 83, 83, 0.5);
  color: #ff8080;
}

.sc-btn--danger:hover {
  background: rgba(229, 83, 83, 0.35);
}

/* ─── Secondary Nav ──────────────────────────────────────────────────────────── */
.sc-secondary-nav {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.75rem;
  z-index: 9;
  width: 100%;
  max-width: 640px;
  padding: 0 1.25rem;
}

.sc-secondary-nav__btn {
  flex: 1;
  padding: 0.7rem 0.5rem;
  background: rgba(39, 39, 39, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  backdrop-filter: blur(8px);
}

.sc-secondary-nav__btn:hover {
  background: rgba(255, 101, 47, 0.25);
  border-color: rgba(255, 101, 47, 0.5);
}

/* ─── Modals ─────────────────────────────────────────────────────────────────── */
.sc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 99;
  display: none;
}

.sc-modal-backdrop--visible {
  display: block;
}

.sc-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 85vh;
  background: #1e1e1e;
  border-top: 2px solid #ff652f;
  border-radius: 14px 14px 0 0;
  transform: translateY(100%);
  transition: all 0.4s ease-in-out;
  z-index: 100;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sc-modal--fullscreen {
  max-height: 92vh;
}

.sc-modal--open {
  transform: translateY(0);
}

.sc-modal__header {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  gap: 0.75rem;
}

.sc-modal__title {
  flex: 1;
  font-size: 1rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sc-modal__close,
.sc-modal__back {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  transition: color 0.3s ease-in-out;
  flex-shrink: 0;
}

.sc-modal__close:hover,
.sc-modal__back:hover {
  color: #ff652f;
}

.sc-modal__body {
  overflow-y: auto;
  padding: 1.25rem;
  flex: 1;
}

/* ─── Load List ──────────────────────────────────────────────────────────────── */
.sc-load-list__total {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(255, 101, 47, 0.1);
  border: 1px solid rgba(255, 101, 47, 0.25);
  border-radius: 6px;
}

.sc-load-list {
  list-style: none;
  margin-top: 1rem;
}

.sc-load-list__empty {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.9rem;
  text-align: center;
  padding: 1.5rem 0;
}

.sc-load-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  gap: 0.75rem;
}

.sc-load-list__item-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}

.sc-load-list__item-name {
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-load-list__item-meta {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
}

.sc-load-list__item-type {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ff652f;
}

.sc-load-list__edit-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease-in-out;
  flex-shrink: 0;
}

.sc-load-list__edit-btn:hover {
  border-color: #ff652f;
  color: #ff652f;
}

/* ─── Load Item Form ─────────────────────────────────────────────────────────── */
.sc-load-form__preview {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.sc-load-form__actions {
  display: flex;
  gap: 0.75rem;
}

/* ─── Inspector Grid ─────────────────────────────────────────────────────────── */
.sc-inspector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.sc-inspector-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  text-align: center;
}

.sc-inspector-card:hover {
  background: rgba(255, 101, 47, 0.15);
  border-color: rgba(255, 101, 47, 0.4);
}

.sc-inspector-card__img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  display: block;
}

.sc-inspector-card__name {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── Grid modals: no-scroll, all cards fill available height ────────────────── */
#modal-inspector .sc-modal__body,
#modal-additional-info .sc-modal__body {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
}

/* 8 components — responsive columns, rows fill available height */
#modal-inspector .sc-inspector-grid {
  flex: 1;
  min-height: 0;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 1fr;
  gap: 0.5rem;
}

@media only screen and (min-width: 520px) {
  #modal-inspector .sc-inspector-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media only screen and (min-width: 720px) {
  #modal-inspector .sc-inspector-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 6 info items — responsive columns, rows fill available height */
#modal-additional-info .sc-inspector-grid {
  flex: 1;
  min-height: 0;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 1fr;
  gap: 0.5rem;
}

@media only screen and (min-width: 520px) {
  #modal-additional-info .sc-inspector-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

#modal-inspector .sc-inspector-card,
#modal-additional-info .sc-inspector-card {
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

#modal-inspector .sc-inspector-card__img,
#modal-additional-info .sc-inspector-card__img {
  flex: 1;
  width: 100%;
  aspect-ratio: unset;
  min-height: 0;
  object-fit: contain;
  margin-bottom: 0.3rem;
}

#modal-inspector .sc-inspector-card__name,
#modal-additional-info .sc-inspector-card__name {
  font-size: 0.62rem;
  flex-shrink: 0;
}

/* ─── Detail Panel ───────────────────────────────────────────────────────────── */
.sc-detail-panel__image {
  width: 100%;
  max-width: 280px;
  display: block;
  margin: 0 auto 1.25rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sc-detail-panel__section {
  margin-bottom: 1.25rem;
}

.sc-detail-panel__section h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #ff652f;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.sc-detail-panel__section p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
  white-space: pre-line;
}

.sc-summary__disclaimer {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
  line-height: 1.6;
}

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
.sc-footer {
  font-size: 0.6rem;
  text-align: right;
  padding: 0.5rem 1rem 1rem;
  color: rgba(255, 255, 255, 0.35);
  position: relative;
  z-index: 1;
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media only screen and (min-width: 640px) {
  .sc-panel {
    padding: 2rem 1.5rem 7rem;
  }

  .sc-tabs__btn {
    font-size: 0.82rem;
  }
}
