/**
 * Aktim - Mobile Vertical Carousel
 * TikTok/Reels Style - Stacked Cards
 *
 * @package    Aktim
 * @author     Mustafa Erdinc <mustafaerdinc@me.com>
 * @copyright  2024-2026 Bilgicler Yapi
 * @link       https://mustafaerdinc.com.tr
 */

/* Main Container - Full screen (footer hidden on mobile) */
.mobile-carousel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  background: #1a1a1a;
  z-index: 1;
}

/* Blur Background Layer - Shows next card blurred during transitions */
.carousel-blur-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: blur(20px) brightness(0.6);
  transform: scale(1.1);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
  will-change: opacity, background-image;
}

/* Card Stack - Full screen */
.card-stack {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1000px;
  perspective-origin: 50% 50%;
}

/* -------------------------------------------
   Project Cards
   ------------------------------------------- */
.project-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  overflow: hidden;
  cursor: grab;
  will-change: transform, opacity;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

.project-card.is-dragging {
  cursor: grabbing;
  transition: none !important;
}

/* Current card - center with Ken Burns effect */
.project-card.is-current {
  z-index: 10;
  transform: translateY(0) scale(1);
  opacity: 1;
  animation: kenBurns 10s ease-in-out infinite alternate;
}

@keyframes kenBurns {
  0% {
    background-position: 30% center;
  }
  100% {
    background-position: 70% center;
  }
}

/* Next card - HIDDEN (no peek) */
.project-card.is-next {
  z-index: 1;
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

/* Previous card - HIDDEN (no peek) */
.project-card.is-prev {
  z-index: 1;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* Hidden cards */
.project-card.is-hidden {
  z-index: 0;
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

/* -------------------------------------------
   Gradient Overlay - Top and Bottom
   ------------------------------------------- */
.card-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.6) 0%,
      rgba(0, 0, 0, 0.3) 15%,
      transparent 30%
    ),
    linear-gradient(
      to top,
      rgba(0, 0, 0, 0.85) 0%,
      rgba(0, 0, 0, 0.6) 25%,
      rgba(0, 0, 0, 0.2) 50%,
      transparent 70%
    );
  pointer-events: none;
  z-index: 1;
}

/* -------------------------------------------
   Card Header: Logo + Buttons (side by side)
   ------------------------------------------- */
.card-header {
  position: absolute;
  bottom: 230px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 3;
}

/* Project Logo - Left side */
.card-logo {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
}

.card-logo img {
  max-width: 100%;
  max-height: 80px;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 2px 10px rgba(0, 0, 0, 0.6));
}

/* Project-specific logo adjustments */
.project-card.aktim1 .card-logo img,
.project-card.aktim2 .card-logo img,
.project-card.aktim3 .card-logo img {
  max-height: 90px;
}

.project-card.aktimcarsi .card-logo img,
.project-card.aktimofis .card-logo img {
  max-height: 65px;
}

/* CTA Buttons - Right side, Glassmorphism pills */
.card-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.card-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--color-white);
  white-space: nowrap;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.card-actions .btn:active {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0.97);
}

.card-actions .btn iconify-icon {
  font-size: 16px;
}

.card-actions .btn span {
  font-size: 13px;
}

.card-actions .btn-primary {
  background: rgba(255, 255, 255, 0.2);
}

.card-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.12);
}

/* Ripple effect for buttons */
.card-actions .btn {
  position: relative;
  overflow: hidden;
}

.btn-ripple {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
}

/* -------------------------------------------
   Features Grid (6 icons) - White, 2-line text
   ------------------------------------------- */
