body {
  font-family: 'Tajawal', 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  background: #f5f5f5;
  color: #333;
  text-align: center;
}

header {
  background-color: #00A76F;
  color: white;
  padding: 1rem;
  position: relative;
  text-align: center;
  direction: ltr;
}

header img.logo {
  width: 120px;
  margin: 0 auto;
  display: block;
  border-radius: 12px;
}

.lang-switch {
  position: absolute;
  top: 10px;
  right: 20px;
  background: white;
  border-radius: 20px;
  padding: 3px;
  display: flex;
  width: 80px;
  height: 30px;
  box-shadow: inset 0 0 4px rgba(0,0,0,0.15);
  direction: ltr;
}

.lang-switch button {
  flex: 1;
  border: none;
  background: transparent;
  color: #00A76F;
  font-weight: bold;
  font-size: 14px;
  border-radius: 16px;
  transition: background 0.2s, color 0.2s;
}

.lang-switch button.active {
  background: #00A76F;
  color: white;
}

.tabs {
  margin-top: 1rem;
  direction: ltr;
}

.tabs button {
  padding: 10px 20px;
  margin: 0 10px;
  border: none;
  background: #ddd;
  cursor: pointer;
  font-weight: bold;
  border-radius: 6px;
}

.tabs button.active {
  background: #00A76F;
  color: white;
}

.form-section {
  display: none;
  margin: 2rem auto;
  padding: 2rem;
  max-width: 500px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  text-align: left;
  box-sizing: border-box;
}

.form-section.active {
  display: block;
}

body[dir="rtl"] .form-section label {
  text-align: right;
  direction: rtl;
}

label {
  display: block;
  margin-top: 1rem;
}

input, select {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.25rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
}

input[type="checkbox"] {
  width: auto;
  margin-right: 10px;
}

.submit-btn {
  background: #00A76F;
  color: white;
  border: none;
  padding: 1rem;
  width: 100%;
  margin-top: 1.5rem;
  cursor: pointer;
  font-size: 1rem;
  border-radius: 6px;
}

.datetime-group {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.datetime-group input[type="date"],
.datetime-group select {
  width: 50%;
}

footer {
  background-color: #00A76F;
  color: white;
  padding: 1rem;
  text-align: center;
  margin-top: 2rem;
}

footer .footer-content {
  direction: ltr;
  text-align: center;
}

footer .socials {
  margin-top: 0.5rem;
}

footer .socials a {
  margin: 0 8px;
  display: inline-block;
}

footer .socials i {
  color: white;
  font-size: 24px;
}

@media (max-width: 600px) {
  .form-section {
    margin: 2rem 1rem;
  }
}

/* Autocomplete */
.autocomplete-suggestions {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  max-height: 150px;
  overflow-y: auto;
  position: absolute;
  width: calc(100% - 40px);
  z-index: 1000;
  font-size: 14px;
}

.suggestion-item {
  padding: 8px 10px;
  cursor: pointer;
}

.suggestion-item:hover {
  background-color: #f2f2f2;
}

/* OTP Modal Styling */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  font-family: 'Poppins', sans-serif;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #fff;
  padding: 30px 25px;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  position: relative;
  margin: 0 auto;
  direction: ltr;
}

.modal-content h2 {
  font-size: 22px;
  margin-bottom: 10px;
  color: #00A76F;
}

.modal-content p {
  font-size: 16px;
  margin-bottom: 20px;
}

.otp-inputs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.otp-inputs input {
  width: 40px;
  height: 50px;
  font-size: 24px;
  text-align: center;
  border: 2px solid #ddd;
  border-radius: 8px;
  outline: none;
  transition: border 0.2s;
}

.otp-inputs input:focus {
  border-color: #00A76F;
}

.otp-buttons {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 15px;
}

.otp-buttons button {
  flex: 1;
  padding: 12px 0;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.otp-buttons button:first-child {
  background-color: #00A76F;
  color: white;
}

.otp-buttons button:last-child {
  background-color: #ccc;
  color: #333;
}

.otp-buttons button:disabled {
  background-color: #eee;
  color: #999;
  cursor: not-allowed;
}

.cancel-otp {
  font-size: 14px;
  color: #777;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 10px;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 20px;
  cursor: pointer;
  color: #999;
}

.close-btn:hover {
  color: #00A76F;
}

@media (max-width: 400px) {
  .otp-inputs input {
    width: 36px;
    height: 46px;
    font-size: 20px;
  }
}

/* === Address Management === */
.addresses-section {
  max-width: 600px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  text-align: left;
}

.addresses-section h2 {
  margin-bottom: 1rem;
  font-size: 20px;
  color: #00A76F;
}

.address-item {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px 15px;
  margin-bottom: 1rem;
  background-color: #fafafa;
  position: relative;
}

.address-item p {
  margin: 4px 0;
}

.address-item .label {
  font-weight: bold;
  color: #00A76F;
}

.address-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.address-actions button {
  background-color: #00A76F;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
}

.address-actions button.delete-btn {
  background-color: #e74c3c;
}

.add-address-form {
  margin-top: 2rem;
  border-top: 1px solid #eee;
  padding-top: 1rem;
}

.add-address-form input,
.add-address-form select {
  width: 100%;
  padding: 10px;
  margin-bottom: 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

.add-address-form button {
  background-color: #00A76F;
  color: white;
  border: none;
  padding: 10px;
  width: 100%;
  font-size: 16px;
  border-radius: 6px;
  cursor: pointer;
}

body.rtl .addresses-section,
body.rtl .address-item {
  text-align: right;
}

/* === Dashboard Layout === */
.dashboard-container {
  display: flex;
  min-height: calc(100vh - 140px); /* Adjusting for header and footer height */
  background: #f9f9f9;
  font-family: 'Tajawal', 'Poppins', sans-serif;
}

.sidebar {
  width: 240px;
  background-color: #00A76F;
  color: white;
  padding: 1.5rem 1rem;
  box-shadow: 2px 0 6px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sidebar h3 {
  font-size: 20px;
  margin-bottom: 1.5rem;
  text-align: center;
}

.sidebar ul {
  list-style: none;
  padding: 0;
}

.sidebar ul li {
  margin: 0.75rem 0;
}

.sidebar ul li button {
  background: transparent;
  border: none;
  color: white;
  font-size: 16px;
  text-align: left;
  width: 100%;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background 0.2s;
}

.sidebar ul li button:hover,
.sidebar ul li button.active {
  background-color: rgba(255, 255, 255, 0.15);
}

.dashboard-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .dashboard-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: row;
    justify-content: space-around;
    padding: 1rem;
    box-shadow: none;
  }

  .sidebar h3 {
    display: none;
  }

  .sidebar ul {
    display: flex;
    justify-content: space-between;
    width: 100%;
  }

  .sidebar ul li {
    margin: 0;
  }

  .sidebar ul li button {
    text-align: center;
    padding: 10px;
    font-size: 14px;
  }

  .dashboard-content {
    padding: 1rem;
  }
}

/* RTL support */
body[dir="rtl"] .dashboard-container {
  flex-direction: row-reverse;
}

body[dir="rtl"] .sidebar ul li button {
  text-align: right;
}
