/* ============================================
   STATUS STYLES
   ============================================ */
.status-available {
  color: #22c55e;
}

.status-charging {
  color: #3b82f6;
}

.status-faulted {
  color: #ef4444;
}

.status-preparing {
  color: #f59e0b;
}

.status-offline {
  color: #9ca3af;
}

/* ============================================
   RFID STATUS STYLES
   ============================================ */
.rfid_status-active {
  color: #22c55e;
}

.rfid_status-inactive {
  color: #9ca3af;
}

.rfid_status-blocked {
  color: #ef4444;
}

/* ============================================
   LAYOUT & STRUCTURE
   ============================================ */
html, body {
  height: 100%;
  margin: 0;
}

#layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #1d263bff;
  overflow-y: auto;
}


.main-content {
  margin-left: 235px;   /* space for fixed sidebar */
  padding: 1rem;
  display: flex;         /* keeps your inner items as flex if needed */
  flex-direction: column; /* stack content vertically */
  flex: 1;               /* allow content to grow */
  min-height: 100vh;     /* ensures main content fills viewport */
  box-sizing: border-box; /* includes padding in width */
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  display: flex;
  flex-direction: column;
  position: fixed;      /* ✅ make it stay in place */
  top: 0;
  left: 0;
  width: 220px;         /* fixed width */
  height: 100vh;        /* full viewport height */
  flex-shrink: 0;       /* prevents shrinking */
  background: #0f172a;
  font-size: 1.3rem;
  color: #e5e7eb;
  padding: 1rem;
  font-weight: bold;
  overflow-y: auto;     /* scroll inside sidebar if menu is too tall */
  z-index: 1000;        /* above main content if needed */
}

/* Logo */
.logo {
  width: 150px;
  margin-bottom: 20px;
}

/* Menu links */
.menu-links {
  flex-grow: 1;
  list-style: none;
  padding: 0;
}

.menu-links li {
  margin-bottom: 0.5rem;
}

.menu-links li a {
  display: block;
  width: 100%;
  padding: 0.75rem 0;
  border-radius: 6px;
  box-sizing: border-box;
  color: inherit;
  text-decoration: none;
}

.menu-links li a:hover {
  background: #1e293b;
}

/* Logout section */
.menu-logout {
  list-style: none;
  padding: 0;
  margin-top: auto;
}

.menu-logout li a {
  display: block;
  width: 100%;
  padding: 0.75rem 0;
  border-radius: 6px;
  box-sizing: border-box;
  color: inherit;
  text-decoration: none;
}

.menu-logout li a:hover {
  background: #1e293b;
}