.card-features {
  position: absolute;
  bottom: 55px;
  left: 20px;
  right: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 10px;
  z-index: 3;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.feature-item iconify-icon {
  font-size: 32px;
  color: #ffffff;
}

.feature-item .feature-line1,
.feature-item .feature-line2 {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #ffffff;
  line-height: 1.2;
  max-width: 100%;
}

.feature-item .feature-line1 {
  margin-top: 2px;
}

.feature-item .feature-line2 {
  opacity: 0.85;
}

/* -------------------------------------------
   Pagination Dots - HIDDEN
   ------------------------------------------- */
.carousel-pagination {
  display: none !important;
}

/* -------------------------------------------
   Swipe Hint Animation (animated swipe up indicator)
   Positioned at top-right corner
   ------------------------------------------- */
.swipe-hint {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  color: var(--color-white);
  opacity: 0;
  pointer-events: none;
  z-index: 20;
}

.swipe-hint.visible {
  animation: swipeHintPulse 3s ease-in-out infinite;
}

/* Chevron arrows container */
.swipe-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* Triple chevron arrows pointing up */
.swipe-icon::before,
.swipe-icon::after {
  content: '';
  width: 12px;
  height: 12px;
  border-left: 2px solid rgba(255, 255, 255, 0.9);
  border-top: 2px solid rgba(255, 255, 255, 0.9);
  transform: rotate(45deg);
}

.swipe-icon::before {
  animation: chevronUp 1.2s ease-in-out infinite;
  animation-delay: 0s;
}

.swipe-icon::after {
  margin-top: -6px;
  animation: chevronUp 1.2s ease-in-out infinite;
  animation-delay: 0.15s;
  opacity: 0.6;
}

/* Third chevron via span */
.swipe-icon span {
  display: block;
  width: 12px;
  height: 12px;
  border-left: 2px solid rgba(255, 255, 255, 0.9);
  border-top: 2px solid rgba(255, 255, 255, 0.9);
  transform: rotate(45deg);
  margin-top: -6px;
  animation: chevronUp 1.2s ease-in-out infinite;
  animation-delay: 0.3s;
  opacity: 0.4;
}

@keyframes chevronUp {
  0%, 100% {
    transform: rotate(45deg) translateY(0);
    opacity: 0.3;
  }
  50% {
    transform: rotate(45deg) translateY(-3px);
    opacity: 1;
  }
}

@keyframes swipeHintFade {
  0% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  10% { opacity: 1; transform: translateX(-50%) translateY(0); }
  85% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

@keyframes swipeHintPulse {
  0%, 100% {
    opacity: 0.6;
    transform: translateX(-50%) translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) translateY(-8px);
  }
}

.swipe-text {
  display: none;
}

/* -------------------------------------------
   Small Mobile (max-width: 380px)
   ------------------------------------------- */
@media (max-width: 380px) {
  .card-logo img {
    max-height: 60px;
  }

  .project-card.aktim1 .card-logo img,
  .project-card.aktim2 .card-logo img,
  .project-card.aktim3 .card-logo img {
    max-height: 65px;
  }

  .card-header {
    bottom: 200px;
    left: 16px;
    right: 16px;
    gap: 12px;
  }

  .card-actions .btn {
    padding: 6px 12px;
  }

  .card-actions .btn iconify-icon {
    font-size: 14px;
  }

  .card-actions .btn span {
    font-size: 12px;
  }

  .card-features {
    bottom: 50px;
    left: 16px;
    right: 16px;
    gap: 12px 8px;
  }

  .feature-item iconify-icon {
    font-size: 28px;
  }

  .feature-item .feature-line1,
  .feature-item .feature-line2 {
    font-size: 10px;
  }
}

/* -------------------------------------------
   Short Screens (max-height: 700px)
   ------------------------------------------- */
@media (max-height: 700px) {
  .card-header {
    bottom: 195px;
  }

  .card-logo img {
    max-height: 55px;
  }

  .card-actions .btn {
    padding: 6px 12px;
  }

  .card-actions {
    gap: 6px;
  }

  .card-features {
    bottom: 45px;
    gap: 10px 6px;
  }

  .feature-item iconify-icon {
    font-size: 24px;
  }

  .feature-item .feature-line1,
  .feature-item .feature-line2 {
    font-size: 9px;
  }
}

/* -------------------------------------------
   Very Short Screens (max-height: 600px)
   ------------------------------------------- */
@media (max-height: 600px) {
  .card-header {
    bottom: 165px;
  }

  .card-logo img {
    max-height: 45px;
  }

  .card-features {
    bottom: 40px;
    gap: 8px 4px;
  }

  .feature-item iconify-icon {
    font-size: 20px;
  }

  .feature-item .feature-line1,
  .feature-item .feature-line2 {
    font-size: 8px;
  }
}

/* -------------------------------------------
   Tall Screens (min-height: 850px) - iPhone Pro Max etc.
   ------------------------------------------- */
@media (min-height: 850px) {
  .card-header {
    bottom: 260px;
  }

  .card-logo img {
    max-height: 90px;
  }

  .card-features {
    bottom: 70px;
    gap: 18px 12px;
  }

  .feature-item iconify-icon {
    font-size: 36px;
  }

  .feature-item .feature-line1,
  .feature-item .feature-line2 {
    font-size: 12px;
  }
}

/* -------------------------------------------
   Hide on Desktop (>= 850px)
   ------------------------------------------- */
@media (min-width: 850px) {
  .mobile-carousel {
    display: none !important;
  }
}
