/* ========================================
   Unified Hover Animation System
   
   This file manages all hover animations across the site
   to ensure consistency and maintainability.
   ======================================== */

/* ========================================
   1. Animation Variables
   ======================================== */
:root {
  /* Transition Durations */
  --hover-duration-fast: 0.2s;
  --hover-duration-normal: 0.3s;
  --hover-duration-slow: 0.4s;
  
  /* Easing Functions */
  --hover-ease-sharp: cubic-bezier(0.4, 0, 0.2, 1);
  --hover-ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --hover-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* Transform Values */
  --hover-lift-small: translateY(-2px);
  --hover-lift-medium: translateY(-4px);
  --hover-lift-large: translateY(-6px);
  
  --hover-scale-subtle: scale(1.01);
  --hover-scale-normal: scale(1.02);
  --hover-scale-prominent: scale(1.05);
  
  /* Shadow Values */
  --hover-shadow-subtle: 0 4px 12px rgba(0, 0, 0, 0.1);
  --hover-shadow-normal: 0 8px 24px rgba(0, 0, 0, 0.15);
  --hover-shadow-elevated: 
    0 12px 32px rgba(0, 0, 0, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.1);
  --hover-shadow-glass: 
    inset 0 0 0 0.5px var(--glass-highlight),
    0 8px 24px rgba(0, 0, 0, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ========================================
   2. Card Hover Animations
   ======================================== */

/* Primary Card Hover - Used for main content cards */
.liquid-card,
.contract-project-card,
.app-icon-item {
  transition: 
    transform var(--hover-duration-normal) var(--hover-ease-smooth),
    box-shadow var(--hover-duration-normal) var(--hover-ease-smooth),
    border-color var(--hover-duration-normal) var(--hover-ease-smooth);
}

.liquid-card:hover,
.contract-project-card:hover,
.app-icon-item:hover {
  transform: var(--hover-lift-medium) var(--hover-scale-normal);
  box-shadow: var(--hover-shadow-glass);
  border-color: rgba(255, 190, 100, 0.3);
}

/* Card Icon Animations */
.liquid-card:hover .card-icon:not(:has(.product-card-logo)) {
  background: linear-gradient(135deg, 
    rgba(255, 190, 100, 0.25) 0%,
    rgba(255, 190, 100, 0.15) 50%,
    rgba(255, 190, 100, 0.1) 100%
  );
  border-color: rgba(255, 190, 100, 0.5);
  box-shadow: 
    0 0 20px rgba(255, 190, 100, 0.2),
    inset 0 0 10px rgba(255, 190, 100, 0.1);
}

.liquid-card:hover .card-icon svg {
  color: var(--app-yellow-light);
  transform: scale(1.15);
  filter: drop-shadow(0 2px 6px rgba(255, 190, 100, 0.4));
}

/* ========================================
   3. Button Hover Animations
   ======================================== */

/* Glass Buttons */
.glass-button {
  transition: 
    transform var(--hover-duration-fast) var(--hover-ease-sharp),
    background var(--hover-duration-fast) var(--hover-ease-sharp),
    box-shadow var(--hover-duration-fast) var(--hover-ease-sharp),
    border-color var(--hover-duration-fast) var(--hover-ease-sharp);
}

.glass-button:hover {
  transform: var(--hover-lift-small);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--hover-shadow-normal);
}

.glass-button-primary:hover {
  transform: var(--hover-lift-small);
  background: linear-gradient(135deg, var(--app-yellow-light), var(--app-yellow));
  box-shadow: 
    0 8px 24px rgba(255, 190, 100, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Category Buttons */
.category-btn {
  transition: 
    color var(--hover-duration-fast) var(--hover-ease-sharp),
    background var(--hover-duration-fast) var(--hover-ease-sharp);
}

.category-btn:hover {
  color: var(--text-high);
}

/* Card Action Links */
.card-link {
  transition: 
    color var(--hover-duration-fast) var(--hover-ease-sharp),
    transform var(--hover-duration-fast) var(--hover-ease-sharp);
}

.card-link:hover {
  color: var(--app-yellow-light);
  transform: translateX(4px);
}

/* ========================================
   4. Navigation Hover Animations
   ======================================== */

/* Nav Links */
.nav-link {
  transition: 
    color var(--hover-duration-fast) var(--hover-ease-sharp),
    transform var(--hover-duration-fast) var(--hover-ease-sharp);
}

.nav-link:hover {
  color: var(--app-yellow);
  transform: translateY(-1px);
}

/* Nav Brand */
.nav-brand {
  transition: 
    transform var(--hover-duration-normal) var(--hover-ease-bounce),
    filter var(--hover-duration-normal) var(--hover-ease-smooth);
}

.nav-brand:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

/* ========================================
   5. Interactive Elements
   ======================================== */

/* Hero Stats - Removed shadow transitions */
.stat-item {
  transition: none;
}

/* Removed stat-item hover animation */

/* Modal Tabs */
.modal-tab {
  transition: 
    color var(--hover-duration-fast) var(--hover-ease-sharp),
    opacity var(--hover-duration-fast) var(--hover-ease-sharp);
}

.modal-tab:hover {
  color: var(--text-medium);
  opacity: 1;
}

/* Close Buttons - 汎用モーダル用のみ（製品モーダルは除外） */
.modal-overlay:not(#detailModal) .modal-close {
  transition: 
    transform var(--hover-duration-fast) var(--hover-ease-sharp),
    background var(--hover-duration-fast) var(--hover-ease-sharp),
    border-color var(--hover-duration-fast) var(--hover-ease-sharp);
}

.modal-overlay:not(#detailModal) .modal-close:hover {
  background: rgba(255, 190, 100, 0.2);
  border-color: var(--app-yellow);
  transform: scale(1.1);
}

/* ========================================
   6. Form Elements
   ======================================== */

input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
  transition: 
    border-color var(--hover-duration-fast) var(--hover-ease-sharp),
    box-shadow var(--hover-duration-fast) var(--hover-ease-sharp);
}

input:not([type="checkbox"]):not([type="radio"]):hover,
textarea:hover,
select:hover {
  border-color: rgba(255, 190, 100, 0.4);
}

input:not([type="checkbox"]):not([type="radio"]):focus,
textarea:focus,
select:focus {
  border-color: var(--app-yellow);
  box-shadow: 0 0 0 2px rgba(255, 190, 100, 0.2);
}

/* ========================================
   7. Special Effects
   ======================================== */

/* Glow Effect for Important Elements */
.glow-hover {
  transition: 
    box-shadow var(--hover-duration-normal) var(--hover-ease-smooth),
    filter var(--hover-duration-normal) var(--hover-ease-smooth);
}

.glow-hover:hover {
  box-shadow: 
    0 0 30px rgba(255, 190, 100, 0.3),
    0 0 60px rgba(255, 190, 100, 0.1);
  filter: brightness(1.05);
}

/* Pulse Animation for CTAs */
@keyframes pulse-hover {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.pulse-hover:hover {
  animation: pulse-hover 1s infinite;
}

/* ========================================
   8. Touch Device Optimization
   ======================================== */

@media (hover: none) and (pointer: coarse) {
  /* Disable hover transforms on touch devices */
  .liquid-card:hover,
  .contract-project-card:hover,
  .app-icon-item:hover,
  .glass-button:hover,
  .nav-link:hover,
  .stat-item:hover {
    transform: none !important;
  }
  
  /* Add active states for touch feedback */
  .liquid-card:active,
  .contract-project-card:active,
  .app-icon-item:active {
    transform: scale(0.98) !important;
  }
  
  .glass-button:active {
    transform: scale(0.95) !important;
  }
  
  .stat-item:active {
    transform: scale(0.97) !important;
  }
}

/* ========================================
   9. Reduced Motion Support
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ========================================
   10. Hover State Classes
   ======================================== */

/* Utility classes for JavaScript-controlled hover states */
.hover-lift {
  transform: var(--hover-lift-medium) !important;
}

.hover-scale {
  transform: var(--hover-scale-normal) !important;
}

.hover-glow {
  box-shadow: var(--hover-shadow-glass) !important;
}

.no-hover {
  pointer-events: none !important;
}

/* ========================================
   11. Modal Close Button Fix
   ======================================== */

/* 閉じるボタン – modal-unified.cssで統一管理するため、ここでは削除 */
/* #detailModal .modal-close のスタイルは modal-unified.css を参照 */