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

html {
  scroll-behavior: smooth;
}

body {
  font-family: Arial, sans-serif;
  background-color: #f9f9f9;
  margin: 0;
  padding: 0;
  color: #333;
  line-height: 1.8;
}

body.sidebar-open {
  overflow: hidden;
}

/* Layout */
header {
  background-color: #004080;
  color: white;
  line-height: 1;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

header .logo {
  position: absolute;
  left: 1.25rem;
  font-size: 1rem;
}

header .title {
  font-size: 1.75rem;
  margin: 0;
}

/* Tabs */
.tabs-container {
  position: fixed;
  top: 4.30rem;
  left: 0;
  right: 0;
  background-color: #f9f9f9;
  z-index: 999;
  padding: 1rem 0.625rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.sidebar-toggle {
  background: #004080;
  color: #fff;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  cursor: pointer;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 1000;
  pointer-events: none;
}

.overlay.show {
  display: block;
  pointer-events: auto;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1;
  border-bottom: 0.125rem solid #ccc;
}

.tablink {
  background-color: white;
  border: 1px solid #ccc;
  border-bottom: none;
  border-radius: 0.375rem 0.375rem 0 0;
  padding: 0.375rem 0.75rem;
  margin: 0 0.25rem;
  font-weight: bold;
  color: #004080;
  cursor: pointer;
  box-shadow: 0 -0.125rem 0.3125rem rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s, color 0.3s;
}

.tablink:hover {
  background-color: #f0f0f0;
}

.tablink.active {
  background-color: #004080;
  color: white;
  border-color: #004080;
  box-shadow: none;
}

.tabcontent {
  display: none;
  padding: 20vh 10rem 1.875rem 10rem;
  width: 100%;
  margin: auto;
}

.tabcontent.active {
  display: flex;
}

.content {
  flex: 1;
  min-width: 0;
}

.tab-inner {
  display: flex;
  width: 100%;
  flex-direction: row;
  align-items: flex-start;
  gap: 2.5rem;
  margin-top: 1.25rem;
  max-width: 100%;
}

/* Sidebar */
.sidebar {
  background-color: #f0f0f0;
  padding: 0.75rem;
  border-radius: 0.375rem;
  width: min(31.25rem, 80vw);
  max-width: 80%;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  flex-shrink: 0;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 1001;
  max-height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar a {
  display: block;
  padding: 0.625rem 0.75rem;
  margin-bottom: 0.5rem;
  background-color: #fff;
  border-left: 0.25rem solid transparent;
  border-radius: 0.25rem;
  font-weight: bold;
  color: #004080;
  text-decoration: none;
  transition: background-color 0.2s, border-left 0.2s;
}

.sidebar a:hover,
.sidebar a.active-link {
  background-color: #e6f0ff;
  border-left: 0.25rem solid #004080;
}

.performance-item,
.video-item {
  background-color: white;
  border-radius: 0.5rem;
  padding: 1.25rem;
  box-shadow: 0 0 0.625rem rgba(0, 0, 0, 0.05);
  margin-bottom: 1.875rem;
  scroll-margin-top: 20vh;
}

video,
img,
iframe {
  width: 100%;
  border-radius: 0.5rem;
  margin-top: 0.625rem;
}

.thumbnail-row {
  display: flex;
  gap: 0.375rem;
  margin-top: 0.625rem;
  margin-left: 0.5rem;
  margin-right: 0.5rem;
  overflow-x: auto;
  padding: 0.375rem;
  border: 1px solid #ccc;
  border-radius: 0.25rem;
}

.thumbnail {
  width: 5rem;
  height: 3.75rem;
  object-fit: cover;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: transform 0.2s, border 0.2s;
  border: 0.125rem solid transparent;
}

.video-thumb-row {
  display: flex;
  gap: 0.375rem;
  margin-top: 0.625rem;
  overflow-x: auto;
  padding-bottom: 0.375rem;
}

.video-thumb {
  width: 5rem;
  height: 3.75rem;
  object-fit: cover;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: transform 0.2s, border 0.2s;
  border: 0.125rem solid transparent;
}

.video-thumb:hover {
  transform: scale(1.05);
}

.video-thumb.selected {
  border: 0.125rem solid #004080;
}

/* PDF navigation bar */
.pdf-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  overflow-x: auto;
}

.pdf-thumb {
  padding: 0.375rem 0.75rem;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 0.25rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s;
}

.pdf-thumb.selected {
  background-color: #004080;
  color: #fff;
}

.pdf-viewer {
  flex: 1;
}

.thumbnail:hover {
  transform: scale(1.05);
}

.thumbnail.selected {
  border: 0.125rem solid #004080;
}

.main-image {
  width: 100%;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  max-height: 70vh;
  object-fit: contain;
}

.video-container .video-poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
}

.time-jump {
  color: #007bff;
  text-decoration: underline;
  cursor: pointer;
}

.time-jump:hover {
  text-decoration: none;
}

.pdf-frame {
  width: 100rem;
  max-width: 100%;
  height: 100vh;
  border: none;
}

.tabcontent .content {
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.performance-item {
  padding: 0;
  margin: 0 0 1rem;
  box-shadow: none;
  flex: 1;
}

.video-frame {
  width: 100%;
  height: 60vh;
  max-width: 100%;
  border: none;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  /* نسبت ابعاد 16:9 */
  height: 0;
  overflow: hidden;
  max-width: 100%;
}

.video-container iframe,
.video-container object,
.video-container embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

@media (max-width: 768px) {
  .sidebar {
    width: 80vw;
  }

  .tabcontent {
    padding: 20vh 2rem 1.875rem 2rem;
  }

  .tab-inner {
    flex-direction: column;
  }

  .performance-item {
    padding: 0.625rem;
  }

  .performance-item h2 {
    font-size: 1.125rem;
  }

  iframe {
    width: 100% !Performance;
    height: auto;
  }

  .thumbnail-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 0.625rem 0.5rem 0;
    padding: 0.375rem;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
  }

  .video-thumb-row {
    display: flex;
    gap: 0.375rem;
    margin-top: 0.625rem;
    overflow-x: auto;
    padding-bottom: 0.375rem;

  }

  .tablink {
    font-size: 0.75rem;
    padding: 0.375rem;
    flex: 1 0 30%;
    text-align: center;
  }

  .caption,
  p {
    font-size: 0.875rem;
  }

  .tabs {
    padding-top: 0;
  }
}