/**
 * TVD Theme - Mirror Mask Flash Trắng (CapCut Slices Effect) Stylesheet
 * 
 * Slices vertical slats with seamless panoramic split, white flash animations,
 * interactive accordion hover expansion, and romantic cinematic typography.
 *
 * @package TVDTheme
 */

.tvd-mirror-mask {
  position: relative;
  width: 100%;
  height: var(--tvd-mm-height, 560px);
  min-height: 320px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: #0b0c10;
  isolation: isolate;
  user-select: none;
}

/* Slices Container Grid / Flex */
.tvd-mirror-mask__grid {
  position: absolute;
  inset: 0;
  display: flex;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: auto;
}

/* Individual Mirror Slice */
.tvd-mirror-mask__slice {
  flex: 1 1 0%;
  height: 100%;
  position: relative;
  overflow: hidden;
  transition: flex 0.5s cubic-bezier(0.22, 1, 0.36, 1), transform 0.4s ease, filter 0.4s ease;
  border-right: var(--tvd-mm-border-w, 1px) solid var(--tvd-mm-border-c, #000000);
  background-color: #111;
  will-change: flex, transform;
}

.tvd-mirror-mask__slice:last-child {
  border-right: none;
}

/* Panoramic Background Positioning across Slices */
.tvd-mirror-mask__bg {
  position: absolute;
  top: 0;
  bottom: 0;
  height: 100%;
  width: calc(var(--tvd-mm-total, 7) * 100%);
  left: calc(var(--tvd-mm-idx, 0) * -100%);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s ease;
  will-change: transform;
}

/* Reveal Background (Secondary Scene e.g. Winter / Flowers) */
.tvd-mirror-mask__slice--reveal .tvd-mirror-mask__bg {
  background-image: var(--tvd-mm-reveal-img) !important;
}

/* Subtle Dark Gradient Overlay on Slices for Text Contrast */
.tvd-mirror-mask__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(circle at center, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.45) 85%);
  pointer-events: none;
}

/* CapCut Signature "Flash Trắng" Layer */
.tvd-mirror-mask__flash {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: var(--tvd-mm-flash-c, linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.4) 60%, rgba(255,255,255,0.85) 100%));
  opacity: 0;
  will-change: opacity, transform;
}

/* Flash Animations: Sweep */
.tvd-mirror-mask--flash-sweep .tvd-mirror-mask__flash {
  animation: tvdMmFlashSweep var(--tvd-mm-flash-speed, 3s) infinite ease-in-out;
  animation-delay: calc(var(--tvd-mm-idx, 0) * 0.14s);
}

@keyframes tvdMmFlashSweep {
  0%, 100% {
    opacity: 0;
    transform: scaleX(0.9);
  }
  14% {
    opacity: 0.85;
    transform: scaleX(1);
  }
  28% {
    opacity: 0;
    transform: scaleX(1.05);
  }
}

/* Flash Animations: Beat */
.tvd-mirror-mask--flash-beat .tvd-mirror-mask__flash {
  animation: tvdMmFlashBeat var(--tvd-mm-flash-speed, 2.4s) infinite cubic-bezier(0.1, 0.9, 0.2, 1);
}

@keyframes tvdMmFlashBeat {
  0%, 78%, 100% {
    opacity: 0;
  }
  82% {
    opacity: 0.92;
  }
  87% {
    opacity: 0.12;
  }
  91% {
    opacity: 0.75;
  }
  95% {
    opacity: 0;
  }
}

/* Flash Animations: Wave */
.tvd-mirror-mask--flash-wave .tvd-mirror-mask__flash {
  animation: tvdMmFlashWave var(--tvd-mm-flash-speed, 3.2s) infinite ease-in-out;
  animation-delay: calc(var(--tvd-mm-idx, 0) * 0.22s);
}

@keyframes tvdMmFlashWave {
  0%, 100% {
    opacity: 0;
  }
  18% {
    opacity: 0.9;
  }
  36% {
    opacity: 0;
  }
}

