/* ==========================================================================
   Template Stylesheet
   Description: Universal Styling Sheet for Portfolio / Landing Templates
   Author: FrontSyl
   Version: 1.0.0
   License: Custom License (see LICENSE.md for details)
========================================================================== */

/* ======================
  BASE TYPOGRAPHY & SCROLL
====================== */
body {
  font-family: "Inter", sans-serif; /* Modern sans-serif font for clean readability */
}

html {
  scroll-behavior: smooth; /* Enables smooth scrolling for anchor links */
}

/* ======================
  HERO SECTION
====================== */

/* Portrait ≤360px (very narrow devices) */
@media (orientation: portrait) and (max-width: 360px) {
  #home {
    padding-top: 8vh !important;
    padding-bottom: 7vh !important;
    min-height: calc(100vh - 15vh) !important;
    overflow: visible !important;
  }
  #home .space-y-6 > .inline-flex {
    margin-top: 1.25rem !important;
    position: relative !important;
    z-index: 0 !important;
  }
}

/* Portrait ≤375px (small phones like iPhone SE) */
@media (orientation: portrait) and (max-width: 375px) and (max-height: 740px) {
  #home {
    padding-top: 8vh !important;
    padding-bottom: 7vh !important;
    min-height: calc(100vh - 15vh) !important;
  }
  #home .space-y-6 > .inline-flex {
    margin-top: 1.25rem !important;
  }
}

/* Portrait short height (e.g. Surface Duo) */
@media (orientation: portrait) and (min-width: 376px) and (max-height: 740px) {
  #home {
    padding-top: 7.5vh !important;
    padding-bottom: 6.5vh !important;
    min-height: calc(100vh - 14vh) !important;
  }
  #home .space-y-6 > .inline-flex {
    margin-top: 1.2rem !important;
  }
}

/* Landscape very short height (≤460px) */
@media (orientation: landscape) and (max-height: 460px) {
  #home {
    padding-top: 8vh !important;
    padding-bottom: 6.5vh !important;
    min-height: calc(100vh - 14.5vh) !important;
  }
  #home .space-y-6 > .inline-flex {
    margin-top: 1.4rem !important;
  }
}

/* Landscape medium height (≤600px, ≤900px wide) */
@media (orientation: landscape) and (max-height: 600px) and (max-width: 900px) {
  #home {
    padding-top: 7vh !important;
    padding-bottom: 6vh !important;
  }
}

/* ==========================================================================
   PROJECT Section
========================================================================== */
/* Animasi */
.card-zoom-out {
  animation: zoomOut 300ms ease-in forwards;
}
.card-zoom-in {
  animation: zoomIn 300ms ease-out forwards;
}

@keyframes zoomOut {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.8);
  }
}

@keyframes zoomIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.filter-btn {
  padding: 0.5rem 1rem; /* px-4 py-2 */
  border-radius: 0.375rem; /* rounded-md */
  font-size: 0.875rem; /* text-sm */
  font-weight: 500; /* font-medium */
  background-color: rgba(255, 255, 255, 0.4); /* bg-white/10 */
  color: #2c2f3a; /* text-trinary */
  transition: background-color 0.2s;
}

.dark .filter-btn {
  background-color: rgba(255, 255, 255, 0.05); /* dark:bg-white/5 */
  color: #f6efe6; /* dark:text-trinary-dark */
}

.filter-btn:hover {
  background-color: rgba(255, 255, 255, 0.2); /* hover:bg-white/20 */
}

.filter-btn.active {
  background-color: var(--color-secondary); /* bg-primary */
  color: #ffffff; /* text-white */
}

.dark .filter-btn.active {
  background-color: var(--color-secondary-dark); /* dark:bg-primary-dark */
}

/* Mobile portrait: allow modal content to scroll when text is long */
@media (max-width: 767px) and (orientation: portrait) {
  #projectModal {
    justify-content: center !important;
    align-items: center !important;
    padding: 2rem 1rem !important; /* small padding top/bottom */
  }

  #projectModal .backdrop-blur-xl {
    max-height: 100vh !important;
    margin: 0 auto !important;
    overflow: hidden !important;
  }

  #projectModal .p-6 {
    max-height: 60vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    will-change: scroll-position;
  }
}

