/* ==========================================================================
   EAC Energy Calculator (design-matched)
   File: /assets/energy-calculator.css
   ========================================================================== */

/* ================================
   Roboto – Local Font Faces
   ================================ */

@font-face {
  font-family: "Roboto";
  src: url("../fonts/Roboto/Roboto-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("../fonts/Roboto/Roboto-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("../fonts/Roboto/Roboto-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("../fonts/Roboto/Roboto-LightItalic.ttf") format("truetype");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("../fonts/Roboto/Roboto-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("../fonts/Roboto/Roboto-MediumItalic.ttf") format("truetype");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("../fonts/Roboto/Roboto-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("../fonts/Roboto/Roboto-BoldItalic.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --eac-border: #e6e8ec;
  --eac-text: #111827;
  --eac-muted: #6b7280;
  --eac-bg: #ffffff;
  --eac-soft: #f7f8fa;
  --eac-accent: #0099d8;
  --eac-accent-soft: #eaf7fc;
  --eac-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
  --eac-shadow-soft: 0 6px 14px rgba(16, 24, 40, 0.06);
  --eac-radius-lg: 16px;
  --eac-radius-md: 12px;
  --eac-radius-sm: 8px;
  --eac-gap: 24px;
}

#eac-clear-all {
  cursor: pointer;
}

.eac-energy-calculator * {
  box-sizing: border-box;
}

.eac-energy-calculator {
  color: var(--eac-text);
  font-family: inherit;
}

/* ==========================================================================
   LEFT: device grid + controls
   ========================================================================== */

.eac-ec-left {
  min-width: 0;
}

/* Device grid */
.eac-ec-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--eac-gap);
}

.eac-ec-device {
  appearance: none;
  border: 1px solid var(--eac-border);
  background: var(--eac-bg);
  border-radius: var(--eac-radius-sm);
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
  box-shadow: none;
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 150px;
}

.eac-ec-device:hover {
  border-color: rgba(0, 150, 219, 0.55);
  box-shadow: var(--eac-shadow-soft);
}

.eac-ec-device.is-active {
  border: 2px solid var(--eac-accent);
  background: var(--eac-accent-soft);
  box-shadow: none;
}

.eac-ec-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
}

.eac-ec-icon img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  display: block;
}

.eac-ec-placeholder {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: #eef2f7;
  display: block;
}

.eac-ec-name {
  font-size: 16px;
  line-height: 22px;
  font-weight: 400;
  color: var(--eac-text);
}

/* Controls block */
.eac-controls {
  margin-top: 26px;
}

.eac-control-title {
  font-size: 18px;
  line-height: 24px;
  font-weight: 500;
  margin: 0 0 14px 0;
  font-family: "Roboto", sans-serif !important;
}

/* Power buttons row (BTU etc.) */
.eac-power-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.eac-ec-power {
  appearance: none;
  border: 1px solid var(--eac-border);
  background: var(--eac-bg);
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 16px;
  line-height: 20px;
  font-weight: 400;
  cursor: pointer;
  font-family: "Roboto", sans-serif !important;
  transition:
    border-color 0.18s ease,
    background 0.18s ease;
}

.eac-ec-power:hover {
  border-color: rgba(0, 150, 219, 0.55);
}

.eac-ec-power.is-active {
  border: 2px solid var(--eac-accent);
  background: var(--eac-accent-soft);
}

/* Qty + Duration dropdowns */
.eac-selects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  margin-top: 14px;
}

.eac-label {
  font-size: 14px;
  line-height: 21px;
  font-weight: 500;
  color: #444748;
  margin-bottom: 10px;
}

/* Select styling */
.eac-energy-calculator select {
  width: 100%;
  height: 54px;
  border: 1px solid #cfd5de;
  border-radius: 10px;
  background: var(--eac-bg);
  padding: 0 44px 0 16px;
  font-size: 16px;
  line-height: 20px;
  color: var(--eac-text);
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;

  /* Custom caret */
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #6b7280 50%),
    linear-gradient(135deg, #6b7280 50%, transparent 50%),
    linear-gradient(to right, transparent, transparent);
  background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 14px) calc(50% - 3px),
    100% 0;
  background-size:
    6px 6px,
    6px 6px,
    2.5em 2.5em;
  background-repeat: no-repeat;
}

