:root {
  --clr-accent: #9a0a0a;
  --glass-bg: rgba(255, 255, 255, 0.17);
  --glass-border: rgba(255, 255, 255, 0.25);
}

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

html,
body {
  height: 100%;
  font-family: "Cairo", sans-serif;
  color: #fff;
  direction: rtl;
}

body {
  background-color: #000;
  background: center/cover no-repeat fixed;
  position: relative;
  overflow: hidden; /* prevent scroll */
}
body::before {
  content: "";
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  background: radial-gradient(
    circle at 100% 100%,
    rgba(0, 0, 0, 0.8),
    rgba(0, 0, 0, 0.9)
  );
  z-index: -1;
}

.d-block {
  display: block !important;
}
.text-center {
  text-align: center !important;
}
.flex_center {
  display: flex;
  place-items: center;
}

/* ======= Layout ======= */
.grid {
  display: grid;
  grid-template-columns: 3fr 1fr;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(16px, 1.5vw, 24px);
  height: 100vh;
  padding: clamp(16px, 1vw, 24px);
}
@media (max-width: 992px) {
  .grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }
}

/* ======= Header (Logo + Title) ======= */
header {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 3fr 1fr;
  grid-template-rows: auto minmax(0, 1fr) auto;
  place-items: center;
}
.brand_img {
  height: 100px;
  width: auto;
  flex-shrink: 0;
  -webkit-filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}
header h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  margin: 0;
  /* flex: 1; */
}

/* ======= Scrolling Table ======= */
.table-wrapper {
  position: relative;
  border-radius: 20px;
  border: 1px solid var(--clr-accent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  background: var(--glass-bg);
  overflow: hidden;
  height: 100%;
}
table {
  vertical-align: middle;
}
.img_cell {
  display: flex;
  align-items: center;
  justify-content: center;
}
table img {
  max-width: 50px;
}
#office-table {
  width: 100%;
  border-collapse: collapse;
}
#office-table thead {
  position: relative;
  z-index: 1;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background: #9a0a0a;
}
#office-table thead th {
  background: rgba(255, 255, 255, 0.09);
  text-align: start;
  font-weight: 600;
}
#office-table th,
#office-table td {
  padding: 14px 20px;
  /* white-space: nowrap; */
  font-size: 1.05rem;
}
.wrap_text {
  white-space: wrap !important;
}
.nowrap_text {
  white-space: nowrap !important;
}
/* #office-table tr td:first-child {
  padding-inline-start: 3rem;
} */
@media (max-width: 767px) {
  #office-table tr td:first-child {
    padding-inline-start: 1rem;
  }
}
#office-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.05);
}

/* Smooth reset animation */
#office-table tbody {
  -webkit-animation: scrollTable 100s linear infinite;
  animation: scrollTable 100s linear infinite;
  will-change: transform;
}
@keyframes scrollTable {
  0% {
    -webkit-transform: translateY(0);
    transform: translateY(0);
  }
  100% {
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
  }
}

/* ======= Videos ======= */
.video-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: 100%;
}
.video-container {
  position: relative;
  flex: 1 1 0;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.video-container video,
.video-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ======= News Ticker ======= */
.ticker {
  grid-column: 1 / -1;
  height: 52px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--clr-accent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  overflow: hidden;
}
.ticker__track {
  display: flex;
  gap: 40px;
  white-space: nowrap;
  will-change: transform;
}
.ticker__item {
  font-weight: 600;
  font-size: 1.1rem;
}

@media screen and (max-width: 991px) {
  body {
    overflow: auto;
  }
  .grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    height: auto;
    min-height: 100vh;
  }
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    height: 400px;
  }
  header {
    flex-direction: column; /* Stack logo and title */
    align-items: center; /* Center items when stacked */
    gap: 12px; /* Space between logo and title */
  }
  .brand_img {
    height: 50px; /* Smaller logo for mobile */
  }
  header h1 {
    font-size: clamp(1.2rem, 4vw, 1.6rem); /* Smaller title for mobile */
    text-align: center;
  }

  /* Table adjustments */
  #office-table th,
  #office-table td {
    padding: 8px 10px; /* Reduced padding */
    font-size: 0.85rem; /* Smaller font */
    /* white-space: nowrap; is kept from general styles for horizontal scroll */
  }

  /* Video stack adjustments */
  .video-stack {
    gap: 12px; /* Reduced gap between videos */
    flex-direction: row;
  }
  .video-container {
    border-radius: 15px; /* Slightly smaller border radius */
  }

  /* Ticker adjustments */
  .ticker {
    height: 40px; /* Smaller ticker height */
    border-radius: 8px; /* Smaller border radius */
  }
  .ticker__item {
    font-size: 0.85rem; /* Smaller ticker text */
  }
  .ticker__track {
    gap: 15px; /* Reduced gap for ticker items */
  }
}
