html, body {
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -ms-user-select: none;
    -khtml-user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -moz-user-select: -moz-none;
    -o-user-select: none;
    user-select: none;

    font-family: 'AssistantExtraBold', sans-serif;

    height: 100%;
    min-height: 100vh;
    overflow: hidden;
    position: fixed;

    margin: 0;
    padding: 0;
    width: 100vw;
}

:root {
  --sl-font-sans: 'AssistantExtraBold', sans-serif;
  --sl-input-font-family: 'AssistantExtraBold', sans-serif;

  --sl-color-primary-50:  #FFF6ED;
  --sl-color-primary-100: #FFE8D0;
  --sl-color-primary-200: #FFD1A3;
  --sl-color-primary-300: #FFBA75;
  --sl-color-primary-400: #FFAD5D;
  --sl-color-primary-500: #FFA756;
  --sl-color-primary-600: #E9974D;
  --sl-color-primary-700: #CC8243;
  --sl-color-primary-800: #995F32;
  --sl-color-primary-900: #663D21;

  --sl-color-success-50:  #FFF6ED;
  --sl-color-success-100: #FFE8D0;
  --sl-color-success-200: #FFD1A3;
  --sl-color-success-300: #FFBA75;
  --sl-color-success-400: #FFAD5D;
  --sl-color-success-500: #FFA756;
  --sl-color-success-600: #E9974D;
  --sl-color-success-700: #CC8243;
  --sl-color-success-800: #995F32;
  --sl-color-success-900: #663D21;

  --sl-color-warning-600: #f1c40f;
  --sl-color-danger-600:  #e74c3c;

  --sl-panel-background-color: #fff;
  --sl-input-border-color: #ddd;
  --sl-focus-ring-color-primary: var(--sl-color-primary-500);
  --sl-color-primary-text: #fff;
  --sl-color-danger-text: #fff;
  --sl-color-warning-text: #fff;
  --sl-color-success-text: #fff;
  --sl-color-neutral-0: #ffffff;
}

.invisible {
    display:none !important;
}

.fullscreen {
    width:100vw;
    min-height: 100vh;
}

/* Ensure logo containers respect safe area on iOS */
#home-pane > div:first-child,
#payments-pane > div:first-child {
    padding-top: env(safe-area-inset-top, 10px);
}

.full {
    position:relative;
    width:100%;
    height:100%;
}

.centerflex {
    display:flex;
    display:-webkit-flex;
    flex-flow:row;
    align-items:center;
    justify-content:center;
}

.rightflex {
    display:flex;
    display:-webkit-flex;
    flex-flow:row;
    align-items:center;
    justify-content:start;
}

.customPopup .leaflet-popup-content-wrapper,
.customPopup .leaflet-popup-content {
    direction: rtl;
    text-align: right;
}

.customPopup .leaflet-popup-content {
    margin: 0;
}
.leftflex {
    display:flex;
    display:-webkit-flex;
    flex-flow:row;
    align-items:center;
    justify-content:start;
}

.columnflex {
    display:flex;
    display:-webkit-flex;
    flex-flow:column;
    align-items:center;
    justify-content:center;
}

.topflex {
    display:flex;
    display:-webkit-flex;
    flex-flow:column;
    align-items:center;
    justify-content:start;
}


#fullpage {
    width: 100vw;
    height: 100vh;
    background-color: white;
    position: fixed;
    top: 0;
    left: 0;
    overflow: hidden;
}

sl-tab-group {
    height: 100vh;
    width: 100vw;
  }

sl-tab-panel::part(base) {
  padding: 0;
  padding-bottom: calc(10vh + env(safe-area-inset-bottom, 0px) + 4vh);
  height: calc(100vh - 10vh - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  position: relative;
  box-sizing: border-box;
}

/* Landscape mode - increase bottom padding since 10vh is proportionally larger */
@media (orientation: landscape) {
  sl-tab-panel::part(base) {
    padding-bottom: calc(10vh + env(safe-area-inset-bottom, 0px) + 12vh);
  }
}

sl-tab-panel.full-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: 0;
}

sl-tab-group.bottom-tabs::part(nav) {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: white;
  border-top: 1px solid #ccc;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

sl-tab::part(base) {
    width: 33vw;
    height: 10vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px; /* icon size */
}

#start-container {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
}

#start-container {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
}

.start-container {
  width: 200%;
  height: 200%;
  background-color: white;
  background-image: url("graphics/rehevnakilogo.jpg");
  background-repeat: repeat;
  background-size: 180px 50px;
  background-position: 0 0;
  transform: rotate(-45deg);
  position: absolute;
  top: -50%;
  left: -50%;
}
@supports (background-image: url("graphics/rehevnakilogo.avif")) {
    .start-container {
        background-image: url("graphics/rehevnakilogo.avif");
    }
}

