@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
}

@layer utilities {
  .btn {
    @apply px-4 py-2 rounded border border-transparent transition-all duration-200 hover:border hover:bg-gray-100 font-light;
  }

  .btn-primary {
    @apply text-blue-600 hover:border-blue-600 hover:bg-blue-600 hover:text-white;
  }

  .btn-primary-border {
    @apply text-blue-600 border-blue-600 hover:bg-blue-600 hover:text-white;
  }

  .btn-ers-primary-border {
    @apply text-[#295a60] border-[#295a60] hover:bg-[#295a60] hover:text-white;
  }

  .btn-secondary {
    @apply flex justify-center py-3 px-4 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500;
  }

  .btn-ers-secondary {
    @apply text-[#b4965e] border-[#b4965e] hover:bg-[#b4965e] hover:text-white;
  }

  .btn-danger {
    @apply text-red-600 hover:border-red-600 hover:bg-red-600 hover:text-white;
  }

  .btn-form-submit {
    @apply btn w-full inline-flex justify-center rounded-md py-2 px-4 font-medium text-white bg-blue-600 hover:text-white focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 hover:bg-blue-600 hover:border-blue-600;
  }
}

.trix-button-group {
  background-color: #fff;
}

/* Flip Card Styles */
.flip-card {
  background-color: transparent;
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* Professional hover effects */
.elegant-hover {
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.elegant-hover::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #b4965e, #295a60);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.elegant-hover:hover::after {
  width: 100%;
}

/* Subtle lift effect */
.subtle-lift {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.subtle-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* Professional image overlay */
.image-overlay {
  position: relative;
  overflow: hidden;
}

.image-overlay::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.image-overlay:hover::before {
  opacity: 1;
}

.image-overlay img {
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-overlay:hover img {
  transform: scale(1.05);
}

/* Smooth reveal animations for GSAP */
.fade-up,
.reveal-text,
.stagger-item,
.reveal-image,
.split-left,
.split-right {
  opacity: 0;
}

/* Elegant gradient backgrounds */
.elegant-gradient {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 50%, #f8f9fa 100%);
}

.elegant-gradient-dark {
  background: linear-gradient(135deg, #1d4045 0%, #295a60 100%);
}

/* Modern section dividers */
.section-divider {
  position: relative;
}

.section-divider::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #b4965e, #295a60);
  border-radius: 2px;
}

/* Professional button styles */
.btn-professional {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-weight: 500;
  letter-spacing: 0.025em;
  overflow: hidden;
}

.btn-professional::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #b4965e, #295a60);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.btn-professional:hover::before {
  opacity: 1;
}

/* Elegant text underline */
.elegant-underline {
  position: relative;
  display: inline-block;
}

.elegant-underline::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #b4965e 0%, #295a60 100%);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.elegant-underline:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Parallax container */
.parallax-container {
  position: relative;
  overflow: hidden;
}

/* Professional grid item */
.grid-item {
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.grid-item:hover {
  z-index: 10;
}

/* Elegant border */
.elegant-border {
  position: relative;
}

.elegant-border::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: inherit;
  transition: border-color 0.3s ease;
}

.elegant-border:hover::before {
  border-color: rgba(180, 150, 94, 0.3);
}

/* Smooth page transitions */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-enter {
  animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Professional focus states */
.focus-elegant:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(180, 150, 94, 0.2);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #b4965e 0%, #295a60 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding-bottom: 0.1em;
  display: inline-block;
}

/* Professional form inputs */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #b4965e;
  box-shadow: 0 0 0 3px rgba(180, 150, 94, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Horizontal scroll carousel */
.horizontal-scroll-wrapper {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.horizontal-scroll-container {
  display: flex;
  gap: 2rem;
  padding: 0 max(2rem, calc((100vw - 1280px) / 2));
  will-change: transform;
}

.scroll-card {
  flex-shrink: 0;
  width: min(600px, 90vw);
  height: 500px;
  border-radius: 0.5rem;
  overflow: hidden;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-card:hover {
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .horizontal-scroll-wrapper {
    overflow: visible;
  }

  .horizontal-scroll-container {
    flex-direction: column;
    padding: 0 1.5rem;
    gap: 1.5rem;
    transform: none !important;
  }

  .scroll-card {
    width: 100% !important;
    height: auto;
    min-height: 450px;
    flex-shrink: 1;
    transform: none !important;
  }

  .scroll-card > a,
  .scroll-card > a > .image-overlay {
    min-height: 450px;
  }

  /* Fix GSAP animation transforms on mobile */
  .split-left,
  .split-right,
  .reveal-text,
  .fade-up,
  .stagger-item {
    transform: none !important;
    opacity: 1 !important;
  }
}