.sidebar-layout-header {
  color: #fe9901;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

/* ============================================
   SIDEBAR - MOBILE
   ============================================ */
/* Hamburger button (hidden on desktop) */
.hamburger {
  display: none;
  font-size: 2rem;
  background: none;
  border: none;
  color: #0f172a;
  padding: 1rem;
  cursor: pointer;
}

/* Mobile styles */
@media (max-width: 768px) {

  .hamburger {
    display: block;

    position: fixed;   
    top: 15px;
    right: 15px;       /* move to top-right */

    z-index: 1100;

    font-size: 2rem;
    background: none;
    border: none;
    color: #ffffff;    /* better contrast on dark UI */
    padding: 0.5rem;

    width: auto;       /* prevent stretching */
  }

  .sidebar {
    left: -100%;       /* hidden by default */
    width: 70%;
    transition: left 0.3s ease;
  }

  .sidebar.active {
    left: 0;           /* slides in */
  }

  .main-content {
    margin-left: 0;    /* content full width */
  }
}

.overlay {
  display: none;
}

@media (max-width: 768px) {
  .overlay {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
  }

  .overlay.active {
    opacity: 1;
    pointer-events: all;
  }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  background-color: #0f172a;
  color: #e5e7eb;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover {
  background-color: #1e293b;
}

.actionButton {
  display: block;
  width: 100%;
  margin-top: 15px;
  padding: 10px;
  background-color: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.ToggleButton {
  display: block;
  transition: background-color 0.1s ease;
  width: 7rem;
  height: 2.5rem;
  margin-top: 15px;
  padding: 10px;
  background-color: #bbbbbb;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.tariffButton {
  width: 4rem;
  border: none;
  border-radius: 6px;
  text-align: center;
}

.deleteButton {
  display: block;
  width: 20%;
  padding: 10px;
  background-color: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin: 0 auto;
}

.deleteGroupButton {
  display: block;
  width: 20%;
  padding: 10px;
  background-color: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin: 0 auto;
}

.addButton {
  display: block;
  width: 20%;
  margin-top: 15px;
  padding: 10px;
  background-color: #22c55e;
  color: white;
  margin: 0 auto;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.charger_action {
  border: none;
  border-radius: 8px;
  padding: 0.5rem;
  transition: background-color 0.15s ease;
  flex-direction: column;
  display: flex;
}

.charger_action:hover {
  background-color: #ef4444;
  cursor: pointer;
}

.chargerTariffButton {
  width: 4rem;
  border: none;
  border-radius: 6px;
  text-align: center;
  margin-left: 5%;
  margin-right: 5%;
}

.requestDiagnosticsButton {
  margin-bottom: 10%;
}

.requestDiagnosticsButton:hover {
  background-color: #3b82f6;
  color: white;
}

/* ============================================
   ITEMS & CARDS
   ============================================ */
.item_container {
  padding: 1rem;
  width: 90%;
}

.items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.item-card {
  border: 1px solid #ffffffff;
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  background: #ffffffff;
}

.item-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.item-card a:visited,
.item-card a:hover,
.item-card a:active {
  text-decoration: none;
  color: inherit;
}

.item-name {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.item-icon {
  margin: 20px 0px 20px 0px;
}

/* ============================================
   POPUPS & MODALS
   ============================================ */
.popupOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.RFIDpopupOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.hidden {
  display: none;
}

.popup {
  background: #ffffff;
  border-radius: 20px;
  width: 50%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.popup .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background-color: #3b82f6;
  color: white;
  font-weight: bold;
}

.closePopup {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

.closePopup:hover {
  color: #d1d5db;
}

.popupBody {
  width: 99%;
  padding: 1rem;
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  font-weight: bold;
  font-size: 22px;
}

.popupFooter {
  padding: 1rem;
  text-align: right;
  border-top: 1px solid #e5e7eb;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #ffffff;
  color: #000000;
  padding: 2rem;
  border-radius: 12px;
  width: 320px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  font-size: 1rem;
  font-family: sans-serif;
}

.modal-content h3 {
  color: #3b82f6;
  margin-bottom: 1rem;
  font-weight: bold;
  font-size: 1.2rem;
}

.modal-content label {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  font-weight: 500;
  color: #000000;
}

.modal-content select {
  width: 100%;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #3b82f6;
  background: #ffffff;
  color: #000000;
  font-size: 1rem;
}

.modal-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
}

.modal-actions button {
  flex: 1;
  margin: 0 0.25rem;
  padding: 0.5rem 0;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: background 0.2s, color 0.2s;
}

#periodApply {
  background: #22c55e;
  color: #ffffff;
}

#periodApply:hover {
  background: #16a34a;
}

#periodCancel {
  background: #ef4444;
  color: #ffffff;
}

#periodCancel:hover {
  background: #dc2626;
}

.modal.show {
  animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Invoice Modal */
.invoice-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.invoice-modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  width: 300px;
  max-width: 80%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.invoice-modal-buttons {
  margin-top: 20px;
  display: flex;
  justify-content: space-around;
}

.invoice-modal-buttons button {
  padding: 8px 16px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.invoice-modal-buttons button#confirmYes {
  background-color: #28a745;
  color: #fff;
}

.invoice-modal-buttons button#confirmNo {
  background-color: #dc3545;
  color: #fff;
}