.eac-energy-calculator select:focus {
  border-color: rgba(0, 150, 219, 0.7);
  box-shadow: 0 0 0 4px rgba(0, 150, 219, 0.12);
}

/* Add button */
.eac-actions {
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

#eac-ec-add,
#eac-edit-save {
  height: 44px;
  border-radius: 999px;
  border: 0;
  background: #181a1b;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  padding: 10px 20px;
  transition:
    transform 0.12s ease,
    opacity 0.12s ease;
}

#eac-ec-add:hover,
#eac-edit-save:hover {
  opacity: 0.92;
}

#eac-ec-add:active,
#eac-edit-save:active {
  transform: translateY(1px);
}

#eac-ec-cancel {
  height: 50px;
  border-radius: 999px;
  border: 1px solid var(--eac-border);
  background: #fff;
  color: #111;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.eac-hint {
  margin-top: 10px;
  font-size: 14px;
  color: var(--eac-muted);
}

/* Loading / error */
.eac-loading,
.eac-error,
.eac-empty {
  border: 1px solid var(--eac-border);
  border-radius: var(--eac-radius-md);
  padding: 18px;
  background: var(--eac-bg);
  color: var(--eac-muted);
}

.eac-empty {
  display: none !important;
}

/* ==========================================================================
   RIGHT: Summary + items list
   ========================================================================== */

.eac-ec-right {
  min-width: 0;
}

.ec-summary {
  background: #eaf7ff;
  border-radius: 16px;
  padding: 30px 26px;
  text-align: center;
  min-height: 200px;
}

.ec-summary .ec-price {
  font-size: 56px;
  line-height: 1.2;
  font-weight: 700;
  color: #000000;
  margin-top: 6px;
  font-family: "Roboto", sans-serif !important;
}

.ec-summary .ec-sub {
  margin-top: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #374151;
}

.ec-summary > div:not(.ec-price) {
  font-size: 18px;
  font-weight: 400;
  color: #444748;
}

.ec-items {
  margin-top: 18px;
  display: grid;
  gap: 18px;
}

/* Item card */
.ec-item {
  background: #fff;
  /*border: 1px solid var(--eac-border);*/
  border-radius: 8px;
  padding: 18px 18px;
  box-shadow: 0 4px 6px -2px rgba(26, 26, 26, 0.13);
}
.ec-item div {
  color: #666666;
  font-size: 16px;
  line-height: 1.75;
  font-weight: 400;
}

.ec-item div strong {
  font-weight: 500;
  font-size: 18px;
  line-height: 1.5;
  color: #1f292e;
  margin-bottom: 10px;
}

.ec-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.ec-item-title {
  font-size: 18px;
  font-weight: 800;
  color: #111827;
  line-height: 1.25;
}

.ec-item-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* Edit/Delete icons like design */
.eac-ec-edit,
.eac-ec-del {
  width: 34px;
  height: 34px;
  border-radius: 0px;
  border: 0;
  background: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: none;
}

.eac-ec-edit:hover,
.eac-ec-del:hover {
  background: #fff;
}

.ec-item-actions .btn {
  color: #6d7274; /* default icon color */
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

/* Edit hover */
.ec-item-actions .eac-ec-edit:hover {
  color: #0d6efd; /* Bootstrap primary */
}

/* Delete hover */
.ec-item-actions .eac-ec-del:hover {
  color: #dc3545; /* Bootstrap danger */
}

.ec-item-sub {
  margin-top: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #4b5563;
}

/* Blue kWh line */
.ec-item div .ec-item-kwh {
  font-size: 16px;
  font-weight: 400;
  color: var(--eac-accent);
}

#eacEditModal .modal-header {
  border-bottom: none;
}

#eacEditModal .modal-footer {
  border-top: none;
}

#eacEditModal .btn-close {
  padding: 20px !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 992px) {
  .eac-ec-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .eac-ec-right {
    order: 2;
  }

  .eac-ec-left {
    order: 1;
  }
}

@media (max-width: 576px) {
  .eac-ec-grid {
    grid-template-columns: 1fr;
  }

  .eac-selects {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .ec-summary .ec-price {
    font-size: 52px;
  }

  #eac-ec-add,
  #eac-edit-save {
    height: 58px;
    font-size: 17px;
  }
}

.ec-clear-all {
  width: 100%;
  border: none;
  background: #edeeee;
  border-radius: 50px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #181a1b;
  transition: background 0.2s ease;
}