/* Modal: border-radius 16px + inner scrolling for long text (mobile landscape) */
@media (orientation: landscape) and (max-height: 700px) {
  /* place modal near top so it fits short viewports */
  #projectModal {
    align-items: flex-start !important;
    padding-top: 4vh !important;
    padding-bottom: 4vh !important;
  }

  /* make the dialog a vertical flex container, limit its max-height,
     and allow inner area to scroll. Set border-radius 16px here. */
  #projectModal > .backdrop-blur-xl,
  #projectModal .backdrop-blur-xl {
    display: flex !important;
    flex-direction: column !important;
    max-height: calc(
      100vh - 8vh
    ) !important; /* keeps top/bottom breathing room */
    height: auto !important;
    overflow: hidden !important; /* inner zone will scroll */
    -webkit-overflow-scrolling: touch !important;
    border-radius: 16px !important;
    margin: 0 0.6rem !important;
  }

  /* constrain the hero image so it doesn't push content off-screen,
     keep its top corners rounded to match dialog */
  #projectModal #modalImage {
    width: 100% !important;
    height: auto !important;
    max-height: 30vh !important; /* image uses portion of viewport */
    object-fit: cover !important;
    border-top-left-radius: 16px !important;
    border-top-right-radius: 16px !important;
  }

  /* make the content area flexible and scrollable for long text */
  #projectModal .p-6 {
    flex: 1 1 auto !important; /* fill remaining height */
    min-height: 0 !important; /* allow flex child to shrink and scroll */
    overflow-y: auto !important;
    padding-bottom: 1rem !important;
  }

  /* keep interior buttons footer visible and usable (they flow after the scrolling body) */
  #projectModal .p-6 > .flex {
    margin-top: 0.75rem !important;
  }
}

/* Extra-tight short screens — stronger limits */
@media (orientation: landscape) and (max-height: 460px) {
  #projectModal {
    padding-top: 5vh !important;
    padding-bottom: 3.5vh !important;
  }
  #projectModal > .backdrop-blur-xl,
  #projectModal .backdrop-blur-xl {
    max-height: calc(100vh - 10vh) !important;
  }
  #projectModal #modalImage {
    max-height: 26vh !important;
  }
}

/* Desktop / laptop: keep modal centered, smooth scroll for long text */
@media (min-width: 900px) {
  #projectModal {
    justify-content: center !important;
    align-items: center !important;
    padding: 0 !important;
  }

  #projectModal .backdrop-blur-xl {
    max-height: 90vh !important;
    margin: 0 auto !important;
    overflow: hidden !important;
  }

  #projectModal .p-6 {
    max-height: 60vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    will-change: scroll-position;
  }
}

/* ======================
  SHADOW CUSTOM
====================== */
.shadow-primary {
  --tw-drop-shadow: drop-shadow(
    0 0 20px color-mix(in srgb, var(--color-secondary) 30%, transparent)
  );
  filter: var(--tw-drop-shadow);
}

.dark .shadow-primary {
  --tw-drop-shadow: drop-shadow(
    0 0 20px color-mix(in srgb, var(--color-secondary-dark) 30%, transparent)
  );
}

/* ======================
  HERO CARD (IMG)
====================== */
.interactive-card {
  transition: transform 0.6s ease, box-shadow 0.6s ease;
  will-change: transform;
  transform-style: preserve-3d;
  cursor: pointer;
  perspective: 800px;
}

.interactive-card:hover {
  transform: scale(1.035) rotateX(3deg) rotateY(-3deg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.interactive-card img {
  transition: opacity 0.5s ease;
}

.interactive-card:hover img {
  opacity: 1 !important;
}

.interactive-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0)
  );
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.interactive-card:hover::after {
  opacity: 1;
}

