/* ============================================================
   PN Technologies - Product Videos Stylesheet
   Modern, optimized, accessible video gallery with modal player
   ============================================================ */

/* ---------- Hero Banner ---------- */
.videos-hero {
  position: relative;
  width: 100%;
  padding: 140px 20px 70px;
  background: linear-gradient(135deg, #050505 0%, #160a00 50%, #050505 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
}

.videos-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, rgba(255, 102, 0, 0.12) 0%, transparent 65%);
  pointer-events: none;
}

.videos-hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
  margin: 0 auto;
}

.videos-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(255, 102, 0, 0.12);
  border: 1px solid rgba(255, 102, 0, 0.3);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #ff6600;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.videos-hero-badge svg {
  color: #ff6600;
}

.videos-hero-title {
  font-size: 52px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
  margin-bottom: 18px;
  letter-spacing: -0.5px;
}

.videos-hero-title span {
  color: #ff6600;
}

.videos-hero-subtitle {
  font-size: 17px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.7);
  max-width: 680px;
  margin: 0 auto;
}

/* Light Theme Adjustments for Hero */
html.light-theme .videos-hero {
  background: linear-gradient(135deg, #f5f5f7 0%, #fff2e6 50%, #f5f5f7 100%);
}

html.light-theme .videos-hero::before {
  background: radial-gradient(circle at 50% 30%, rgba(255, 102, 0, 0.08) 0%, transparent 65%);
}

html.light-theme .videos-hero-title {
  color: #111827;
}

html.light-theme .videos-hero-subtitle {
  color: #4b5563;
}

/* ---------- Main Gallery Section ---------- */
.videos-section {
  padding: 60px 0 100px;
  background-color: var(--navy, #050505);
  min-height: 60vh;
}

.videos-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Search & Filter Toolbar ---------- */
.videos-toolbar {
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.videos-search-box {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

.videos-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
  transition: color 0.2s ease;
}

.videos-search-input {
  width: 100%;
  height: 54px;
  padding: 0 50px 0 52px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  font-size: 16px;
  color: #ffffff;
  font-family: inherit;
  outline: none;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.videos-search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.videos-search-input:focus {
  background: rgba(255, 255, 255, 0.07);
  border-color: #ff6600;
  box-shadow: 0 0 0 4px rgba(255, 102, 0, 0.15), 0 8px 30px rgba(0, 0, 0, 0.25);
}

.videos-search-input:focus + .videos-search-icon,
.videos-search-box:focus-within .videos-search-icon {
  color: #ff6600;
}

.videos-search-clear {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.videos-search-clear:hover {
  background: rgba(255, 102, 0, 0.8);
  color: #fff;
}

/* Light Theme Toolbar */
html.light-theme .videos-section {
  background-color: var(--navy, #f8f9fa);
}

html.light-theme .videos-search-input {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #111827;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

html.light-theme .videos-search-input::placeholder {
  color: #9ca3af;
}

html.light-theme .videos-search-icon {
  color: #9ca3af;
}

html.light-theme .videos-search-clear {
  background: rgba(0, 0, 0, 0.08);
  color: #4b5563;
}

/* ---------- Category Filter Pills ---------- */
.videos-categories {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.category-pill {
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.category-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 102, 0, 0.3);
}

.category-pill.active {
  background: #ff6600;
  color: #ffffff;
  border-color: #ff6600;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(255, 102, 0, 0.3);
}

html.light-theme .category-pill {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #4b5563;
}

html.light-theme .category-pill:hover {
  background: #f3f4f6;
  color: #111827;
}

html.light-theme .category-pill.active {
  background: #ff6600;
  color: #ffffff;
  border-color: #ff6600;
}

/* ---------- Status / Results Header ---------- */
.videos-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 4px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
}

html.light-theme .videos-meta-bar {
  color: #6b7280;
}

.videos-count-badge {
  font-weight: 600;
  color: #ff6600;
}

/* ---------- Video Cards Grid ---------- */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.video-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

.video-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 102, 0, 0.35);
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

html.light-theme .video-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}

html.light-theme .video-card:hover {
  background: #ffffff;
  border-color: rgba(255, 102, 0, 0.4);
  box-shadow: 0 16px 32px rgba(255, 102, 0, 0.1);
}

/* Thumbnail Container */
.video-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  overflow: hidden;
}

.video-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.video-card:hover .video-card-thumb img {
  transform: scale(1.06);
}

.video-card-duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  z-index: 2;
}

.video-card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(4px);
  color: #ff6600;
  border: 1px solid rgba(255, 102, 0, 0.3);
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}

/* Play Button Overlay */
.video-card-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 3;
}

.video-play-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #ff6600;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(255, 102, 0, 0.5);
  transform: scale(0.85);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.video-play-btn svg {
  margin-left: 3px;
}

.video-card:hover .video-card-play {
  opacity: 1;
  background: rgba(0, 0, 0, 0.45);
}

