/* Reset default margins and ensure full viewport coverage */
html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  width: 100vw;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Content container */
.content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  padding: 20px;
  overflow-x: hidden;
}

/* Online form wrapper */
/* RQ2 Change: Ensured form is centered with margin: 0 auto */
.online-wrapper {
  width: 100%;
  max-width: 468px;
  box-sizing: border-box;
  margin: 0 auto; /* Center the form horizontally */
}

/* Online form box */
.online-box {
  background-color: #ffffff;
  padding: 20px 25px;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Form fields container */
.online-form-div {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Navbar styling */
/* RQ2 Change: Simplified to center brand, used relative positioning */
/* RQ3 Change: Restored original padding of 30px for navbar height */
/* RQ4 Change: Removed fixed height, added safe-area-inset-top for iOS */
/* RQ5 Change: Used row-based Flexbox for desktop to match original height */
/* RQ6 Change: Used absolute positioning for brand and actions to center brand with form */
.navbar {
  background-color: #212121;
 /* padding: 30px; *//* Restored original padding */
/*  padding-top: calc(30px + env(safe-area-inset-top));*/ /* Account for iOS safe area */
  display: flex;
  flex-direction: column; /* Use column to avoid row interference */
  align-items: center;
  position: relative;
  overflow: hidden;
  min-height: 85px; /* Ensure height matches original (~40px logos + 60px padding) */
}

/* Navbar brand (logos) */
/* RQ2 Change: Centered brand absolutely relative to navbar */
/* RQ5 Change: Removed absolute positioning, centered with flex */
/* RQ6 Change: Restored absolute positioning to center with form */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 15px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%); /* Center horizontally relative to page */
  top: 50%;
  transform: translate(-50%, -50%); /* Center vertically and horizontally */
  z-index: 1; /* Ensure above other elements */
}

  .navbar-brand img {
    height: 40px;
    object-fit: contain;
  }

  .navbar-brand div {
    color: white;
    font-size: 24px;
  }

/* Navbar actions (WhatsApp, phone, langToggle) */
/* RQ2 Change: Positioned absolutely on right for desktop */
/* RQ5 Change: Removed absolute positioning, aligned with flex */
/* RQ6 Change: Restored absolute positioning for right alignment */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  position: absolute;
  right: 30px; /* Match navbar padding */
  top: 50%;
  transform: translateY(-50%); /* Vertically center */
}

/* RTL mode for Arabic */
/* RQ2 Change: Adjusted for RTL to position actions on left */
/* RQ6 Change: Ensured RTL compatibility with absolute positioning */
.rtl .navbar-actions {
  direction: rtl;
  right: auto;
  left: 30px; /* Match navbar padding */
}

/* Icons and phone styling */
.icon-link i,
.phone i {
  color: white;
  font-size: 20px;
}

.phone {
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

/* Language toggle button */
#langToggle {
  background-color: inherit;
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: bold;
  color: white;
}

/* Tabs container */
.tabs {
  background-color: #f5f5f5;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  flex-wrap: wrap; /* Allow tabs to wrap on small screens */
}

/* Individual tabs */
.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  color: #000;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  transition: none;
}

  .tab i {
    font-size: 16px;
  }

  .tab.active::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #f5a712;
  }

/* Form title */
.online-title {
  margin-bottom: 30px !important;
  color: rgb(33, 37, 41);
  font-size: 20px;
  font-weight: 500;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans Arabic", Arial, sans-serif;
  text-align: center;
}

.online-title-next {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans Arabic", Arial, sans-serif;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.5;
  padding: 20px 0px 5px 0px;
}

.rtl .online-title-next {
  text-align: center;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans Arabic", Arial, sans-serif;
  font-size: 14px;
}

/* Form inputs */
.dropdownlist,
.textbox,
.textarea,
.checkbox {
  width: 100%;
  box-sizing: border-box;
  font-weight: 500;
  font-size: 14px;
  color: #525252;
  font-family: verdana, helvetica;
  padding: 8px 0;
  outline: none;
  border: none;
  border-bottom: #aaaaaa 1.5px solid;
  background-color: #ffffff;
}

/* Increase font size in Arabic mode */
.rtl .dropdownlist,
.rtl .textbox,
.rtl .textarea,
.rtl .checkbox {
  font-size: 14px;
}

.rtl .commonStyleBox {
  font-size: 16px;
}

.dropdownlist:-webkit-autofill,
.textbox:-webkit-autofill,
.textarea:-webkit-autofill,
.checkbox:-webkit-autofill {
  background-color: #ffffff !important;
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
}

.dropdownlist:focus,
.textbox:focus,
.textarea:focus {
  border-bottom: 2px solid #d86018;
}

/* Label focus state */
.LabelFocus {
  color: #d86018 !important;
}

/* Error state */
.error {
  border-bottom: 1.5px solid #f44336 !important;
}

/* Textarea */
.textarea {
  resize: vertical;
  min-height: 80px;
}

/* Form labels */
label {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans Arabic", Arial, sans-serif;
  color: #666 !important;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 5px;
  transition: color 0.2s ease;
  opacity: 1;
}

/* Increase label font size in Arabic mode */
.rtl label {
  font-size: 14px;
  font-weight: 700;
}

/* Error label */
.error-label {
  color: #f44336 !important;
}

