/**
 * ELSPINA EYEZ - Custom Styles
 * Tailwind CSS CDN で対応できないカスタムスタイルを定義
 */

/* ========================================
   Base Styles
   ======================================== */

html {
  scroll-behavior: smooth;
}

/* ========================================
   Background Patterns
   ======================================== */

.bg-grid {
  background-image:
    linear-gradient(rgba(0, 102, 179, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 102, 179, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.bg-grid-dark {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ========================================
   Header Styles
   ======================================== */

#header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ========================================
   Hero Section
   ======================================== */

.hero-bg {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 1) 0%,
    rgba(248, 250, 252, 1) 50%,
    rgba(241, 245, 249, 1) 100%
  );
}

/* ========================================
   Animations
   ======================================== */

.fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger delays for sequential animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* ========================================
   Scroll Animations
   ======================================== */

.scroll-fade-in,
.scroll-slide-up,
.scroll-slide-left,
.scroll-slide-right {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-fade-in {
  transform: translateY(0);
}

.scroll-slide-up {
  transform: translateY(30px);
}

.scroll-slide-left {
  transform: translateX(30px);
}

.scroll-slide-right {
  transform: translateX(-30px);
}

.scroll-fade-in.is-visible,
.scroll-slide-up.is-visible,
.scroll-slide-left.is-visible,
.scroll-slide-right.is-visible {
  opacity: 1;
  transform: translate(0, 0);
}

/* Stagger delays for children */
.stagger-children > *:nth-child(1) { transition-delay: 0s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children > *:nth-child(6) { transition-delay: 0.3s; }

/* ========================================
   Service Cards
   ======================================== */

.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0066b3 0%, #0073e6 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.service-card:hover::before {
  transform: scaleX(1);
}

/* ========================================
   Form Styles
   ======================================== */

input:focus,
textarea:focus,
select:focus {
  outline: none;
}

/* Custom focus ring */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 102, 179, 0.15);
}

/* ========================================
   Utility Classes
   ======================================== */

/* Smooth image loading */
img {
  opacity: 1;
  transition: opacity 0.3s ease;
}

img[data-src] {
  opacity: 0;
}

/* Selection color */
::selection {
  background: rgba(0, 102, 179, 0.2);
  color: inherit;
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 768px) {
  .hero-bg {
    min-height: auto;
    padding-top: 100px;
    padding-bottom: 60px;
  }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
  .fade-in,
  .scroll-fade-in,
  .scroll-slide-up,
  .scroll-slide-left,
  .scroll-slide-right {
    opacity: 1 !important;
    transform: none !important;
  }
  
  header,
  footer {
    display: none;
  }
}