.video-card:hover .video-play-btn {
  transform: scale(1.05);
}

/* Card Body */
.video-card-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.video-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 12px;
}

html.light-theme .video-card-meta {
  color: #6b7280;
}

.video-card-title {
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.45;
  color: #ffffff;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.video-card:hover .video-card-title {
  color: #ff6600;
}

html.light-theme .video-card-title {
  color: #111827;
}

.video-card-desc {
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

html.light-theme .video-card-desc {
  color: #4b5563;
}

.video-card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  font-weight: 600;
  color: #ff6600;
}

html.light-theme .video-card-action {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.video-card-action span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.2s ease;
}

.video-card:hover .video-card-action span {
  gap: 10px;
}

/* ---------- Empty State ---------- */
.videos-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 16px;
}

html.light-theme .videos-empty {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
}

.videos-empty svg {
  color: #ff6600;
  margin-bottom: 16px;
}

.videos-empty h3 {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

html.light-theme .videos-empty h3 {
  color: #111827;
}

.videos-empty p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  max-width: 440px;
  margin: 0 auto 20px;
}

html.light-theme .videos-empty p {
  color: #6b7280;
}

.videos-empty-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: #ff6600;
  color: #ffffff;
  border: none;
  border-radius: 24px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.videos-empty-btn:hover {
  background: #e05500;
}

/* ---------- Pagination Controls ---------- */
.videos-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 50px;
}

.videos-page-btn {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.videos-page-btn:hover:not(:disabled) {
  background: #ff6600;
  border-color: #ff6600;
  color: #ffffff;
}

.videos-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.videos-page-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.videos-page-input {
  width: 52px;
  height: 38px;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #ffffff;
  font-weight: 600;
  font-family: inherit;
  outline: none;
}

.videos-page-input:focus {
  border-color: #ff6600;
}

html.light-theme .videos-page-btn {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  color: #111827;
}

html.light-theme .videos-page-info {
  color: #4b5563;
}

html.light-theme .videos-page-input {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  color: #111827;
}

/* ---------- In-Page Video Modal Player ---------- */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
}

.video-modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overscroll-behavior: contain;
}

.video-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 980px;
  background: #111114;
  border: 1px solid rgba(255, 102, 0, 0.35);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.75), 0 0 40px rgba(255, 102, 0, 0.15);
  transform: scale(0.92) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.video-modal.active .video-modal-dialog {
  transform: scale(1) translateY(0);
}

.video-modal-header {
  padding: 16px 22px;
  background: #16161a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.video-modal-title {
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.video-modal-close {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  touch-action: manipulation;
}

.video-modal-close:hover {
  background: #ff6600;
  transform: rotate(90deg);
}

.video-modal-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.video-modal-player-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-modal-footer {
  padding: 16px 24px;
  background: #16161a;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.video-modal-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.video-modal-category {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 102, 0, 0.15);
  border: 1px solid rgba(255, 102, 0, 0.3);
  color: #ff6600;
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
}

.video-modal-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.video-modal-share-btn:hover {
  background: rgba(255, 102, 0, 0.2);
  border-color: #ff6600;
  color: #ff6600;
}

/* Light Theme Modal */
html.light-theme .video-modal-dialog {
  background: #ffffff;
  border-color: rgba(255, 102, 0, 0.4);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}

html.light-theme .video-modal-header,
html.light-theme .video-modal-footer {
  background: #f8f9fa;
  border-color: rgba(0, 0, 0, 0.08);
}

html.light-theme .video-modal-title {
  color: #111827;
}

html.light-theme .video-modal-close {
  background: rgba(0, 0, 0, 0.08);
  color: #111827;
}

html.light-theme .video-modal-close:hover {
  background: #ff6600;
  color: #ffffff;
}

html.light-theme .video-modal-meta {
  color: #4b5563;
}

html.light-theme .video-modal-share-btn {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  color: #111827;
}

/* ---------- Responsive Breakpoints & Cross-Device Optimization ---------- */
@media (max-width: 1024px) {
  .videos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  .videos-hero-title {
    font-size: 42px;
  }
}

@media (max-width: 768px) {
  .videos-hero {
    padding: 120px 16px 50px;
  }
  .videos-hero-title {
    font-size: 32px;
  }
  .videos-hero-subtitle {
    font-size: 15px;
  }
  .videos-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .videos-search-input {
    height: 48px;
    font-size: 16px !important; /* Prevents iOS Safari auto-zoom on iPhone */
  }
  .category-pill {
    padding: 8px 16px;
    font-size: 13px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .video-modal-header {
    padding: 14px 18px;
  }
  .video-modal-footer {
    padding: 12px 18px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .video-modal-share-btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
  .video-modal-title {
    font-size: 15px;
  }
  .videos-page-btn {
    min-width: 44px;
    min-height: 44px;
    font-size: 16px;
  }
}