/* Checkbox label */
.checkbox-label {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans Arabic", Arial, sans-serif;
  color: #212529;
  font-size: 13px;
  margin-left: 5px;
  vertical-align: middle;
  transition: color 0.2s ease;
}

/* Increase checkbox label font size in Arabic mode */
.rtl .checkbox-label {
  font-size: 13px;
}

/* Submit button */
.submit-button {
  padding: 12px;
  background-color: #f08c20;
  width: 100%;
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  font-size: 14px;
  transition: background-color 0.3s ease;
  margin-top: 20px;
}

/* Error message */
.error-message {
  color: red;
  font-size: 12px;
}

/* Navbar text */
.nav-text {
  font-family: Montserrat, Arial, Verdana, Helvetica, sans-serif;
  font-size: .875rem;
  font-weight: 400;
  color: #fff;
}

/* Text paragraph */
.textPara {
  max-width: 100%;
  overflow-wrap: break-word;
  font-size: 13px;
  color: #666;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans Arabic", Arial, sans-serif;
}

/* Thank you container */
.thank-you-container {
  max-width: 600px;
  margin: 50px auto;
  text-align: center;
  font-family: Arial, sans-serif;
}

/* Thank you title */
.thank-you-title {
  font-size: 22px;
  color: #d86018;
  margin-bottom: 20px;
}

/* Thank you message */
.thank-you-message {
  font-size: 15px;
  color: #212529;
  margin-bottom: 20px;
}

/* Home button */
.home-button {
  background-color: #d86018;
  color: white;
  padding: 10px 20px;
  border: none;
  text-decoration: none;
  font-size: 15px;
}

/* Responsive design for mobile */
/* RQ2 Change: Stacked navbar, centered brand and form */
/* RQ3 Change: Adjusted mobile padding to maintain height aesthetic */
/* RQ4 Change: Removed fixed height, optimized for all mobile devices */
@media (max-width: 767px) {
  .content {
    padding: 10px;
  }

  .online-wrapper {
    max-width: 100%;
    padding: 0;
    margin: 0 auto; /* Ensure form stays centered */
  }

  .online-box {
    padding: 15px;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
  }

  .online-title {
    font-size: 18px;
    text-align: center;
  }

  .online-form-div > div {
    margin-bottom: 12px;
  }

  .submit-button {
    width: 100%;
    padding: 12px;
    font-size: 14px;
  }

  .checkbox-label {
    font-size: 13px;
  }

  .rtl .checkbox-label {
    font-size: 14px;
  }

  .textPara span {
    font-size: 12px;
    display: block;
    text-align: center;
  }

  /* Navbar for mobile */
  .navbar {
    padding: 15px; /* Balanced padding for mobile */
    padding-top: calc(15px + env(safe-area-inset-top)); /* iOS safe area */
    flex-direction: column;
    align-items: center;
    min-height: auto; /* Reset min-height for mobile */
  }

  .navbar-brand {
    position: static; /* Remove absolute positioning */
    transform: none; /* Reset transform */
    margin-bottom: 10px; /* Space below brand */
  }

    .navbar-brand img {
      height: 30px; /* Smaller logos on mobile */
    }

  .navbar-actions {
    position: static; /* Remove absolute positioning */
    transform: none; /* Reset transform */
    gap: 10px;
    justify-content: center; /* Center actions */
    flex-wrap: wrap; /* Allow wrapping */
  }

  /* Tabs for mobile */
  .tabs {
    gap: 5px;
    padding: 8px;
    justify-content: flex-start;
    overflow-x: auto; /* Allow horizontal scrolling if needed */
  }

  .tab {
    font-size: 12px;
    padding: 8px 12px;
  }

    .tab i {
      font-size: 14px;
    }

  /* Form inputs */
  .dropdownlist,
  .textbox,
  .textarea {
    font-size: 14px;
    padding: 10px 0; /* Increased padding for touch */
  }

  .textarea {
    min-height: 70px;
  }

  label {
    font-size: 13px;
  }

  .rtl label {
    font-size: 14px;
  }

  /* Datepicker for mobile */
  .ui-datepicker {
    width: 100%;
    max-width: 280px;
    font-size: 13px;
  }
}

/* Zero margin bottom */
.margin-bottom-zero {
  margin-bottom: 0px !important;
}

/* RTL support for Arabic */
.rtl {
  direction: rtl;
  text-align: right;
}

  .rtl .online-form-div label,
  .rtl .checkbox-label,
  .rtl .textPara,
  .rtl .thank-you-title,
  .rtl .thank-you-message {
    text-align: right;
  }

  .rtl .online-title {
    text-align: center;
  }

  .rtl .online-form-div .submit-button {
    font-size: 14px;
    font-weight: 700;
  }

/* Datepicker */
.ui-datepicker {
  font-family: 'Noto Sans Arabic', sans-serif;
  font-size: 14px;
  width: 250px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
}

.ui-datepicker-header {
  background: #d86018;
  color: #fff;
  border-radius: 4px 4px 0 0;
}

.ui-datepicker-calendar td a {
  text-align: center;
  color: #333;
}

  .ui-datepicker-calendar td a.ui-state-active {
    background: #d86018;
    color: #fff;
  }

.rtl .ui-datepicker {
  direction: rtl;
}
