:root {
  /* Official DZDS.DZ Palette extracted directly from official portal */
  --dz-teal-dark: #093b49;
  --dz-teal: #0c5c75;
  --dz-teal-medium: #117a94;
  --dz-teal-light: #2099b5;
  --dz-teal-btn: #0c7287;
  --dz-teal-btn-hover: #084f5e;
  --dz-teal-badge: #e0f2fe;
  --dz-teal-border: #cde6ed;
  --dz-yellow-btn: #b9935a;
  --dz-yellow-hover: #9c7b48;
  
  --dz-bg-body: #f8fafc;
  --dz-bg-card: #f0f7f9;
  --dz-card-border: #d4e7ed;
  --dz-dark: #0f172a;
  --dz-gray-text: #475569;
  --dz-gray-light: #64748b;
  --dz-border-color: #e2e8f0;
  
  --dz-radius: 14px;
  --dz-radius-pill: 50px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Cairo', 'Tajawal', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--dz-bg-body);
  color: #1e293b;
  line-height: 1.65;
  width: 100%;
  position: relative;
}

img, svg, video, canvas, audio, iframe, embed, object {
  max-width: 100%;
  height: auto;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: var(--dz-teal-light);
  border-radius: 4px;
}

/* Disclaimer Top Bar */
.disclaimer-top-bar {
  background: #062832;
  color: #f1f5f9;
  font-size: 0.82rem;
  padding: 8px 0;
  border-bottom: 2px solid var(--dz-teal-light);
  line-height: 1.5;
}
.disclaimer-top-bar a {
  color: #38bdf8;
  font-weight: 700;
  text-decoration: underline;
}

/* Inner Navigation Header */
.bg-dzds-header {
  background: linear-gradient(135deg, #093b49, #0c5c75);
  border-bottom: 3px solid var(--dz-teal-light);
}

/* Clean Horizontal Compact Header */
.service-detail-compact-header {
  background: #ffffff;
  border-bottom: 1px solid var(--dz-border-color);
}
.service-compact-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #e6f4f8;
  color: var(--dz-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  border: 1px solid #cbe4eb;
}
.service-compact-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--dz-dark);
  line-height: 1.2;
}