/* Interactive Hover Modes */
.tvd-mirror-mask--hover-expand .tvd-mirror-mask__slice:hover {
  flex: 1.8 1 0%;
  z-index: 4;
}

.tvd-mirror-mask--hover-expand .tvd-mirror-mask__slice:hover .tvd-mirror-mask__bg {
  transform: scale(1.06);
}

.tvd-mirror-mask--hover-zoom .tvd-mirror-mask__slice:hover .tvd-mirror-mask__bg {
  transform: scale(1.1);
}

.tvd-mirror-mask--hover-lift .tvd-mirror-mask__slice:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.5);
  z-index: 4;
}

.tvd-mirror-mask--hover-flash .tvd-mirror-mask__slice:hover .tvd-mirror-mask__flash {
  opacity: 0.85;
  transition: opacity 0.15s ease-out;
}

/* Typography & Content Overlay */
.tvd-mirror-mask__content {
  position: relative;
  z-index: 10;
  text-align: center;
  color: #ffffff;
  padding: 30px 20px;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
}

/* Romantic / Cinematic Tag */
.tvd-mm-tag {
  font-family: 'Cinzel', 'Playfair Display', 'Times New Roman', Georgia, serif;
  font-size: clamp(12px, 1.35vw, 18px);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

/* Romantic Title with Stylized Large 'A' */
.tvd-mm-title {
  font-family: 'Cinzel', 'Playfair Display', 'Times New Roman', Georgia, serif;
  font-size: clamp(32px, 5.5vw, 78px);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1.08;
  margin: 0;
  color: #ffffff;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.75);
}

.tvd-mm-a {
  font-size: 1.38em;
  line-height: 0.8;
  font-weight: 400;
  transform: translateY(6px);
  display: inline-block;
  margin: 0 0.04em;
  color: #ffffff;
  text-shadow: 0 0 24px rgba(255, 255, 255, 0.7), 0 3px 18px rgba(0, 0, 0, 0.85);
}

/* Elegant Underline Flourish */
.tvd-mm-flourish {
  display: block;
  width: 70%;
  max-width: 320px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.85) 50%, transparent 100%);
  margin: 10px auto 0;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

/* Optional Subtitle / Description */
.tvd-mm-desc {
  max-width: 640px;
  margin-top: 16px;
  font-size: clamp(14px, 1.15vw, 17px);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* Optional Call to Action Button */
.tvd-mm-actions {
  margin-top: 24px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.tvd-mm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 99px;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  backdrop-filter: blur(8px);
}

.tvd-mm-btn--primary {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  color: #ffffff !important;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.tvd-mm-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(99, 102, 241, 0.65);
}

.tvd-mm-btn--white {
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.tvd-mm-btn--white:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.5);
}

.tvd-mm-btn--outline {
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff !important;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
}

.tvd-mm-btn--outline:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #ffffff;
  transform: translateY(-2px);
}

/* Responsive Rules */
@media (max-width: 849px) {
  .tvd-mirror-mask {
    height: var(--tvd-mm-height-md, min(var(--tvd-mm-height, 560px), 460px));
  }
  .tvd-mm-title {
    letter-spacing: 0.16em;
  }
}

@media (max-width: 549px) {
  .tvd-mirror-mask {
    height: var(--tvd-mm-height-sm, 360px);
  }
  .tvd-mirror-mask__slice {
    border-right-width: 1px;
  }
  .tvd-mm-tag {
    letter-spacing: 0.12em;
  }
  .tvd-mm-title {
    letter-spacing: 0.12em;
  }
  .tvd-mm-a {
    transform: translateY(3px);
  }
  .tvd-mm-flourish {
    width: 85%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tvd-mirror-mask__flash {
    animation: none !important;
  }
  .tvd-mirror-mask__slice,
  .tvd-mirror-mask__bg {
    transition: none !important;
  }
}
