* {
  font-family: "IBM Plex Sans Arabic", sans-serif;
}

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

.drawer-overlay.active {
  display: block;
}

.drawer-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background: white;
  z-index: 50;
  transition: right 0.3s ease;
  overflow-y: auto;
}

.drawer-menu.active {
  right: 0;
}

.header-wrapper {
  /* background: linear-gradient(to right, #030303 0%, #1a1919 100%); */
  background: #030303;
  position: relative;
  padding-bottom: 80px;
  width: 100%;
  overflow: hidden;
  min-height: 600px;
}
.header-wrapper::before {
  content: "";
  position: absolute;
  width: 75%;
  top: -5%;
  right: 0%;
  height: 100%;
  background-image: url(../assets/imgs/header/bg-elips.png);
  background-size: cover;
}

.header-wrapper::after {
  content: "";
  position: absolute;
  bottom: -30px;
  left: 0;
  right: 0;
  height: 40px;
  background: #111827;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  z-index: 2;
}

nav {
  position: relative;
  width: 100%;
  z-index: 25;
}
.section-curved-top {
  position: relative;
  padding-top: 50px;
  margin-top: -30px;
  z-index: 2;
}

.section-curved-top::before {
  content: "";
  position: absolute;
  top: -30px;
  left: 0;
  right: 0;
  height: 62px;
  background: white;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  z-index: 1;
}

@media (max-width: 768px) {
  .header-wrapper {
    padding-bottom: 60px;
    min-height: 500px;
  }

  .header-wrapper::after {
    bottom: -20px;
    height: 30px;
  }

  .section-curved-top {
    padding-top: 40px;
    margin-top: -20px;
  }

  .section-curved-top::before {
    top: -30px;
    height: 55px;
  }
}

.icon-star {
  vertical-align: middle;
  display: inline-block;
  width: 1em;
  height: 1em;
  mask: url("../assets/imgs/icons/star.svg") no-repeat center / contain;
  background-color: currentColor;
  content: "";
}

.faq {
  position: relative;
}
.faq::before {
  position: absolute;
  content: "";
  bottom: -20px;
  right: 0;
  width: 65%;
  height: 90%;
  background-image: url("../assets/imgs/circle.png");
  background-size: cover;
}
.active-faq {
  border: 2px solid #ff882e !important;
  box-shadow: 0px 4px 20px 0px rgba(102, 42, 178, 0.15);
}
.why-circle {
  @media (max-width: 768px) {
    width: 80px !important;
    height: 55px !important;
    padding: 10px !important;
    border-radius: 50%;
  }
}
#download {
  overflow: hidden;
}
.icon-logo {
    vertical-align: middle;
    display: inline-block;
    width: 1em;
    height: 1em;
    mask: url("../assets/imgs/logokaian.svg") no-repeat center / contain;
    background-color: currentColor;
    content: "";
}
.video-container {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  max-height: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  transition: opacity 0.5s ease, visibility 0.5s ease, max-height 0.5s ease,
    transform 0.3s ease, margin 0.5s ease, padding 0.5s ease;
  transform: translateY(20px);
}

.video-container.active {
  opacity: 1;
  visibility: visible;
  max-height: 1000px;
  margin-top: 1rem;
  transform: translateY(0);
}

.video-container:hover {
  transform: translateY(-5px);
}

/* Mobile video specific animations */
@media (max-width: 767px) {
  .video-container:not(.desktop-video) {
    display: block !important; /* Override Tailwind's block class */
    transform: translateY(30px) scale(0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 1rem;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s ease;
  }
  
  .video-container:not(.desktop-video).active {
    transform: translateY(0) scale(1);
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.2);
    animation: videoSlideIn 0.6s ease-out;
    background: #ffffff;
    border-color: rgba(255, 136, 46, 0.3);
  }
  
  .video-container:not(.desktop-video).exiting {
    animation: videoSlideOut 0.4s ease-in forwards;
    pointer-events: none; /* Prevent interaction during exit */
    filter: blur(1px);
  }
  
  .video-container:not(.desktop-video) video {
    transition: transform 0.4s ease, filter 0.4s ease, box-shadow 0.4s ease;
    border-radius: 1rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  }
  
  .video-container:not(.desktop-video):hover video {
    transform: scale(1.02);
    filter: brightness(1.1) contrast(1.05);
    box-shadow: inset 0 0 0 1px rgba(255, 136, 46, 0.2);
  }
}

/* Desktop - Hide mobile videos */
@media (min-width: 768px) {
  .video-container:not(.desktop-video) {
    display: none !important; /* Hide mobile videos on desktop */
  }
}

@keyframes videoSlideIn {
  0% {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  50% {
    opacity: 0.8;
    transform: translateY(-5px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes videoSlideOut {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 0.5;
    transform: translateY(-15px) scale(0.98);
  }
  100% {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
}

@keyframes desktopVideoSlideOut {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  50% {
    opacity: 0.6;
    transform: translateX(-25px) scale(0.98);
  }
  100% {
    opacity: 0;
    transform: translateX(-50px) scale(0.95);
  }
}

/* Video loading animation */
.video-container::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid rgba(255, 136, 46, 0.2);
  border-top: 3px solid #FF882E;
  border-radius: 50%;
  animation: videoSpin 1s linear infinite;
  opacity: 0;
  z-index: 10;
}

.video-container.loading::before {
  opacity: 1;
}

@keyframes videoSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Video transition overlay */
.video-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255, 136, 46, 0.1), rgba(255, 255, 255, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 5;
}

.video-container.exiting::after {
  opacity: 1;
}

.video-container .relative {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.video-container .relative > * {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-controls {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  z-index: 10;
}

.video-control-btn {
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 700;
  font-size: 0.9375rem;
  backdrop-filter: blur(10px);
}

.video-control-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.15);
  border-color: rgba(255, 255, 255, 0.6);
}

.video-control-btn.play-btn {
  width: 90px;
  height: 90px;
  background: rgba(255, 255, 255, 0.98);
  color: #000;
  border: none;
  font-size: 1.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.video-control-btn.play-btn:hover {
  background: white;
  transform: scale(1.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.video-views {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  backdrop-filter: blur(10px);
  z-index: 15;
}

.video-title {
  background: #1f2937;
  padding: 1.25rem;
  color: white;
}

.video-title p {
  font-size: 0.9375rem;
  font-weight: 500;
  margin: 0;
}

/* Desktop video container - hidden by default, shown when active */
@media (min-width: 768px) {
  .video-container.desktop-video {
    opacity: 0 !important;
    visibility: hidden !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: opacity 0.8s ease, visibility 0.8s ease, max-height 0.8s ease, transform 0.8s ease;
    transform: translateX(50px);
    display: block !important; /* Ensure it's displayed on desktop */
  }
  
  .video-container.desktop-video.active {
    opacity: 1 !important;
    visibility: visible !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateX(0);
    animation: desktopVideoSlideIn 0.8s ease-out;
  }
  
  .video-container.desktop-video.exiting {
    animation: desktopVideoSlideOut 0.5s ease-in forwards;
    pointer-events: none; /* Prevent interaction during exit */
    filter: blur(1px);
  }
  
  .video-container.desktop-video video {
    transition: transform 0.5s ease, filter 0.5s ease;
  }
  
  .video-container.desktop-video:hover video {
    transform: scale(1.03);
    filter: brightness(1.05);
  }
}

@keyframes desktopVideoSlideIn {
  0% {
    opacity: 0;
    transform: translateX(80px) scale(0.9);
  }
  60% {
    opacity: 0.9;
    transform: translateX(-10px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}
