/* ====================================
   CRS Exact Clone - Matching Original Source
   ==================================== */

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

body, html {
  min-height: 100%;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  font-family: Roboto, "Helvetica Neue", sans-serif;
}

body {
  background: #ffffff;
  color: rgba(0,0,0,.87);
}

/* ============ HEADER ============ */
._header .mat-toolbar {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 64px;
  height: 64px;
  padding: 0;
  background: #fff;
  overflow: hidden;
}

/* Flag background */
._header .flag-bg {
  position: absolute;
  width: 100%;
  top: 0;
  height: 64px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

._header .flag-bg .flag-bg-left {
  left: 0;
  transform: scaleX(-1);
}

._header .flag-bg .flag-bg-right {
  right: 0;
}

._header .flag-bg .flag-bg-left,
._header .flag-bg .flag-bg-right {
  position: absolute;
  top: 0;
  width: 45%;
  height: 100%;
}

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

@media screen and (max-width: 1440px) {
  ._header .flag-bg .flag-bg-left img,
  ._header .flag-bg .flag-bg-right img {
    position: static;
  }
}

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

._header .flag-bg .emblem img {
  width: 40px;
  height: auto;
}

/* Header content */
.header-bar-content {
  position: relative;
  z-index: 2;
  padding: 0 16px;
  height: 64px;
}

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

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

._logo_mobile {
  display: none;
}

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

@media screen and (max-width: 991px) {
  ._logo { width: 250px; }
  ._azadilogo { width: 65px; margin-left: 0.8rem; }
}

@media screen and (max-width: 800px) {
  ._logo { display: none !important; }
  ._logo_mobile {
    display: inline-block !important;
    width: 55px;
    height: auto;
    position: relative;
    z-index: 1;
  }
}

@media screen and (max-width: 599px) {
  ._header .mat-toolbar,
  ._header .flag-bg,
  .header-bar-content {
    min-height: 56px;
    height: 56px;
  }
  ._header .flag-bg .flag-bg-left img,
  ._header .flag-bg .flag-bg-right img {
    height: 56px;
  }
  ._header .flag-bg .emblem {
    height: 56px;
  }
  ._header .flag-bg .emblem img {
    width: 30px;
  }
}

/* Header right actions */
.header-right-actions {
  display: flex;
  align-items: center;
  column-gap: 5px;
}

.font-buttons {
  display: inline-flex;
  border: 1px solid #bfbfbf;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.btn-font {
  height: 28px;
  min-width: 30px;
  padding: 0 6px;
  border: none;
  border-right: 1px solid #d9d9d9;
  background: #fff;
  cursor: pointer;
  font-family: Roboto, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.btn-font:last-child {
  border-right: none;
}

.btn-font:hover {
  background: #f0f0f0;
}

.btn-font sup {
  font-size: 9px;
  top: -0.35em;
}

.header-divider {
  width: 1px;
  height: 22px;
  background-color: #c4c4c4;
  margin: 0 4px;
}

.theme-ico {
  height: 32px;
  width: 32px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #2b2b2b;
  transition: background 0.2s;
}

.theme-ico:hover {
  background: rgba(0, 0, 0, 0.06);
}

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

._loginBtn {
  background-color: #234a7d;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0 14px;
  height: 32px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: Roboto, sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: background-color 0.15s;
}

._loginBtn:hover {
  background-color: #1a3962;
}

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

.nav-toggle-btn {
  background: transparent;
  border: none;
  color: #234a7d;
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media screen and (max-width: 991px) {
  ._hide-mobile { display: none; }
}

/* ============ NAVIGATION ============ */
._navBar {
  background-color: #234a7d;
}

.nav-toolbar {
  min-height: 44px;
  background-color: #234a7d !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  flex-wrap: wrap;
}

.nav-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  padding: 0 14px;
  height: 44px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: Roboto, sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: background-color 0.2s;
  white-space: nowrap;
  text-decoration: none;
}

.nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.nav-btn.active {
  background-color: transparent;
  font-weight: 500;
}

.nav-btn .material-icons {
  font-size: 16px;
  opacity: 0.85;
}

@media screen and (max-width: 991px) {
  .nav-toolbar {
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
  }
  .nav-toolbar.active {
    display: flex;
  }
  .nav-btn {
    height: 40px;
    padding: 0 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
}

/* ============ CONTENT ============ */
.content-body {
  position: relative;
  min-height: calc(100vh - 115px);
  padding: 0;
  background-color: #fafafa;
  background-image: url("assets/images/bg-logo.png");
  background-position: 50%;
  background-repeat: repeat;
}

.content-body .container {
  position: relative;
  z-index: 1;
}

.col-md-6.mt-5 {
  max-width: 560px;
  width: 100%;
  margin-bottom: 2.5rem;
}

.card {
  border-radius: 4px;
  border: none;
  background: #fff;
  width: 100%;
  text-align: left;
}

.table.table-responsive {
  display: table !important;
  width: 100% !important;
  margin-bottom: 0;
}

.table td {
  padding: 0.45rem 0.65rem;
  vertical-align: middle;
  border-color: #dee2e6;
  font-family: Roboto, sans-serif;
  font-size: 13.5px;
  line-height: 1.35;
}

.table tr td:first-child {
  font-weight: 500;
  width: 110px;
  max-width: 115px;
  color: #333;
}

.table tr td:last-child {
  color: #212529;
  word-break: break-word;
}

/* ============ FOOTER ============ */
.bg-dark-footer {
  color: #fff;
  background: radial-gradient(circle, #138f78 0%, #21537c 100%) !important;
  border-top: none;
  overflow-x: hidden;
}

.footer-logos-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 6px 0 14px;
}

.footer-logo-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.footer-logo-item.logo-transparent img {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.footer-logo-item.logo-white-card {
  background: #ffffff;
  border-radius: 4px;
  padding: 3px 10px;
  height: 38px;
  min-width: 114px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.footer-logo-item.logo-white-card img {
  height: 28px;
  max-width: 104px;
  width: auto;
  object-fit: contain;
}

.footer-logo-item.logo-pm-card {
  background: #181818;
  border-radius: 4px;
  padding: 3px 10px;
  height: 38px;
  min-width: 110px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #3a3a3a;
}

.footer-logo-item.logo-pm-card img {
  height: 26px;
  width: auto;
  object-fit: contain;
}

.quick-links {
  list-style: none;
  text-align: center;
  margin-top: 6px;
  margin-bottom: 6px;
  width: 100%;
  padding-left: 0;
}

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

.quick-links li:after {
  content: "|";
  position: absolute;
  right: -10px;
  top: -1px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 300;
}

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

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

.quick-links li a:hover {
  text-decoration: underline;
  color: #fff;
}

.footer-meta {
  font-size: 13px;
  color: #fff;
  line-height: 1.4;
}

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

.live-clock-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.time-icon {
  font-size: 15px;
  line-height: 1;
  vertical-align: -2px;
}

/* ============ DARK MODE ============ */
body.dark,
body.dark-mode {
  background: #1a1a2e;
}

body.dark .mat-toolbar,
body.dark .bg-white,
body.dark-mode .mat-toolbar,
body.dark-mode .bg-white {
  background: #16213e !important;
}

body.dark .content-body,
body.dark-mode .content-body {
  background: #1a1a2e;
  background-image: none;
}

body.dark .cert-card,
body.dark-mode .cert-card {
  background: #16213e;
  color: #e2e8f0;
  box-shadow: 4px -5px 13px -1px rgba(0,0,0,.5);
}

body.dark .cert-card .table td,
body.dark-mode .cert-card .table td {
  color: #e2e8f0;
  border-color: #2d3748;
}

body.dark .btn-font,
body.dark-mode .btn-font {
  background: #2d3748;
  color: #e2e8f0;
  border-color: #4a5568;
}

body.dark .theme-ico,
body.dark-mode .theme-ico {
  color: #e2e8f0;
}

/* ============ FONT SIZE ============ */
body.font-small { font-size: 14px; }
body.font-large { font-size: 18px; }

@media (max-width: 768px) {
  .content-body {
    padding: 12px 0 25px;
  }
  .content-body .container {
    padding-left: 10px;
    padding-right: 10px;
  }
  .col-md-6.mt-5 {
    margin-top: 20px !important;
    margin-bottom: 25px !important;
    max-width: 440px;
    width: 100%;
    padding: 0 8px;
  }
  .card {
    padding: 20px 20px 16px 20px !important;
  }
  .table td {
    padding: 0.45rem 0.65rem;
    font-size: 13px;
    word-break: break-word;
  }
  .table tr td:first-child {
    font-size: 13px;
    width: 110px;
    max-width: 115px;
    white-space: normal;
  }
  .table tr td:last-child {
    font-size: 13px;
    word-break: break-word;
  }
  .quick-links li {
    margin: 2px 5px;
    font-size: 11.5px;
  }
  .quick-links li:after {
    display: none;
  }
  .footer-meta {
    font-size: 11.5px;
    padding: 0 10px;
  }
  ._rightCard {
    font-size: 11.5px;
  }
}

@media (max-width: 599px) {
  ._header .mat-toolbar {
    min-height: 54px;
  }
  .header-bar-content {
    padding: 4px 10px !important;
  }
  .header-brand-wrap {
    gap: 8px;
  }
  ._logo {
    display: none !important;
  }
  ._logo_mobile {
    display: block !important;
    width: 38px;
    height: auto;
  }
  ._azadilogo {
    width: 50px;
    height: auto;
  }
  .flag-bg .emblem {
    display: none !important; /* Hide center emblem on mobile so it doesn't overlap logos */
  }
  .flag-bg .flag-bg-left,
  .flag-bg .flag-bg-right {
    width: 50%;
  }
  .theme-ico {
    height: 30px;
    width: 30px;
  }
  .theme-ico .material-icons {
    font-size: 18px;
  }
  .nav-toggle-btn {
    padding: 2px;
  }
  .nav-toggle-btn .material-icons {
    font-size: 24px;
  }
  .footer-logos-row {
    gap: 8px;
    padding: 8px 4px 12px;
  }
  .footer-logo-item.logo-transparent img {
    height: 28px;
  }
  .footer-logo-item.logo-white-card {
    height: 32px;
    min-width: 80px;
    padding: 2px 6px;
  }
  .footer-logo-item.logo-white-card img {
    height: 22px;
    max-width: 76px;
  }
  .footer-logo-item.logo-pm-card {
    height: 32px;
    min-width: 75px;
    padding: 2px 6px;
  }
  .footer-logo-item.logo-pm-card img {
    height: 20px;
  }
  ._rightCard {
    font-size: 11px;
    padding: 6px 10px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
  }
}

/* Print */
@media print {
  .flag-bg, .nav-toolbar, .bg-dark-footer, ._hide-mobile, .theme-ico, ._loginBtn {
    display: none !important;
  }
  .content-body { background: #fff; }
  .cert-card { box-shadow: none; border: 1px solid #ccc; }
}
