/* ==========================================================================
   Civil Registration System (CRS) - Production Replica Stylesheet
   ========================================================================== */

:root {
  --primary-color: #234a7d;
  --primary-hover: #1b385e;
  --accent-color: #3f51b5;
  --font-family: Roboto, "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-family);
  font-size: 14px;
  color: rgba(0, 0, 0, 0.87);
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Authentic App Loading State
   ========================================================================== */
.app-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  z-index: 99999;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.app-loading.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-loading .logo {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-loading .logo img {
  width: 150px;
  height: 150px;
  object-fit: contain;
}

.app-loading .spinner {
  height: 200px;
  width: 200px;
  animation: rotate 2s linear infinite;
  transform-origin: center center;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
}

.app-loading .spinner .path {
  animation: dash 1.5s ease-in-out infinite;
  stroke-linecap: round;
  stroke: #234a7d;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash {
  0% {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -35px;
  }
  100% {
    stroke-dasharray: 89, 200;
    stroke-dashoffset: -124px;
  }
}

/* ==========================================================================
   Main Layout Container
   ========================================================================== */
._layOut {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==========================================================================
   Header & National Tricolor Ribbon
   ========================================================================== */
._header {
  position: relative;
  background: #ffffff;
  box-shadow: 0 2px 1px -1px rgba(0,0,0,.2), 0 1px 1px 0 rgba(0,0,0,.14), 0 1px 3px 0 rgba(0,0,0,.12);
  height: 64px;
  display: flex;
  align-items: center;
  z-index: 10;
  overflow: hidden;
}

.flag-bg {
  position: absolute;
  width: 100%;
  top: 0;
  height: 64px;
  overflow: hidden;
  pointer-events: none;
}

.flag-bg-left {
  position: absolute;
  top: 0;
  width: 45%;
  height: 100%;
  left: 0;
  transform: scaleX(-1);
  overflow: hidden;
}

.flag-bg-right {
  position: absolute;
  top: 0;
  width: 45%;
  height: 100%;
  right: 0;
  overflow: hidden;
}

.flag-bg-left img,
.flag-bg-right img {
  object-fit: cover;
  height: 64px;
  width: auto;
  position: absolute;
  right: 0;
}

.emblem {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 64px;
  display: flex;
  align-items: center;
  z-index: 3;
}

.emblem img {
  width: 40px;
  height: auto;
}

.header-container {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  z-index: 4;
}

.header-left {
  display: flex;
  align-items: center;
}

._logo {
  width: 320px;
  height: auto;
  position: relative;
  z-index: 1;
}

._logo_mobile {
  display: none;
}

._azadilogo {
  width: 80px;
  height: auto;
  margin-left: 1.5rem;
  position: relative;
  z-index: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.font-buttons {
  display: flex;
  gap: 3px;
  margin-right: 4px;
}

.font-buttons button {
  height: 32px !important;
  min-width: 32px !important;
  padding: 0 6px;
  line-height: 1;
  background-color: #ffffff;
  border: 1px solid #ccc;
  color: rgba(0, 0, 0, 0.87);
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.font-buttons button:hover {
  background-color: #f2f2f2;
}

.theme-ico {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  border-radius: 50%;
}

.theme-ico .material-icons {
  font-size: 24px;
}

._loginBtn {
  background: linear-gradient(to right, #7290b8, #234a7d) !important;
  color: #ffffff !important;
  border: none;
  padding: 0 16px;
  min-width: 94px;
  height: 36px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 2px 1px -1px rgba(0,0,0,.2), 0 1px 1px 0 rgba(0,0,0,.14);
}

._loginBtn .material-icons {
  font-size: 20px;
}

._loginBtn .login-mobile-icon {
  display: none;
}

/* ==========================================================================
   Navigation Bar
   ========================================================================== */
._navBar {
  background-color: #234a7d;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  list-style: none;
}

.nav-links > li > button,
.nav-links > li > a {
  background: transparent;
  border: none;
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  padding: 0 16px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  border-radius: 2px;
  transition: background-color 0.15s;
}

.nav-links > li > button:hover,
.nav-links > li > a:hover {
  background-color: rgba(0, 0, 0, .05);
}

.nav-links .material-icons {
  font-size: 20px;
}

/* ==========================================================================
   Main Content Area with Watermark Background
   ========================================================================== */
.mat-drawer-container {
  flex: 1 0 auto;
  background-color: #ffffff;
  --watermark: url('../images/crs-logo.png');
  --watermark-wash: linear-gradient(rgb(255 255 255 / 97%), rgb(255 255 255 / 97%));
  background:
    var(--watermark-wash),
    var(--watermark) left 12px top 65px / 150px no-repeat,
    var(--watermark) left 12px bottom 74px / 150px no-repeat,
    var(--watermark) 15% -174px / 215px no-repeat,
    var(--watermark) 15% 86px / 215px no-repeat,
    var(--watermark) 15% calc(100% + 7px) / 215px no-repeat,
    var(--watermark) 74% 101px / 150px no-repeat,
    var(--watermark) 74% calc(100% - 41px) / 150px no-repeat,
    var(--watermark) 92% -190px / 235px no-repeat,
    var(--watermark) 92% 63px / 235px no-repeat,
    var(--watermark) 92% calc(100% + 7px) / 235px no-repeat,
    var(--watermark) calc(100% + 150px) -180px / 235px no-repeat,
    var(--watermark) calc(100% + 150px) 118px / 235px no-repeat,
    var(--watermark) calc(100% + 150px) calc(100% + 47px) / 235px no-repeat,
    #fff;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 30px 15px 0;
}

.container {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

.col-md-6 {
  flex: 0 0 auto;
  width: 100%;
  max-width: 580px;
}

.mt-5 {
  margin-top: 2rem !important;
}

/* Exact Certificate Card */
.card {
  background: #ffffff;
  border-radius: 4px;
  border: none;
  width: 100%;
  position: relative;
}

/* Exact Table Structure */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
  font-size: 13.5px;
  border: 1px solid #dee2e6;
  background-color: #ffffff;
}

.table td {
  border: 1px solid #dee2e6;
  padding: 10px 14px;
  vertical-align: middle;
  text-align: left;
}

/* Row Stripping */
.table tr:nth-child(even) td {
  background-color: #fbfbfb;
}

.table td:first-child {
  width: 145px;
  color: #212529;
  font-weight: 400;
  line-height: 1.35;
  white-space: normal;
}

.table td:last-child {
  color: #212529;
  font-weight: 400;
  word-break: break-word;
  line-height: 1.4;
}

.text-left {
  text-align: left !important;
}

/* Direct Inline Editing */
.editable-cell {
  cursor: pointer;
  position: relative;
}


/* ==========================================================================
   Official Government Footer (Exact Radial Teal Gradient)
   ========================================================================== */
footer {
  position: static;
  bottom: 0;
  width: 100%;
  overflow-x: hidden;
}

@media (min-width: 320px) and (max-width: 767px) {
  footer {
    text-align: center;
  }
}

.bg-dark {
  color: #fff;
  background: radial-gradient(circle, #138f78 0, #234a7d 100%);
  border-top: 4px solid #ccc;
}

.pt-5 {
  padding-top: 2.2rem !important;
}

.pb-4 {
  padding-bottom: 1.5rem !important;
}

.row {
  display: flex;
  flex-wrap: wrap;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.m-0 {
  margin: 0 !important;
}

.py-2 {
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

.text-center {
  text-align: center !important;
}

.mt-2 {
  margin-top: 0.5rem !important;
}

.d-flex {
  display: flex !important;
}

.justify-content-center {
  justify-content: center !important;
}

.align-items-center {
  align-items: center !important;
}

.col-lg-12 {
  flex: 0 0 100%;
  max-width: 100%;
}

/* Row 1: Government Site Logos */
.gov-sites {
  list-style: none;
  text-align: center;
  padding: 0;
  margin: 0 0 18px 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.gov-sites li {
  display: inline-block;
  height: 32px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border-radius: 2px;
}

.css-sprite-logo-data-gov {
  background-image: url('../images/css-sprite-logo-data-gov.png') !important;
  width: 113px;
}

.css-sprite-logo-indiagov {
  background-image: url('../images/css-sprite-logo-indiagov.png') !important;
  width: 112px;
}

.css-sprite-logo-pmica {
  background-image: url('../images/css-sprite-logo-pmica.png') !important;
  width: 101px;
}

.css-sprite-logo-makeinindia {
  background-image: url('../images/css-sprite-logo-makeinindia.png') !important;
  width: 111px;
}

.css-sprite-logo-digitalindia2 {
  background-image: url('../images/css-sprite-logo-digitalindia2.png') !important;
  width: 103px;
}

.css-sprite-logo-mygov {
  background-image: url('../images/css-sprite-logo-mygov.png') !important;
  width: 108px;
}

.css-sprite-logo-iyc {
  background-image: url('../images/css-sprite-logo-iyc.png') !important;
  width: 112px;
  cursor: pointer;
}

/* Quick Links Rows with vertical pipe separator */
.quick-links {
  list-style: none;
  text-align: center;
  margin: 5px 0;
  padding: 0;
  width: 100%;
}

.quick-links li {
  display: inline-block;
  margin: 0 8px;
  position: relative;
  font-size: 11.5px;
  color: #fff;
}

.quick-links li:after {
  content: "";
  width: 1px;
  height: 12px;
  background-color: rgba(255, 255, 255, 0.7);
  position: absolute;
  right: -9px;
  top: 2px;
}

.quick-links li:last-of-type:after {
  display: none;
}

.quick-links li a,
.menu_option {
  text-decoration: none;
  color: #fff;
  cursor: pointer;
}

.quick-links li a:hover,
.menu_option:hover {
  text-decoration: underline;
}

.cursor-pointer {
  cursor: pointer;
}

footer p {
  width: 100%;
  color: #fff;
  font-size: 11.5px;
  margin: 3px 0;
  line-height: 1.35;
}

footer p.mt-2 {
  margin-top: 10px !important;
}

._rightCard {
  font-size: 11.5px;
  color: #fff;
}

footer .time-icon {
  font-size: 13.5px;
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 2px;
}

/* ==========================================================================
   Value Changing Floating Button & Modal
   ========================================================================== */
.floating-change-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #234a7d;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 9px 16px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 999;
  opacity: 0.92;
  transition: transform 0.2s, opacity 0.2s, background 0.2s;
}

.floating-change-btn:hover {
  opacity: 1;
  background: #1b3a63;
  transform: scale(1.03);
}

/* Modal Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1050;
  justify-content: center;
  align-items: center;
  padding: 15px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border-radius: 6px;
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.modal-header {
  background: #234a7d;
  color: #ffffff;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.form-grid .full-span {
  grid-column: span 2;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #495057;
  margin-bottom: 4px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-family: inherit;
  color: #212529;
  background-color: #fff;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #234a7d;
  box-shadow: 0 0 0 2px rgba(35, 74, 125, 0.2);
}

.modal-footer {
  padding: 12px 20px;
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s;
}

.btn-primary {
  background: #234a7d;
  color: #ffffff;
}

.btn-primary:hover {
  background: #1b3a63;
}

.btn-secondary {
  background: #6c757d;
  color: #ffffff;
}

.btn-outline {
  background: #ffffff;
  border: 1px solid #ced4da;
  color: #333;
}

.btn-outline:hover {
  background: #f1f3f5;
}

/* Toast Alert */
.toast-notice {
  position: fixed;
  bottom: 75px;
  right: 20px;
  background: #2e7d32;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  z-index: 2000;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast-notice.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Rules */
.nav-toggle {
  display: none;
}

@media (max-width: 1000px) {
  ._logo {
    width: 250px;
  }
  .nav-links > li > button,
  .nav-links > li > a {
    font-size: 12.5px;
    padding: 0 8px;
  }
}

@media (max-width: 768px) {
  ._logo {
    display: none;
  }
  ._logo_mobile {
    display: inline-block;
    width: 50px;
    height: auto;
  }
  .font-buttons {
    display: none;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid .full-span {
    grid-column: span 1;
  }
}

.nav-dropdown {
  position: relative;
  z-index: 11;
}

.nav-dropdown > button[aria-expanded="true"],
.nav-dropdown-panel a:hover,
.nav-dropdown-panel a:focus-visible {
  background-color: rgba(0, 0, 0, .05);
}

.nav-dropdown-panel {
  position: absolute;
  top: calc(100% - 7px);
  left: 0;
  width: max-content;
  min-width: 210px;
  max-width: min(445px, 50vw);
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .3);
}

.nav-dropdown-panel a {
  display: block;
  min-height: 48px;
  padding: 14px 16px;
  color: #212121;
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
}

@media (max-width: 768px) {
  ._header,
  .flag-bg,
  .flag-bg-left img,
  .flag-bg-right img,
  .emblem {
    height: 56px;
  }
  .flag-bg-left img,
  .flag-bg-right img {
    position: static;
  }
  ._azadilogo {
    width: clamp(49px, 16vw, 65px);
    margin-left: 10px;
  }
  .emblem img {
    width: 30px;
  }
  .header-right {
    gap: 4px;
  }
  ._loginBtn {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    box-shadow: none;
  }
  ._loginBtn .login-label,
  ._loginBtn .login-arrow {
    display: none;
  }
  ._loginBtn .login-mobile-icon {
    display: block;
    font-size: 24px;
  }
  .theme-ico .material-icons,
  ._loginBtn .material-icons,
  .nav-links .material-icons {
    flex: 0 0 1em;
    width: 1em;
    overflow: hidden;
  }
  ._navBar {
    flex-direction: column;
    align-items: stretch;
    height: auto;
  }
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #17231f;
    cursor: pointer;
  }
  .nav-toggle-icon {
    width: 18px;
    height: 2px;
    background: currentColor;
    box-shadow: 0 -5px currentColor, 0 5px currentColor;
  }
  app-header:has(.nav-toggle[aria-expanded="false"]) ._navBar {
    display: none;
  }
  .nav-links {
    flex-direction: column;
    align-items: stretch;
    padding: 0 8px 8px;
  }
  .nav-links > li > button,
  .nav-links > li > a {
    width: 100%;
    height: auto;
    min-height: 44px;
    padding: 8px;
    font-size: 14px;
    text-align: left;
  }
  .nav-dropdown-panel {
    position: static;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin-bottom: 4px;
  }
  .mat-drawer-container {
    padding: 12px 0 0;
  }
  app-validatecertificate .container {
    padding-inline: 8px;
  }
  app-validatecertificate .col-md-6.mt-5 {
    margin-top: 12px !important;
  }
  app-validatecertificate .card {
    padding: 10px !important;
  }
  app-validatecertificate .card .table td {
    padding: 6px;
  }
  app-validatecertificate .card .table td:first-child {
    width: 38%;
  }
  app-footer footer.bg-dark {
    padding: 24px 12px !important;
  }
  app-footer .gov-sites {
    gap: 12px !important;
  }
  app-footer .gov-sites li[class] {
    width: min(42vw, 140px) !important;
    height: 42px !important;
    background-size: contain !important;
  }
  app-footer .quick-links {
    gap: 8px 12px;
  }
  app-footer .quick-links li {
    margin: 0 !important;
    padding: 0 !important;
    white-space: normal !important;
  }
  app-footer .quick-links li:not(:last-child)::after {
    content: none !important;
  }
}