/* ======================
  SWIPER TESTIMONIAL
====================== */
.swiper.testimonialSwiper {
  padding-left: 1rem;
  padding-right: 1rem;
  position: relative;
}

.testimonial-card {
  background-color: rgba(255, 255, 255, 0.45);
  color: var(--color-trinary);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  border-radius: 1.25rem;
}

.testimonial-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

.dark .testimonial-card {
  background-color: rgba(28, 32, 44, 0.25);
  color: var(--color-trinary-dark);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Navigation Buttons */
.swiper-button-prev,
.swiper-button-next {
  position: absolute;
  top: 50%;
  transform: translateY(-15%);
  width: 2.5rem;
  height: 2.5rem;
  background: var(--color-trinary);
  border: 1px solid var(--color-secondary);
  border-radius: 9999px;
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.swiper-button-prev::after,
.swiper-button-next::after {
  display: none;
}

.swiper-button-prev {
  left: -2.5rem;
}

.swiper-button-next {
  right: -2.5rem;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
  background: var(--color-secondary);
  color: var(--color-primary-bg);
}

.dark .swiper-button-prev,
.dark .swiper-button-next {
  background: var(--color-primary-light-dark);
  border-color: var(--color-secondary-dark);
  color: var(--color-secondary-dark);
}

.dark .swiper-button-prev:hover,
.dark .swiper-button-next:hover {
  color: var(--color-primary-bg-dark);
}

/* Pagination */
.swiper-pagination {
  bottom: -2rem !important;
}

.swiper-pagination-bullet {
  background: var(--color-trinary) !important;
  opacity: 0.4 !important;
  width: 11px !important;
  height: 11px !important;
  margin: 0 4px !important;
  transition: transform 0.2s ease;
}

.swiper-pagination-bullet-active {
  background: var(--color-secondary) !important;
  opacity: 1 !important;
  transform: scale(1.1);
}

.dark .swiper-pagination-bullet {
  background: var(--color-trinary-dark) !important;
}

.dark .swiper-pagination-bullet-active {
  background: var(--color-secondary-dark) !important;
}

/* Responsive Navigation */
@media (max-width: 1024px) {
  .swiper-button-prev {
    left: -1.5rem;
  }
  .swiper-button-next {
    right: -1.5rem;
  }
}

@media (max-width: 768px) {
  .swiper-button-prev {
    left: -0.5rem;
  }
  .swiper-button-next {
    right: -0.5rem;
  }
}

@media (max-width: 640px) {
  .swiper-button-prev {
    left: 0.25rem;
  }
  .swiper-button-next {
    right: 0.25rem;
  }
}

@media (max-width: 480px) {
  .swiper-button-prev,
  .swiper-button-next {
    width: 2rem;
    height: 2rem;
  }
  .swiper-button-prev {
    left: 0.5rem;
  }
  .swiper-button-next {
    right: 0.5rem;
  }
}

@media (max-width: 360px) {
  .swiper-button-prev {
    left: 0.25rem;
  }
  .swiper-button-next {
    right: 0.25rem;
  }
}

/* ======================
  LOADER PAGE
====================== */
.pl {
  width: 6em;
  height: 6em;
}
.pl__ring {
  animation: ringA 2s linear infinite;
}
.ring-a {
  stroke: var(--color-secondary);
}
.ring-b {
  animation-name: ringB;
  stroke: var(--color-primary);
}
.ring-c {
  animation-name: ringC;
  stroke: var(--color-trinary);
}
.ring-d {
  animation-name: ringD;
  stroke: var(--color-trinary);
}

.dark .pl__ring--a {
  stroke: var(--color-secondary-dark);
}
.dark .pl__ring--b {
  stroke: var(--color-secondary-light-dark);
}
.dark .pl__ring--c,
.dark .pl__ring--d {
  stroke: var(--color-trinary-dark);
}

/* ======================
  LOADER ANIMATION KEYFRAMES
====================== */
@keyframes ringA {
  from,
  4% {
    stroke-dasharray: 0 660;
    stroke-width: 20;
    stroke-dashoffset: -330;
  }
  12% {
    stroke-dasharray: 60 600;
    stroke-width: 30;
    stroke-dashoffset: -335;
  }
  32% {
    stroke-dasharray: 60 600;
    stroke-width: 30;
    stroke-dashoffset: -595;
  }
  40%,
  54% {
    stroke-dasharray: 0 660;
    stroke-width: 20;
    stroke-dashoffset: -660;
  }
  62% {
    stroke-dasharray: 60 600;
    stroke-width: 30;
    stroke-dashoffset: -665;
  }
  82% {
    stroke-dasharray: 60 600;
    stroke-width: 30;
    stroke-dashoffset: -925;
  }
  90%,
  to {
    stroke-dasharray: 0 660;
    stroke-width: 20;
    stroke-dashoffset: -990;
  }
}

@keyframes ringB {
  from,
  12% {
    stroke-dasharray: 0 220;
    stroke-width: 20;
    stroke-dashoffset: -110;
  }
  20% {
    stroke-dasharray: 20 200;
    stroke-width: 30;
    stroke-dashoffset: -115;
  }
  40% {
    stroke-dasharray: 20 200;
    stroke-width: 30;
    stroke-dashoffset: -195;
  }
  48%,
  62% {
    stroke-dasharray: 0 220;
    stroke-width: 20;
    stroke-dashoffset: -220;
  }
  70% {
    stroke-dasharray: 20 200;
    stroke-width: 30;
    stroke-dashoffset: -225;
  }
  90% {
    stroke-dasharray: 20 200;
    stroke-width: 30;
    stroke-dashoffset: -305;
  }
  98%,
  to {
    stroke-dasharray: 0 220;
    stroke-width: 20;
    stroke-dashoffset: -330;
  }
}

@keyframes ringC {
  from {
    stroke-dasharray: 0 440;
    stroke-width: 20;
    stroke-dashoffset: 0;
  }
  8% {
    stroke-dasharray: 40 400;
    stroke-width: 30;
    stroke-dashoffset: -5;
  }
  28% {
    stroke-dasharray: 40 400;
    stroke-width: 30;
    stroke-dashoffset: -175;
  }
  36%,
  58% {
    stroke-dasharray: 0 440;
    stroke-width: 20;
    stroke-dashoffset: -220;
  }
  66% {
    stroke-dasharray: 40 400;
    stroke-width: 30;
    stroke-dashoffset: -225;
  }
  86% {
    stroke-dasharray: 40 400;
    stroke-width: 30;
    stroke-dashoffset: -395;
  }
  94%,
  to {
    stroke-dasharray: 0 440;
    stroke-width: 20;
    stroke-dashoffset: -440;
  }
}

@keyframes ringD {
  from,
  8% {
    stroke-dasharray: 0 440;
    stroke-width: 20;
    stroke-dashoffset: 0;
  }
  16% {
    stroke-dasharray: 40 400;
    stroke-width: 30;
    stroke-dashoffset: -5;
  }
  36% {
    stroke-dasharray: 40 400;
    stroke-width: 30;
    stroke-dashoffset: -175;
  }
  44%,
  50% {
    stroke-dasharray: 0 440;
    stroke-width: 20;
    stroke-dashoffset: -220;
  }
  58% {
    stroke-dasharray: 40 400;
    stroke-width: 30;
    stroke-dashoffset: -225;
  }
  78% {
    stroke-dasharray: 40 400;
    stroke-width: 30;
    stroke-dashoffset: -395;
  }
  86%,
  to {
    stroke-dasharray: 0 440;
    stroke-width: 20;
    stroke-dashoffset: -440;
  }
}

/* ======================
  SCROLL TO TOP BUTTON
====================== */
#scrollTopBtn {
  opacity: 0;
  transform: translateY(60px) scale(0.5);
  transition: opacity 0.4s ease-out,
    transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#scrollTopBtn.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

#scrollTopBtn:hover {
  transform: translateY(0) scale(1.15);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