/* ============================================
   POPUPS & MODALS - MOBILE
   ============================================ */

@media (max-width: 768px) {
  .popup {
    width: 90%;          /* almost full width on small screens */
    margin: 1rem auto;   /* center horizontally with some vertical margin */
    border-radius: 15px; /* slightly smaller radius */
  }

  .popupBody {
    max-height: 50vh;    /* allow popup content to scroll if tall */
    padding: 0.5rem;
    font-size: 16px;     /* smaller font for mobile */
  }

  .buttonContainer {
    flex-direction: column;  /* stack buttons vertically */
    gap: 0.5rem;
  }

  .popupFooter {
    padding: 0.5rem;
  }

  .tableWrapper {
  overflow-x: auto;      /* horizontal scroll if needed */
  width: 100%;
}

  .buttonContainer {
    flex-direction: column; /* vertical stack */
    align-items: stretch;   /* buttons fill width */
    gap: 0.5rem;
  }

  .buttonContainer button,
  .tariffContainer input {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .popup {
    width: 95%;
    max-height: 90vh;
  }
}


/* ============================================
   TABLES
   ============================================ */
.transactionsTable {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

.transactionsTable th {
  background-color: #3b82f6;
  border: 1px solid black;
  color: white;
  font-size: medium;
}

.transactionsTable td {
  border: 1px solid black;
  background-color: #f9fafb;
  font-size: medium;
}

th, td {
  padding: 8px;
  text-align: left;
}

.transactionsTable th.sort-up::after {
  content: " ▲";
}

.transactionsTable th.sort-down::after {
  content: " ▼";
}

.download-link {
  color: #16a34a;
  text-decoration: none;
}

.download-cell {
  text-align: center;
}

.separator-cell {
  font-weight: bold;
  background-color: #e5e7eb;
  text-align: center;
}

/* ============================================
   BUTTON CONTAINERS
   ============================================ */
.buttonContainer {
  display: flex;
  justify-content: center;
}

.tariffContainer {
  position: relative;
  display: inline-flex;
  align-items: center;
  background-color: #3b82f6;
  border-radius: 6px;
  padding-left: 12px;
  gap: 6px;
  padding-right: 12px;
  margin-top: 15px;
  margin-left: 10px;
  height: 2.5rem;
}

.tariffUnit,
.tariffPrice {
  color: white;
  white-space: nowrap;
}

.tariffCheckboxContainer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
  margin-top: 15px;
  background-color: #3b82f6;
  border-radius: 6px;
  height: 2.5rem;
  padding: 0 12px;
}

.tariffCheckboxText {
  color: white;
}

@media (max-width: 768px) {
  .tariffContainer {
    margin-left: 0;
  }

  .tariffCheckboxContainer {
    margin-left: 0;
  }
}

/* ============================================
   INPUTS & FORMS
   ============================================ */
.niceInput {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.niceInput:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
  outline: none;
}

.niceInput::placeholder {
  color: #999;
  font-style: italic;
}

.searchInput {
  margin-left: 1rem;
  width: 90%;
  padding: 10px 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
  transition: all 0.2s ease;
  box-sizing: border-box;
  margin-bottom: 15px;
}

/* ============================================
   AUTOCOMPLETE
   ============================================ */
.autocomplete {
  position: relative;
  width: 100%;
}

.autocomplete-items {
  position: absolute;
  background: white;
  border: 1px solid #ccc;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
}

.autocomplete-items div {
  padding: 8px;
  cursor: pointer;
}

.autocomplete-items div:hover {
  background-color: #e5e7eb;
}

/* ============================================
   CHARTS
   ============================================ */
.mainchart {
  display: flex;
  justify-content: left;
  position: relative;
  height: 100%;
}

.barchart {
  display: flex;
  position: relative;
  align-items: flex-end;
  height: 100%;
  background-color: transparent;
}

.bar {
  position: relative;
  width: 60px;
  transition: height 0.5s ease-out;
  background-color: #3b82f6;
  z-index: 3;
  border-radius: 8px;
  margin-right: 10px;
}

.greybar {
  position: absolute;
  border-radius: 8px;
  z-index: 2;
  width: 60px;
  height: 100%;
  background-color: #7f7f7f;
  margin-right: 10px;
  opacity: 0.5;
}

.bar::after {
  content: attr(data-value);
  display: block;
  text-align: center;
  font-weight: bold;
  font-size: large;
  margin-top: -23px !important;
}

@media (max-width: 768px) {
  /* Main chart container stack */
  .mainchart {
    flex-direction: column;        /* chart above details */
    align-items: center;
    height: auto !important;
    margin-bottom: 1rem;
  }

  .barchart {
    width: 100%;                   /* fill width */
    justify-content: center;
    margin-bottom: 1rem;
  }

  .bar,
  .greybar {
    width: 40px;                   /* narrower bars on small screens */
    margin-right: 5px;
  }

  .bar::after {
    font-size: 14px;               /* smaller text for mobile */
    margin-top: -18px !important;
  }

  /* Charger details stack vertically */
  .charger_details_layout {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .charger_details_container,
  .charger_actions {
    width: 100%;
  }

  /* Input and buttons fill width */
  .chargerTariffButton,
  .charger_action {
    width: 100%;
    box-sizing: border-box;
  }

  /* Optional: make header slightly smaller */
  .popup .header h3 {
    font-size: 1rem;
  }
}

/* ============================================
   CHARGER DETAILS
   ============================================ */
.charger_details_layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.charger_details_container {
  background-color: #f3f3f3;
  padding: 1rem;
  border-radius: 8px;
  min-width: 30%;
}

.charger_details {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.25rem;
  font-size: 0.95rem;
  font-weight: normal;
}

.charger_details_actions {
  display: flex;
  gap: 0.5rem;
}

.charger_price {
  display: flex;
  margin-top: 5%;
}

/* ============================================
   TOOLTIPS
   ============================================ */
.has-tooltip {
  position: relative;
}

.has-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.has-tooltip:hover::after {
  opacity: 1;
}

/* ============================================
   GROUP MEMBERS
   ============================================ */
.groupMembersContainer {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.groupIcon {
  margin-top: 4px;
  margin-right: 4px;
}

.memberList {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.memberList li {
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 14px;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at top, #1e293b, #0f172a);
}

.login-card {
  background: #ffffff;
  width: 360px;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.login-logo {
  width: 140px;
  margin-bottom: 1rem;
}

.login-card h1 {
  margin: 0;
  font-size: 1.6rem;
  color: #0f172a;
}

.login-subtitle {
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  color: #6b7280;
  font-size: 0.95rem;
}

.login-field {
  text-align: left;
  margin-bottom: 1rem;
}

.login-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: bold;
  margin-bottom: 0.3rem;
  color: #374151;
}

.login-button {
  margin-top: 1rem;
}

.login-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 0.6rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-weight: bold;
}

/* ============================================
   ERROR MESSAGES
   ============================================ */
.fullpage-error-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.error-message {
  color: #ef4444;
  background-color: #fee2e2;
  border: 1px solid #f87171;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.95rem;
  margin: 12px 0;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ============================================
   PERIOD ITEMS
   ============================================ */
.period-item {
  text-align: center;
  margin-bottom: 2rem;
}

.period-button {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  background-color: #3b82f6;
  color: #ffffff;
  transition: background-color 0.2s;
}

.period-button:hover {
  background-color: #2563eb;
}

.fullpage-success-container {
    margin-bottom: 20px;
}

.success-message {
    background: #14532d;
    color: #86efac;
    padding: 14px;
    border-radius: 8px;
    font-weight: 600;
}