/* =============================================================================
   BMH Portfolio Manager — Frontend Styles
   Version: 1.0.0
   ============================================================================= */

/* ── CSS Custom Properties ────────────────────────────────────────────────── */
:root {
  --bmh-red:          #e50000;
  --bmh-red-dark:     #b20000;
  --bmh-dark:         #111111;
  --bmh-card-bg:      #1a1a1a;
  --bmh-text-white:   #ffffff;
  --bmh-text-muted:   #aaaaaa;
  --bmh-overlay:      rgba(229, 0, 0, 0.88);
  --bmh-transition:   0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --bmh-radius:       8px;
  --bmh-gap:          20px;
}

/* ── Wrapper ──────────────────────────────────────────────────────────────── */
.bmh-portfolio-wrapper {
  width: 100%;
  box-sizing: border-box;
}

/* ── Filter Bar ───────────────────────────────────────────────────────────── */
.bmh-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 36px;
}

.bmh-filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 22px;
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 50px;
  background: transparent;
  color: #cccccc;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--bmh-transition),
              border-color var(--bmh-transition),
              color var(--bmh-transition),
              transform var(--bmh-transition);
  white-space: nowrap;
}

.bmh-filter-btn:hover {
  border-color: var(--bmh-red);
  color: var(--bmh-text-white);
  transform: translateY(-1px);
}

.bmh-filter-btn.active {
  background-color: var(--bmh-red);
  border-color: var(--bmh-red);
  color: var(--bmh-text-white);
}

/* ── Portfolio Grid ───────────────────────────────────────────────────────── */
.bmh-portfolio-grid {
  display: grid;
  gap: var(--bmh-gap);
  width: 100%;
}

/* Column variants */
.bmh-cols-1 { grid-template-columns: 1fr; }
.bmh-cols-2 { grid-template-columns: repeat(2, 1fr); }
.bmh-cols-3 { grid-template-columns: repeat(3, 1fr); }
.bmh-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Responsive breakpoints */
@media (max-width: 1024px) {
  .bmh-cols-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .bmh-cols-3,
  .bmh-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .bmh-cols-2,
  .bmh-cols-3,
  .bmh-cols-4 { grid-template-columns: 1fr; }
}

/* ── Portfolio Item ───────────────────────────────────────────────────────── */
.bmh-portfolio-item {
  position: relative;
  background-color: var(--bmh-card-bg);
  border-radius: var(--bmh-radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--bmh-transition), box-shadow var(--bmh-transition);
  /* Filtering animation */
  transition: transform var(--bmh-transition), opacity var(--bmh-transition), box-shadow var(--bmh-transition);
}

.bmh-portfolio-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}

/* Hidden (filtered out) state */
.bmh-portfolio-item.bmh-hidden {
  display: none;
}

/* ── Thumbnail ────────────────────────────────────────────────────────────── */
.bmh-item-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: #0a0a0a;
}

.bmh-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--bmh-transition);
}

.bmh-portfolio-item:hover .bmh-item-thumb img {
  transform: scale(1.06);
}

/* ── Play Icon ────────────────────────────────────────────────────────────── */
.bmh-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  pointer-events: none;
  z-index: 2;
  opacity: 0.9;
  transition: opacity var(--bmh-transition), transform var(--bmh-transition);
}

.bmh-portfolio-item:hover .bmh-play-icon {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.6);
}

/* ── Hover Overlay ────────────────────────────────────────────────────────── */
.bmh-item-overlay {
  position: absolute;
  inset: 0;
  background-color: var(--bmh-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--bmh-transition);
  z-index: 3;
}

.bmh-portfolio-item:hover .bmh-item-overlay {
  opacity: 1;
}

.bmh-overlay-content {
  text-align: center;
  padding: 20px;
  color: var(--bmh-text-white);
  transform: translateY(14px);
  transition: transform var(--bmh-transition);
}

.bmh-portfolio-item:hover .bmh-overlay-content {
  transform: translateY(0);
}

.bmh-item-category {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: rgba(255,255,255,0.18);
  border-radius: 50px;
  padding: 3px 12px;
  margin-bottom: 10px;
}

.bmh-item-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--bmh-text-white);
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.bmh-item-client {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  margin: 0 0 14px;
}

/* ── Watch Button ─────────────────────────────────────────────────────────── */
.bmh-watch-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 24px;
  border: 2px solid rgba(255,255,255,0.9);
  border-radius: 50px;
  background: transparent;
  color: var(--bmh-text-white);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--bmh-transition),
              color var(--bmh-transition),
              transform var(--bmh-transition);
}

.bmh-watch-btn:hover {
  background-color: var(--bmh-text-white);
  color: var(--bmh-red);
  transform: scale(1.04);
}

.bmh-watch-btn-icon {
  font-size: 10px;
}

/* ── Item Caption (below image) ───────────────────────────────────────────── */
.bmh-item-caption {
  padding: 14px 16px 16px;
}

.bmh-item-caption-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--bmh-text-white);
  margin: 0 0 5px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bmh-item-caption-cat {
  font-size: 12px;
  color: var(--bmh-red);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 500;
}

/* ── No Items ─────────────────────────────────────────────────────────────── */
.bmh-no-items {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--bmh-text-muted);
  padding: 40px;
}

/* =============================================================================
   YouTube Lightbox Modal
   ============================================================================= */

