/* ================================
   Homepage Layout Styles
   File: assets/css/pages/home.css
   ================================ */

/* ================================
   Homepage Container
   ================================ */

.page-home {
  min-height: 100vh;
  padding-top: 6.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background:
    radial-gradient(
      circle at 20% 80%,
      rgba(201, 169, 97, 0.03) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 20%,
      rgba(27, 58, 82, 0.04) 0%,
      transparent 50%
    ),
    var(--color-ivory);
}

/* ================================
   Hero Content
   ================================ */

.hero__content {
  text-align: center;
  margin-bottom: var(--space-sm);
  animation: fadeInUp 1s ease;
  padding: 0 var(--space-md);
}

.hero__title {
  color: var(--color-deep-navy);
  margin-bottom: var(--space-md);
  font-weight: var(--fw-regular);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hero__subtitle {
  display: none;
}

/* ================================
   Hero Title Animation States
   ================================ */

@keyframes slideInFromRight {
  0% {
    opacity: 0;
    transform: translateX(100px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromLeft {
  0% {
    opacity: 0;
    transform: translateX(-100px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromTop {
  0% {
    opacity: 0;
    transform: translateY(-60px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromBottom {
  0% {
    opacity: 0;
    transform: translateY(60px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  0% {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(0) translateY(0);
  }
}

.hero__title.slide-in-right {
  animation: slideInFromRight 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hero__title.slide-in-left {
  animation: slideInFromLeft 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hero__title.slide-in-top {
  animation: slideInFromTop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hero__title.slide-in-bottom {
  animation: slideInFromBottom 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hero__title.fade-out {
  animation: fadeOut 0.5s ease-out forwards;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ================================
   Shared Circle Components
   ================================ */

.circle__content {
  text-align: center;
  z-index: 2;
  position: relative;
}

.circle__icon svg {
  width: 3.4375rem; /* 55px */
  height: 3.4375rem; /* 55px */
  margin-bottom: 1.25rem; /* 20px */
  opacity: 0.75;
}

.circle__title {
  font-size: var(--fs-lg);
  font-family: var(--font-sans);
  color: var(--color-deep-navy);
  margin-bottom: var(--space-sm);
  font-weight: var(--fw-bold);
}

.circle__tagline {
  font-size: var(--fs-xs);
  font-family: var(--font-sans);
  color: rgba(0, 0, 0, 0.55);
  line-height: var(--lh-normal);
}

.circle__text {
  font-family: var(--font-sans);
  font-size: var(--fs-xl);
  font-weight: var(--fw-regular);
  letter-spacing: var(--ls-normal) 0.05em;
  line-height: var(--lh-tight);
}

.circle__logo {
  margin-bottom: 0.625rem; /* var(--space-2xs) */
}

.circle__logo-icon {
  width: 5.625rem; /* var(--space-2xl-lg) */
  height: 5.625rem; /* var(--space-2xl-lg) */
  color: rgba(201, 169, 97, 0.75);
  filter: drop-shadow(0 0.125rem 0.5rem rgba(201, 169, 97, 0.3));
  animation: rotateGentle 20s linear infinite;
}

/* ================================
   Circles Container
   ================================ */

.circles-grid {
  position: relative;
  width: 100%;
  max-width: 68.75rem; /* 1100px */
  height: var(--height-sm); /* 720px */
  margin: 1.25rem auto 0; /* 20px */
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1200px;
}

/* ================================
   Base Circle Styles
   ================================ */

.circle {
  position: absolute;
  width: var(--outer-size);
  height: var(--outer-size);
  padding: 3.125rem; /* 50px */
  border-radius: 50%;
  border: 2px solid rgba(155, 147, 136, 0.22);
  background: rgba(248, 246, 242, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  transform: rotateY(180deg);
  align-items: center;
  text-align: center;
  box-sizing: border-box;
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

/* ================================
   3D Flip Card Styles
   ================================ */

.circle--flip {
  overflow: visible;
  padding: 0 !important;
  perspective: 1000px;
}

.circle__flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transform-style: preserve-3d;
  border-radius: 50%;
}

.circle--flip:hover .circle__flip-inner {
  transform: rotateY(180deg);
}

.circle__flip-front,
.circle__flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  border-radius: 50%;
  top: 0;
  left: 0;
}

.circle__flip-front {
  background: rgba(248, 246, 242, 0.95);
  border: 2px solid rgba(155, 147, 136, 0.22);
  z-index: 100;
  padding: 0;
  flex-wrap: wrap;
}

.circle__flip-front .circle__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.circle__flip-back {
  background: rgba(248, 246, 242, 0.95);
  z-index: 99;
  padding: 1.25rem; /* 20px */
  border: 2px solid rgba(155, 147, 136, 0.22);
  transform: rotateY(180deg);
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.circle__flip-back .circle__image {
  display: none !important;
}

.circle__flip-back .circle__title {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  margin: 0 0 6px 0;
  color: var(--color-charcoal);
  line-height: var(--lh-tight);
  word-wrap: break-word;
  overflow: visible;
  text-overflow: clip;
  text-align: center;
}

.circle__flip-back .circle__desc {
  display: none !important;
}

.circle__flip-back .circle__tagline {
  font-size: var(--fs-xs);
  font-weight: var(--fw-regular);
  color: var(--color-charcoal);
  margin: 0;
  line-height: var(--lh-normal);
  text-align: center;
  max-width: 100%;
  word-wrap: break-word;
  overflow: visible;
}

.circle__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* ================================
   Central Circle (Main)
   ================================ */

.circle--central {
  position: absolute;
  width: var(--center-size);
  height: var(--center-size);
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  background: rgba(27, 58, 82, 0.96);
  color: var(--color-ivory);
  border: none;
  border-radius: 50%;
  box-shadow: 0 var(--space-sm-lg) 35px rgba(0, 0, 0, var(--opacity-md));
  animation: pulse 4.5s ease-in-out infinite;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.circle--central::before {
  content: "";
  position: absolute;
  inset: -var(--space-sm-lg);
  border-radius: 50%;
  border: 2px solid rgba(201, 169, 97, 0.3);
  opacity: 0.85;
}

.circle--central:hover {
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: 0 25px 55px rgba(27, 58, 82, 0.35);
}

/* ================================
   Service Circles
   ================================ */

.circle--service {
  cursor: pointer;
  z-index: 2;
}

.circle--service.circle--flip {
  padding: 0;
}

.circle--service .circle__flip-inner {
  border-radius: 50%;
}

.circle--service .circle__flip-front,
.circle--service .circle__flip-back {
  overflow: hidden;
}

.circle--service .circle__flip-front {
  padding: 0;
}

.circle--service .circle__flip-back {
  padding: 2.5rem; /* var(--space-lg-xl) */
  justify-content: center;
  align-items: center;
}

/* ================================
   Circle Positioning
   ================================ */

.circle--hospitality {
  left: 50%;
  top: 58%;
  transform: translate(-50%, calc(-50% - var(--offset)));
}

.circle--coconut {
  left: 50%;
  top: 58%;
  transform: translate(calc(-50% - var(--offset)), -50%);
}

.circle--doors {
  left: 50%;
  top: 58%;
  transform: translate(calc(-50% + var(--offset)), -50%);
}

/* ================================
   Hover Effect
   ================================ */

.circle--hospitality:hover {
  transform: translate(-50%, calc(-50% - var(--offset))) scale(1.05);
  box-shadow: 0 15px var(--space-lg-xl) rgba(0, 0, 0, var(--opacity-sm));
  border-color: var(--color-gold-accent);
}

.circle--coconut:hover {
  transform: translate(calc(-50% - var(--offset)), -50%) scale(1.05);
  box-shadow: 0 15px var(--space-lg-xl) rgba(0, 0, 0, var(--opacity-sm));
  border-color: var(--color-gold-accent);
}

.circle--doors:hover {
  transform: translate(calc(-50% + var(--offset)), -50%) scale(1.05);
  box-shadow: 0 15px var(--space-lg-xl) rgba(0, 0, 0, var(--opacity-sm));
  border-color: var(--color-gold-accent);
}

.circle--service:hover .circle__flip-inner {
  transform: rotateY(180deg);
}

/* ================================
   Icons Coloring Per Division
   ================================ */

.circle--hospitality .circle__icon {
  color: var(--color-hospitality);
}

.circle--coconut .circle__icon {
  color: var(--color-coconut);
}

.circle--doors .circle__icon {
  color: var(--color-doors);
}

.circle__icon {
  width: var(--height-lg); /* 80px */
  height: var(--height-lg); /* 80px */
  object-fit: contain;
  display: block;
}

/* ================================
   Responsive Design - Homepage
   ================================ */

/* Default: Circles Container for large screens (1500px+) */
.circles-grid {
  height: var(--height-xl); /* 960px */
  margin: 3rem auto 0; /* 48px */
}

.page-home {
  padding-top: 1.25rem;
}

/* Screens below 1500px (93.75rem) - Reduce grid size and spacing */
@media (max-width: 93.75rem) {
  .circles-grid {
    height: var(--height-sm); /* 720px */
    margin: 1.25rem auto 0; /* 20px */
  }

  .page-home {
    padding-top: 6.25rem;
  }
}

/* Desktop to Tablet: 950px (59.375rem) - Vertical circle layout */
@media (max-width: 59.375rem) {
  /* 950px */
  .circles-grid {
    height: auto;
    max-width: 100%;
    margin: 1.25rem auto 0; /* 20px */
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
  }

  .hero__content {
    width: 100%;
    margin-top: 2rem;
    margin-bottom: var(--space-md);
  }

  .hero__title {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    animation: none !important;
    transform: none !important;
  }

  .hero__title.slide-in-right,
  .hero__title.slide-in-left,
  .hero__title.slide-in-top,
  .hero__title.slide-in-bottom,
  .hero__title.fade-out {
    animation: none !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .circle {
    position: relative !important;
    transform: none !important;
    margin: 1.25rem 0; /* 20px */
    width: var(--outer-size);
    height: var(--outer-size);
  }

  .circle--central {
    position: relative !important;
    width: var(--center-size);
    height: var(--center-size);
    top: auto !important;
    left: auto !important;
    transform: none !important;
    margin: 1.25rem auto; /* 20px */
    order: -1;
  }

  .circle--central::before {
    inset: -1.125rem; /* -var(--space-sm-lg) */
  }

  .circle--central:hover {
    transform: scale(1.05);
  }

  .circle--hospitality,
  .circle--coconut,
  .circle--doors {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    width: var(--outer-size);
    height: var(--outer-size);
    margin: 1.25rem 0; /* 20px */
  }

  .circle--hospitality:hover,
  .circle--coconut:hover,
  .circle--doors:hover {
    transform: scale(1.05);
  }

  .footer {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
  }

  .footer__content {
    display: flex !important;
    flex-wrap: nowrap !important;
    white-space: nowrap;
    overflow-x: auto;
    grid-template-columns: unset;
  }

  .footer__bottom {
    white-space: nowrap;
    overflow-x: auto;
  }

  .footer-section {
    flex: 0 0 auto;
    flex-shrink: 0;
    white-space: nowrap;
  }
}

/* Tablet: 900px (56.25rem) - Vertical footer layout */
@media (max-width: 56.25rem) {
  /* 900px */
  .footer__content {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    white-space: normal;
    overflow-x: visible;
    grid-template-columns: unset;
    gap: var(--space-xl);
  }

  .footer__bottom {
    white-space: normal;
    overflow-x: visible;
  }

  .footer-section {
    flex: 0 1 auto;
    flex-shrink: 0;
    white-space: normal;
    text-align: center;
    width: 100%;
  }

  .footer__social-list {
    justify-content: center;
  }
}

/* Mobile: 768px (48rem) - Icon and font size adjustments */
@media (max-width: 48rem) {
  .circle__logo-icon {
    width: 4.375rem; /* 70px */
    height: 4.375rem; /* 70px */
  }

  .circle__text {
    font-size: var(--fs-lg);
  }

  .circle__icon svg {
    width: 2.8125rem; /* 45px */
    height: 2.8125rem; /* 45px */
    margin-bottom: 0.9375rem; /* 15px */
  }

  .circle__title {
    font-size: var(--fs-md);
  }

  .circle__tagline {
    font-size: var(--fs-xs);
  }

  .circle__flip-back .circle__title {
    font-size: var(--fs-xs);
  }

  .circle__flip-back .circle__tagline {
    font-size: var(--fs-xs);
  }
}

/* Small Mobile: 512px (32rem) - Stacked circle layout with responsive positioning */
@media (max-width: 32rem) {
  .circle__logo-icon {
    width: 3.125rem; /* 50px */
    height: 3.125rem; /* 50px */
  }

  .circle__text {
    font-size: var(--fs-md);
  }

  .circle__icon svg {
    width: 1.875rem; /* var(--space-lg-sm) */
    height: 1.875rem; /* var(--space-lg-sm) */
    margin-bottom: 0.625rem; /* var(--space-2xs) */
  }

  .circle__title {
    font-size: var(--fs-xs);
  }

  .circle__tagline {
    font-size: var(--fs-xs);
  }

  .circle__flip-back .circle__title {
    font-size: var(--fs-xs);
  }

  .circle__flip-back .circle__tagline {
    font-size: var(--fs-xs);
  }

  .hero__content {
    margin-bottom: 0.5rem;
    margin-top: 2rem;
  }

  .hero__title {
    font-size: var(--fs-xl);
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    animation: none !important;
    transform: none !important;
  }

  .hero__title.slide-in-right,
  .hero__title.slide-in-left,
  .hero__title.slide-in-top,
  .hero__title.slide-in-bottom,
  .hero__title.fade-out {
    animation: none !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  .circles-grid {
    width: 100%;
    height: var(--height-section-lg);
    max-width: 100%;
    margin: 0.9375rem auto 0; /* 15px */
    padding: 1rem;
  }

  .circle {
    padding: 1.5625rem; /* 25px */
    backdrop-filter: none;
  }

  .circle--central {
    top: 26%;
  }

  .circle--central::before {
    inset: -0.75rem; /* -var(--space-sm) */
  }

  .circle--hospitality {
    left: 50%;
    top: 52%;
    transform: translate(-50%, -50%);
  }

  .circle--coconut {
    left: 50%;
    top: 78%;
    transform: translate(-50%, -50%);
  }

  .circle--doors {
    left: 50%;
    top: 104%;
    transform: translate(-50%, -50%);
  }

  .circle--hospitality:hover,
  .circle--coconut:hover,
  .circle--doors:hover {
    transform: translate(-50%, -50%);
  }

  .circle--service .circle__flip-front {
    padding: 0;
  }

  .circle--service .circle__flip-back {
    padding: 1.25rem; /* 20px */
  }
}

/* ================================
   RTL Support (Arabic) - Homepage
   ================================ */

html[dir="rtl"] .hero__content {
  text-align: right;
}

html[dir="rtl"] .hero__title {
  text-align: center;
}

html[dir="rtl"] .circle__content {
  direction: rtl;
  text-align: center;
}

html[dir="rtl"] .circle__title,
html[dir="rtl"] .circle__tagline {
  direction: rtl;
  text-align: center;
}

html[dir="rtl"] .circles-grid {
  direction: ltr;
}

/* ================================
   Page Load State
   ================================ */

body:not(.loaded) .service-circles,
body:not(.loaded) .services-grid {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}