/* Hero & Header Section */
.dzds-hero-header {
  background: linear-gradient(135deg, rgba(9, 59, 73, 0.96), rgba(12, 92, 117, 0.94)), 
              radial-gradient(circle at center, #117a94 0%, #062832 100%);
  background-size: cover;
  background-position: center;
  color: #ffffff;
  padding: 20px 0 45px 0;
  position: relative;
  border-bottom: 3px solid var(--dz-teal-light);
}

/* Logo Group */
.official-logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #ffffff;
  flex-shrink: 0;
}
.official-logo-symbol {
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

/* Menu Pill Buttons */
.official-menu-pill-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 8px 18px;
  border-radius: var(--dz-radius-pill);
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.official-menu-pill-btn:hover, .official-menu-pill-btn.active {
  background: var(--dz-teal-light);
  border-color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-portal-entry {
  background: var(--dz-teal-btn);
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--dz-radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 18px;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-portal-entry:hover {
  background: var(--dz-teal-btn-hover);
  color: #fff !important;
}

/* Hero Typography & Search */
.hero-headline {
  font-size: clamp(1.4rem, 4vw, 2.3rem);
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 8px;
  line-height: 1.3;
}
.hero-subheadline {
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  color: #e0f2fe;
  margin-bottom: 25px;
  line-height: 1.5;
}

/* Official DZDS Search Card */
.dzds-search-wrapper {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}
.dzds-search-input-group {
  background: #ffffff;
  border-radius: var(--dz-radius-pill);
  padding: 5px 6px 5px 14px;
  display: flex;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  width: 100%;
}
.dzds-search-input {
  border: none !important;
  box-shadow: none !important;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  padding: 8px 12px;
  background: transparent;
  flex: 1 1 auto;
  min-width: 0;
}
.dzds-search-input::placeholder {
  color: #94a3b8;
  font-size: 0.88rem;
}
.dzds-search-btn {
  background: var(--dz-teal);
  color: #ffffff;
  border: none;
  border-radius: var(--dz-radius-pill);
  padding: 8px 20px;
  font-weight: 700;
  font-size: 0.9rem;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}
.dzds-search-btn:hover {
  background: var(--dz-teal-dark);
}

.search-mini-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.search-mini-pill {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-radius: var(--dz-radius-pill);
  padding: 4px 11px;
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.search-mini-pill:hover {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}

/* Section Title */
.dzds-section-title {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 900;
  color: var(--dz-teal);
  text-align: center;
  margin-bottom: 24px;
}

/* Service Card Styles */
.official-service-card {
  background: #ffffff;
  border: 1px solid var(--dz-card-border);
  border-radius: var(--dz-radius);
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(12, 92, 117, 0.04);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.official-service-card:hover {
  transform: translateY(-4px);
  border-color: var(--dz-teal-medium);
  box-shadow: 0 12px 28px rgba(12, 92, 117, 0.12);
}

.official-card-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 6px;
}
.official-sector-badge {
  background: #e6f4f8;
  color: var(--dz-teal);
  border: 1px solid #cce6ee;
  border-radius: var(--dz-radius-pill);
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.official-time-meta {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
}

.official-service-heading {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--dz-teal-dark);
  margin-bottom: 8px;
  line-height: 1.4;
  word-break: break-word;
}
.official-service-heading a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
.official-service-heading a:hover {
  color: var(--dz-teal-light);
}

.official-service-ministry {
  font-size: 0.82rem;
  color: var(--dz-teal-btn);
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  word-break: break-word;
}

.official-service-desc {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 18px;
  flex-grow: 1;
  word-break: break-word;
}

.official-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid #edf2f7;
  gap: 8px;
  flex-wrap: wrap;
}
.official-fee-tag {
  color: #059669;
  font-weight: 700;
  font-size: 0.82rem;
}

.btn-dz-details {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: var(--dz-radius-pill);
  text-decoration: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
}
.btn-dz-details:hover {
  background: var(--dz-teal);
  color: #fff;
  border-color: var(--dz-teal);
}

.btn-dz-official-direct {
  background: linear-gradient(135deg, var(--dz-teal), var(--dz-teal-dark));
  color: #fff !important;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 16px;
  border-radius: var(--dz-radius-pill);
  text-decoration: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  white-space: nowrap;
}
.btn-dz-official-direct:hover {
  background: linear-gradient(135deg, var(--dz-teal-light), var(--dz-teal));
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(12, 92, 117, 0.3);
}

/* Most Requested Services (Home Folder Icons) */
.requested-service-card {
  background: #f1f7f9;
  border: 1px solid #d4e7ed;
  border-radius: var(--dz-radius);
  padding: 12px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--dz-dark);
  transition: all 0.25s ease;
  height: 100%;
}
.requested-service-card:hover {
  background: #ffffff;
  border-color: var(--dz-teal);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(12, 92, 117, 0.12);
}
.requested-icon-box {
  width: 38px;
  height: 38px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid #cbe4eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--dz-teal);
  flex-shrink: 0;
}
.requested-title-text {
  font-size: 0.8rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.3;
}

/* Life Events Cards */
.life-event-card {
  position: relative;
  border-radius: var(--dz-radius);
  overflow: hidden;
  height: 180px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  display: block;
  text-decoration: none;
  transition: transform 0.3s ease;
}
.life-event-card:hover {
  transform: translateY(-4px);
}
.life-event-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.life-event-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.15) 60%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}
.life-event-badge {
  background: rgba(12, 92, 117, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 6px 18px;
  border-radius: var(--dz-radius-pill);
  backdrop-filter: blur(4px);
}

/* Category Grid Cards */
.cat-official-card {
  background: #f1f7f9;
  border: 1px solid #d4e7ed;
  border-radius: var(--dz-radius);
  padding: 18px;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}
.cat-official-card:hover {
  background: #ffffff;
  border-color: var(--dz-teal);
  box-shadow: 0 10px 25px rgba(12, 92, 117, 0.12);
  transform: translateY(-4px);
}
.cat-official-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.cat-official-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--dz-teal);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.cat-official-title {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  word-break: break-word;
}

/* Assisted Guidance */
.assisted-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--dz-radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  height: 100%;
}
.assisted-card-img {
  width: 45%;
  height: 170px;
  object-fit: cover;
  flex-shrink: 0;
}
.assisted-card-body {
  width: 55%;
  padding: 18px;
}

/* Mobile App Banner */
.mobile-app-banner {
  background: linear-gradient(135deg, #e6f6f9 0%, #f0f9fb 100%);
  border: 1px solid #cbe9f1;
  border-radius: 20px;
}

/* Footer */
.dzds-footer {
  background: #072a34;
  color: #cbd5e1;
  padding: 45px 0 20px 0;
  border-top: 4px solid var(--dz-teal);
}
.dzds-footer a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
}
.dzds-footer a:hover {
  color: #ffffff;
}

/* Admin Elements */
.admin-sidebar {
  background: #072a34;
  min-height: 100vh;
  color: #cbd5e1;
}
.admin-sidebar .nav-link {
  color: #94a3b8 !important;
  padding: 12px 18px !important;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: all 0.2s;
}
.admin-sidebar .nav-link:hover, .admin-sidebar .nav-link.active {
  background: var(--dz-teal) !important;
  color: #ffffff !important;
}

/* ==========================================================================
   Comprehensive Responsive Breakpoints (Mobile, Tablet, Desktop)
   ========================================================================== */