.bmh-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bmh-modal.bmh-modal-open {
  visibility: visible;
  opacity: 1;
}

/* Backdrop */
.bmh-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.93);
  cursor: pointer;
}

/* Container */
.bmh-modal-container {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 960px;
  animation: bmh-modal-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes bmh-modal-in {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* Close button */
.bmh-modal-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px;
  transition: background-color 0.2s;
  z-index: 2;
}

.bmh-modal-close:hover {
  background: rgba(229, 0, 0, 0.9);
}

.bmh-modal-close svg {
  width: 100%;
  height: 100%;
}

/* Video title inside modal */
.bmh-modal-title {
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  padding: 0 4px;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 16:9 iframe wrapper */
.bmh-modal-iframe-wrap {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  background: #000;
  border-radius: var(--bmh-radius);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.8);
}

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

/* Body lock when modal open */
body.bmh-modal-open-body {
  overflow: hidden;
}

/* ── Accessibility: focus-visible ring ────────────────────────────────────── */
.bmh-filter-btn:focus-visible,
.bmh-watch-btn:focus-visible,
.bmh-modal-close:focus-visible {
  outline: 3px solid var(--bmh-red);
  outline-offset: 2px;
}

/* =============================================================================
   UPGRADED v2.0 — Card Entrance Animations
   ============================================================================= */

/* ── Shared: all animated cards start hidden ─────────────────────────────── */
.bmh-portfolio-item[class*="bmh-entrance-"]:not(.bmh-entrance-none) {
  opacity: 0;
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Fade Up */
.bmh-entrance-fade-up {
  animation-name: bmh-fade-up;
}
@keyframes bmh-fade-up {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Fade In */
.bmh-entrance-fade-in {
  animation-name: bmh-fade-in;
}
@keyframes bmh-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Fade Down */
.bmh-entrance-fade-down {
  animation-name: bmh-fade-down;
}
@keyframes bmh-fade-down {
  from { opacity: 0; transform: translateY(-40px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Zoom In */
.bmh-entrance-zoom-in {
  animation-name: bmh-zoom-in;
}
@keyframes bmh-zoom-in {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

/* Slide From Left */
.bmh-entrance-slide-left {
  animation-name: bmh-slide-left;
}
@keyframes bmh-slide-left {
  from { opacity: 0; transform: translateX(-60px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Slide From Right */
.bmh-entrance-slide-right {
  animation-name: bmh-slide-right;
}
@keyframes bmh-slide-right {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Flip Horizontal */
.bmh-entrance-flip-x {
  animation-name: bmh-flip-x;
  backface-visibility: hidden;
}
@keyframes bmh-flip-x {
  from { opacity: 0; transform: rotateY(-90deg); }
  to   { opacity: 1; transform: rotateY(0deg); }
}

/* Bounce */
.bmh-entrance-bounce {
  animation-name: bmh-bounce;
  animation-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
@keyframes bmh-bounce {
  0%   { opacity: 0; transform: scale(0.3) translateY(30px); }
  60%  { opacity: 1; transform: scale(1.05); }
  80%  { transform: scale(0.97); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Hover: respect custom lift via Elementor selector ──────────────────── */
/* Default (if no Elementor override): */
.bmh-portfolio-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}

/* =============================================================================
   Overlay Animation Variants
   ============================================================================= */

/* Default: fade (original) */
.bmh-overlay-fade .bmh-item-overlay {
  opacity: 0;
  transition: opacity var(--bmh-transition);
}
.bmh-overlay-fade.bmh-portfolio-item:hover .bmh-item-overlay {
  opacity: 1;
}

/* Slide Up */
.bmh-overlay-slide-up .bmh-item-overlay {
  opacity: 0;
  transform: translateY(100%);
  transition: opacity var(--bmh-transition), transform var(--bmh-transition);
}
.bmh-overlay-slide-up.bmh-portfolio-item:hover .bmh-item-overlay {
  opacity: 1;
  transform: translateY(0);
}

/* Slide Down */
.bmh-overlay-slide-down .bmh-item-overlay {
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity var(--bmh-transition), transform var(--bmh-transition);
}
.bmh-overlay-slide-down.bmh-portfolio-item:hover .bmh-item-overlay {
  opacity: 1;
  transform: translateY(0);
}

/* Zoom */
.bmh-overlay-zoom .bmh-item-overlay {
  opacity: 0;
  transform: scale(0.7);
  transition: opacity var(--bmh-transition), transform var(--bmh-transition);
}
.bmh-overlay-zoom.bmh-portfolio-item:hover .bmh-item-overlay {
  opacity: 1;
  transform: scale(1);
}

/* =============================================================================
   Filter Transition Variants (controlled via JS data attribute)
   ============================================================================= */

/* scale-fade: items scale down before disappearing */
.bmh-filter-anim-scale-fade .bmh-portfolio-item {
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.bmh-filter-anim-scale-fade .bmh-portfolio-item.bmh-hiding {
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
}
.bmh-filter-anim-scale-fade .bmh-portfolio-item.bmh-showing {
  animation: bmh-fade-up 0.35s ease both;
}

/* flip */
.bmh-filter-anim-flip .bmh-portfolio-item.bmh-hiding {
  animation: bmh-flip-x 0.25s ease forwards;
}