.wait-container {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

.spinner-icon {
  font-size: 4rem;
  color: var(--sl-color-primary-500);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.login-container {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.login-box {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  max-width: 400px;
  width: 92%;
  margin: 0 2px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  overflow: hidden;
}

.login-box p {
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.login-box sl-input {
  min-width: 0;
  width: 100%;
  font-size: 1.1rem;
}

.login-box sl-input::part(input) {
  font-size: 1.1rem;
}

@media (max-width: 768px) {
  .login-box sl-input,
  .login-box sl-input::part(input) {
    font-size: 1.32rem;
  }

  #tz-input,
  #name-input {
    max-width: 55vw;
  }

  #tz-section label,
  #name-section label {
    white-space: nowrap;
  }
}

/* Table header font size reduction */
#license_plate,
#vehicle_type,
#next_payment,
#invoice_title,
#payment_date,
#total,
#car_price,
#action {
  font-size: 0.8em;
}

/* In landscape mode, make login box scrollable and adjust size */
@media (orientation: landscape) {
  .login-box {
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
  }

  .login-box h2 {
    font-size: 1.1rem;
    margin: 0.5rem 0;
  }

  .login-box p {
    font-size: 0.85rem;
    margin: 0.3rem 0;
  }

  /* Reduce logo height in landscape */
  .login-box .logo_rehevnaki {
    height: 6vh;
  }

  /* Compact spacing for phone and code sections */
  .login-box .phone-section {
    margin-bottom: 0.5rem;
  }

  .login-box #code-section {
    margin-top: 0.5rem !important;
  }
}

.phone-section {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.terms-section {
  margin-top: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  direction: rtl;
  text-align: right;
  font-size: 0.9rem;
  line-height: 1.4;
}

.terms-section a {
  color: var(--sl-color-primary-600);
  text-decoration: underline;
  cursor: pointer;
}

.terms-section a:hover {
  color: var(--sl-color-primary-700);
}

.car-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem;
}

td, th {
  text-align: center;       /* horizontal centering */
  vertical-align: middle;   /* vertical centering */
}

thead th {
    border-bottom: 2px solid #ccc; /* or any color/width you like */
    padding-bottom: 1vh;
}


.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modalinfront {
  z-index: 3000;
}

.modal-content {
  position: relative;
  background-color: white;
  padding: 2vh;
  width: 96vw;
  max-width: 96vw;
  border-radius: 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.menu-content {
  position: fixed;
  top: 8vh;
  right: 0;
  background-color: white;
  padding: 0px;
  width: 45vw;
  max-width: 45vw;
  border-radius: 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}


.logo_rehevnaki {
    width:42vh;
    height:10vh;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    background-image: url("graphics/rehevnakilogo.jpg");
    margin-right:2vw;
}
@supports (background-image: url("graphics/rehevnakilogo.avif")) {
    .start-logo_rehevnaki {
        background-image: url("graphics/rehevnakilogo.avif");
    }
}

.fullscreen.topflex {
    display: flex;
    flex-direction: column;
    min-height: min-content;
    gap: 1vh;
    padding-bottom: 2vh;
}



#cars-table tbody tr:nth-child(odd) {
    background-color: #FFF8F0;
}

#cars-table tbody tr:nth-child(even) {
    background-color: white;
}

.plate-cell {
    -webkit-user-select: text;
    user-select: text;
    cursor: text;
}

#invoice-table tbody tr:nth-child(odd) {
    background-color: #FFF8F0;
}

#invoice-table tbody tr:nth-child(even) {
    background-color: white;
}

#paymentPopup.invisible {
  display: none;
}

#paymentPopup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999999;
}

#network-error-popup.invisible {
  display: none;
}

.network-error-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999999;
}

.network-error-box {
  background: white;
  border-radius: 20px;
  padding: 2rem 1.5rem;
  width: 80vw;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.network-error-icon {
  font-size: 3rem;
  color: #E9974D;
  margin-bottom: 0.75rem;
  display: block;
}

.network-error-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  color: #333;
}

.network-error-msg {
  margin: 0 0 1.5rem 0;
  font-size: 0.9rem;
  color: #666;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}


/* Force font on all Shoelace components */
sl-input::part(input),
sl-input::part(base),
sl-textarea::part(textarea),
sl-select::part(display-input),
sl-button::part(base),
sl-button::part(label),
sl-checkbox::part(base),
sl-checkbox::part(label),
sl-dialog::part(title),
sl-dialog::part(body),
sl-dialog::part(footer),
sl-card::part(base),
sl-card::part(body),
sl-tab::part(base),
sl-tab-panel::part(base) {
  font-family: 'AssistantExtraBold', sans-serif;
}

/* Custom car dialog overlay (replaces sl-dialog for reliable iOS keyboard opening) */
.car-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: rgba(0, 0, 0, 0.45);
  justify-content: center;
  align-items: center;
}

