/* ==========================================================================
   Smart Base Premium Custom Stylesheet
   Fixes layout clipping, footer pinning, header anchoring, and card stretching
   ========================================================================== */

/* Top-level viewport sizing to prevent double scrollbars and viewport glitches */
html, body, #root, .App {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh !important;
  height: 100% !important;
  background-color: #f4f4f5 !important;
  font-family: 'Heebo', 'Rubik', Roboto, sans-serif !important;
  box-sizing: border-box !important;
  overflow: hidden !important; /* Lock the outer viewport scroll */
}

/* Universal page scroll container (ONLY the first div child inside .App handles scroll) */
.App > div:first-child {
  height: 100% !important;
  min-height: 100% !important;
  overflow-y: auto !important; 
  -webkit-overflow-scrolling: touch; /* Enable native elastic scroll physics on iOS */
  background-color: #f4f4f5 !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  padding-bottom: 0 !important;
}

/* Inner layout wrappers - stretch dynamically using flex-grow without forcing 100vh */
.jss23, .jss28, .jss134, .jss139 {
  display: flex !important;
  flex-direction: column !important;
  flex-grow: 1 !important;
  height: auto !important;
  min-height: auto !important;
  background-color: #f4f4f5 !important;
  box-sizing: border-box !important;
}

/* Fix header at the top of the viewport (always fixed and anchored!) */
.MuiAppBar-root, .muirtl-14qyatn {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 1100 !important;
  box-sizing: border-box !important;
}

/* Header Spacers (clean, fixed height of 56px to push content right below the fixed header) */
.jss34, .jss146 {
  height: 56px !important;
  min-height: 56px !important;
  max-height: 56px !important;
  display: block !important;
  flex-grow: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Add padding ONLY to the index page wrappers to make room for fixed bottom footer tabs */
.jss23, .jss28, .jss25, .jss43 {
  padding-bottom: 95px !important; /* Perfect gap above fixed tabs */
  box-sizing: border-box !important;
}

/* Give a subtle interactive bottom padding to page 2 details page so the user can drag/bounce the page slightly (iOS rubber-band effect) */
.jss134, .jss139 {
  padding-bottom: 35px !important;
  box-sizing: border-box !important;
}

/* Reset all padding-bottom overrides on the cards to prevent them from stretching down */
.MuiCard-root {
  padding-bottom: unset !important;
  flex-grow: 0 !important;
  margin-bottom: 16px !important;
}

/* Fixed Pin Footer Tabs at the bottom of screen */
.MuiTabs-root, .muirtl-orq8zk {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  height: 72px !important; /* Set proper standard height for the footer tab bar */
  min-height: 72px !important;
  z-index: 1100 !important;
  background-color: #ffffff !important;
  box-shadow: 0px -4px 12px rgba(0, 0, 0, 0.05) !important;
  border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
  display: flex !important;
  flex-direction: row !important; /* Ensure tabs are horizontal */
}

/* Custom Setup / Profile Modal Styling (Premium Glassmorphism & Material look) */
.sb-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(39, 52, 70, 0.6);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sb-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.sb-modal-card {
  background: #ffffff;
  width: 90%;
  max-width: 480px;
  max-height: 85vh;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  direction: rtl; /* Localized Hebrew layout */
  padding: 24px;
}

.sb-modal-overlay.active .sb-modal-card {
  transform: translateY(0);
}

.sb-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid #f4f4f5;
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.sb-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #273446;
  margin: 0;
}

.sb-modal-close {
  background: #f4f4f5;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  color: #273446;
  transition: background 0.2s;
}

.sb-modal-close:hover {
  background: #e4e4e7;
}

/* Premium Forms */
.sb-form-group {
  margin-bottom: 16px;
}

.sb-form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #5F42FF;
  margin-bottom: 6px;
}

.sb-form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e4e4e7;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sb-form-input:focus {
  border-color: #5F42FF;
  box-shadow: 0 0 0 3px rgba(95, 66, 255, 0.15);
}

.sb-form-row {
  display: flex;
  gap: 12px;
}

.sb-form-row .sb-form-group {
  flex: 1;
}

.sb-btn-save {
  background: #5F42FF;
  color: #ffffff;
  border: none;
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  margin-top: 14px;
  transition: background 0.2s, transform 0.1s;
}

.sb-btn-save:hover {
  background: #4b30e0;
}

.sb-btn-save:active {
  transform: scale(0.98);
}
