/* === BASE === */
body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background-color: #ecfdf5;
  color: #0f172a;
  overflow-x: hidden;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* === MAIN LAYOUT === */
.main-container {
  display: flex;
  margin-top: 0;
}

/* === SIDEBAR === */
.sidebar {
  width: 240px;
  background-color: #10b981;
  padding: 20px 16px;
  height: 100vh;
  position: sticky;
  top: 80px;
  overflow-y: auto;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
  z-index: 999;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar ul li { margin-bottom: 12px; }
.sidebar ul li a {
  color: white;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  padding: 10px 14px;
  display: block;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}
.sidebar ul li a:hover { background-color: #059669; }
.sidebar-title {
  color: white;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  padding-left: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* === SERVICES AREA === */
.services-container {
  flex: 1;
  padding: 30px 40px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

.services-container h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
  color: #1e293b;
}

/* 🌟 Fluid grid */
.service-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.service-item {
  background-color: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: start;
  text-align: center;
  min-height: 260px;
  transition: transform 0.2s ease;
}
.service-item:hover { transform: translateY(-4px); }
.service-item h3 {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === BADGES === */
.sub-services {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  margin-top: auto;
  margin-bottom: 12px;
  justify-items: center;
}

.job-badge {
  background-color: #d1fae5;
  color: #065f46;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;

  width: 100%;
  max-width: 100%;
  height: 84px;

  display: flex;
  align-items: center;
  justify-content: center;
  white-space: normal;
  overflow-wrap: break-word;
  padding: 8px;
  line-height: 1.3;
  box-sizing: border-box;
}
.job-badge:hover {
  background-color: #bbf7d0;
  transform: scale(1.04);
}

.view-more-btn {
  grid-column: 2 / 3;
  justify-self: end;
  padding: 6px 12px;
  font-size: 13px;
  background-color: #e2e8f0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-top: 8px;
}
.view-more-btn:hover { background-color: #cbd5e1; }

/* === MODAL (base) === */
.modal {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}
.modal-content {
  background: white;
  width: 90%;
  max-width: 500px;
  border-radius: 12px;
  padding: 24px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.modal-content h2 {
  margin-top: 0;
  font-size: 20px;
  font-weight: 600;
}
.modal-meta {
  margin-top: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.modal-description {
  margin-bottom: 16px;
  font-size: 15px;
  color: #475569;
}
.modal .close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  font-size: 22px;
  color: #475569;
  cursor: pointer;
}
.btn-primary {
  background-color: #10b981;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.btn-primary:hover { background-color: #059669; }

/* === TAB TOGGLE BUTTON === */
.sidebar-tab {
  display: none;
  position: fixed;
  top: 80px;
  left: 0;
  background-color: #10b981;
  color: white;
  padding: 10px 14px;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  z-index: 10000;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}

/* === MOBILE STYLES === */
@media screen and (max-width: 1025px) {
  .main-container {
    flex-direction: column;
    margin-top: 60px;
  }

  .sidebar-tab {
    display: block;
    top: 103.5px;
    width: auto;
    height: auto;
  }

  .sidebar {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 240px;
    height: 100%;
    background-color: #10b981;
    padding: 20px 16px;
    overflow-y: auto;
    transition: left 0.3s ease;
    z-index: 9999;
  }

  .sidebar.open { left: 0; }
  body.sidebar-open { overflow: hidden; }

  .services-container { padding: 20px; }
  .service-item { padding: 16px; }

  /* scope to service details modal only */
  #serviceModal .modal-content {
    width: 60%;
    padding: 18px;
  }
}

/* Login Modal */
.login-modal-box {
  max-width: 600px;
  height: auto;
  padding: 0;
  overflow: hidden;
}

#loginModal iframe {
  display: block;
  width: 100%;
  border: 0;
  overflow: hidden;
}

/* === EXTRA SMALL MOBILE STYLES (≤ 480px) === */
@media screen and (max-width: 480px) {
  .main-container {
    margin-top: 60px;
    padding: 0 12px;
  }

  .sidebar { width: 200px; padding: 16px 12px; }
  .sidebar-tab { top: 95px; }
  .services-container { padding: 16px 12px; }

  .service-item {
    padding: 12px;
    font-size: 14px;
  }

  /* service modal only */
  #serviceModal .modal-content {
    width: 90%;
    padding: 14px;
  }
}

/* === Login modal: no inner scrollbars & perfect centering === */
#loginModal{
  display: none;
  position: fixed;
  inset: 0;
  /* dynamic viewport height fixes mobile centering */
  height: 100dvh;
  min-height: 100dvh;
  /* center content */
  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0,0,0,.35);
  z-index: 9999;

  /* safe-area padding for notches */
  padding: max(16px, env(safe-area-inset-top))
           max(16px, env(safe-area-inset-right))
           max(16px, env(safe-area-inset-bottom))
           max(16px, env(safe-area-inset-left));
}
@supports not (height: 100dvh) {
  #loginModal { height: 100vh; min-height: 100vh; }
}

#loginModal .modal-content{
  width: min(520px, 92vw);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  overflow: visible;      /* kill inner scrolling */
  max-height: none;       /* remove any caps */
  margin: 0;              /* ensure true centering */
}

#loginModal .login-modal-box{ padding: 0; }
#loginModal .modal-content{ scrollbar-width: none; }
#loginModal .modal-content::-webkit-scrollbar{ display: none; }