.car-dialog-panel {
  background: var(--sl-panel-background-color, #fff);
  border-radius: var(--sl-border-radius-large, 0.5rem);
  width: min(90vw, 32rem);
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: var(--sl-shadow-x-large);
  display: flex;
  flex-direction: column;
}

.car-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sl-spacing-large, 1rem);
  border-bottom: solid 1px var(--sl-color-neutral-200, #e2e2e2);
  font-size: var(--sl-font-size-large, 1.125rem);
  font-weight: var(--sl-font-weight-semibold, 600);
}

.car-dialog-body {
  padding: var(--sl-spacing-large, 1rem);
}

/* Right-align text in telephone input fields for Hebrew */
#phone-input-display::part(input),
#phone-input::part(input),
#code-input::part(input),
#tz-input::part(input),
#license-input::part(input),
#license-input-display::part(input) {
  text-align: right;
  direction: rtl;
}

/* Blinking arrow indicator for terms checkbox */
.blink-arrow {
  color: #e74c3c;
  font-size: 0.85rem;
  font-weight: 900;
  -webkit-text-stroke: 0.75px #e74c3c;
  text-stroke: 0.75px #e74c3c;
  animation: blink 1s infinite;
  pointer-events: none;
  top: 1.2rem;
  z-index: 10;
}

.blink-arrow.hidden {
  display: none;
}

@keyframes blink {
  0%, 49% {
    opacity: 1;
  }
  50%, 100% {
    opacity: 0;
  }
}

#terms-indicator {
  top: 70% !important;
}

/* Increase checkbox touch target for better mobile usability */
#terms-checkbox::part(control) {
  width: 1.5rem;
  height: 1.5rem;
}

#terms-checkbox::part(base) {
  padding: 0.5rem;
}

.no-close-button::part(close-button) {
  display: none;
}

/* Popup buttons styling - horizontal layout with small gaps */
.popup-buttons {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: start;
  gap: 0.5rem;
  width: 100%;
}

/* Round icon button for request code */
#request-code-btn {
  flex: 0 0 auto;
}

/* Small text styling only for the three account buttons */
#show-terms-btn,
#logout-btn,
#help-btn {
  flex: 0 0 auto;
  min-width: 0;
}

#show-terms-btn::part(base),
#logout-btn::part(base),
#help-btn::part(base) {
  font-size: 0.8rem;
  line-height: 1.2;
  padding: 0.4rem 0.2rem;
  height: 5vh;
  min-height: 2.5rem;
  white-space: nowrap;
  text-align: center;
  max-width: 30vw;
  min-width: 30vw;
  width: 30vw;
  display: flex;
  align-items: center;
  justify-content: center;
}

#show-terms-btn::part(label),
#logout-btn::part(label),
#help-btn::part(label) {
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* Small text styling for car dialog buttons */
#reset-input-btn,
#agree-btn {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 40%;
}

#reset-input-btn::part(base),
#agree-btn::part(base) {
  font-size: 0.7rem;
  line-height: 1.2;
  padding: 0.4rem 0.35rem;
  height: 3.2rem;
  white-space: normal;
  word-wrap: break-word;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

#reset-input-btn::part(label),
#agree-btn::part(label) {
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  width: 100%;
  max-width: 100%;
}

/* Dropdown styles */
.dropdown {
  position: relative;
  display: inline-block;
}

/* Dropdown Content (Hidden by Default) */
.dropdown-content {
  position: fixed;
  left: 10px;
  right: 10px;
  top: auto;
  background-color: white !important;
  width: calc(100% - 20px);
  border: 2px solid #333;
  border-radius: 4px;
  max-height: 50vh;
  height: auto;
  overflow-y: scroll;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  z-index: 10001;
  cursor: pointer;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  margin-top: 4px;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform;
}

/* Links inside the dropdown */
.dropdown-content div {
  color: black !important;
  padding: 12px 16px;
  text-decoration: none;
  display: flex;
  align-items: center;
  background-color: white !important;
  border-bottom: 1px solid #ccc;
  min-height: 44px;
  -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

.dropdown-content div:hover,
.dropdown-content div:active {
  background-color: #f0f0f0;
}

/* Change color of dropdown links on hover */
.dropdown-content a:hover {
  background-color: #f1f1f1;
}

/* Show the dropdown menu (use JS to add this class to the .dropdown-content container when the user clicks on the dropdown button) */
.show {
  display: block;
}