/* Large Tablets & Small Desktops (max-width: 991.98px) */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background: rgba(6, 40, 50, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin-top: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
  }
  .navbar-nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 12px;
  }
  .navbar-nav .nav-item {
    width: 100%;
    margin-bottom: 8px;
  }
  .official-menu-pill-btn {
    display: block;
    width: 100%;
    border-radius: 10px;
    padding: 10px 16px;
    text-align: right;
  }
  .btn-portal-entry {
    width: 100%;
    text-align: center;
    border-radius: 10px;
    padding: 10px 16px;
  }
  .assisted-card {
    flex-direction: column-reverse !important;
    height: auto !important;
  }
  .assisted-card-body, .assisted-card-img {
    width: 100% !important;
  }
  .assisted-card-img {
    height: 180px !important;
  }
  .admin-sidebar {
    min-height: auto;
    border-bottom: 1px solid #1e3a47;
    margin-bottom: 15px;
  }
  .admin-sidebar .nav {
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 6px;
  }
  .admin-sidebar .nav-item {
    flex: 1 1 auto;
    min-width: 140px;
  }
  .admin-sidebar .nav-link {
    font-size: 0.85rem;
    padding: 8px 12px !important;
    text-align: center;
  }
  .sticky-top {
    position: static !important;
    top: auto !important;
  }
}

/* Medium Tablets & Phablets (max-width: 767.98px) */
@media (max-width: 767.98px) {
  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .py-5 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
  .py-4 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }
  .my-4, .mb-4 {
    margin-bottom: 0.85rem !important;
  }
  .mb-5 {
    margin-bottom: 1.25rem !important;
  }
  .p-4, .p-md-5 {
    padding: 14px !important;
  }
  .card {
    border-radius: 12px !important;
    margin-bottom: 12px !important;
  }
  .disclaimer-top-bar {
    text-align: center;
    font-size: 0.74rem;
    padding: 5px 0;
  }
  .disclaimer-top-bar .container {
    flex-direction: column;
    gap: 3px !important;
  }
  .dzds-hero-header {
    padding: 12px 0 24px 0 !important;
  }
  .official-service-card {
    padding: 12px !important;
    border-radius: 12px !important;
  }
  .official-card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 10px !important;
  }
  .official-card-footer .d-flex {
    width: 100%;
    justify-content: space-between;
  }
  .official-card-footer .btn-dz-details, 
  .official-card-footer .btn-dz-official-direct {
    flex: 1;
    text-align: center;
  }
  .life-event-card {
    height: 120px !important;
    padding: 10px !important;
  }
  .mobile-app-banner {
    padding: 14px !important;
  }
  .dzds-footer {
    padding: 25px 0 15px 0 !important;
  }
}

/* Small Phones (max-width: 575.98px) */
@media (max-width: 575.98px) {
  .container {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  .py-5 {
    padding-top: 1.2rem !important;
    padding-bottom: 1.2rem !important;
  }
  .py-4 {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
  }
  .p-4, .p-md-5 {
    padding: 12px !important;
  }
  .g-4 {
    --bs-gutter-y: 0.75rem !important;
    --bs-gutter-x: 0.75rem !important;
  }
  .g-3 {
    --bs-gutter-y: 0.5rem !important;
    --bs-gutter-x: 0.5rem !important;
  }
  .dzds-search-input-group {
    padding: 3px 4px 3px 8px;
  }
  .dzds-search-input {
    font-size: 0.82rem;
    padding: 5px 6px;
  }
  .dzds-search-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  .search-mini-tags {
    gap: 3px;
    margin-top: 8px !important;
  }
  .search-mini-pill {
    font-size: 0.7rem;
    padding: 2px 7px;
  }
  .requested-service-card {
    padding: 8px 6px;
    gap: 6px;
    border-radius: 10px;
  }
  .requested-icon-box {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
    border-radius: 6px;
  }
  .requested-title-text {
    font-size: 0.72rem;
  }
  .cat-official-card {
    padding: 10px;
    border-radius: 10px;
  }
  .cat-official-icon {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
    border-radius: 8px;
  }
  .official-sector-badge {
    font-size: 0.68rem;
    padding: 2px 6px;
  }
  .btn-dz-details, .btn-dz-official-direct {
    font-size: 0.75rem;
    padding: 5px 8px;
  }
  .service-compact-title {
    font-size: 1.05rem;
    line-height: 1.3;
  }
  .service-compact-icon {
    width: 34px;
    height: 34px;
    font-size: 1rem;
    border-radius: 8px;
  }
  .breadcrumb {
    font-size: 0.72rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem !important;
  }
  .accordion-button {
    padding: 9px 12px !important;
    font-size: 0.82rem !important;
  }
  .accordion-body {
    padding: 10px 12px !important;
    font-size: 0.8rem !important;
  }
  .service-list li {
    padding: 5px 0 !important;
    font-size: 0.82rem !important;
  }
  .fs-4 {
    font-size: 1.15rem !important;
  }
  .fs-5 {
    font-size: 1rem !important;
  }
  .fs-2 {
    font-size: 1.3rem !important;
  }
  .alert {
    padding: 10px 12px !important;
    border-radius: 10px !important;
    margin-bottom: 10px !important;
  }
}

