/* Custom CSS for 公共工事メンテナンス会社 Website */

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Navigation Scrolled State */
#mainNav.scrolled {
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  color: #0f172a;
}

#mainNav.scrolled .logo,
#mainNav.scrolled ul li a:not(.bg-accent) {
  color: #0f172a;
}

#mainNav.scrolled #mobileMenuToggle {
  color: #0f172a;
}

/* Form Validation Styles */
.form-group.error input,
.form-group.error textarea,
.form-group.error select {
  border-color: #ef4444;
}

.form-group.error .error-message {
  display: block;
}

.error-message {
  margin-top: 0.25rem;
}

/* FAQ Accordion - Disabled (Using Modal Instead) */
/* .faq-item .faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  transition: max-height 0.5s ease-in;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
} */

/* FAQ Item Hover Effect */
.faq-item:hover {
  background-color: rgba(30, 64, 175, 0.02);
}

/* Utility Classes */
.container {
  max-width: 1280px;
}

/* Link Hover Effects */
a {
  transition: all 0.3s ease;
}

/* Button Hover Effects */
button, .btn {
  transition: all 0.3s ease;
}

/* Image Loading */
img {
  transition: opacity 0.3s ease;
}

img[loading="lazy"] {
  opacity: 0;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* Custom Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Menu Transition */
#mobileMenu {
  transition: all 0.3s ease;
}

/* Hero Section Gradient Overlay */
#hero .bg-gradient-to-r {
  background: linear-gradient(to right, rgba(30, 58, 138, 0.8), rgba(30, 64, 175, 0.6));
}

/* Stats Counter Animation */
@keyframes countUp {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Card Hover Effects */
.shadow-lg {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.shadow-lg:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: translateY(-4px);
}

/* Responsive Typography */
@media (max-width: 640px) {
  body {
    font-size: 14px;
  }
}

/* Print Styles */
@media print {
  nav, footer {
    display: none;
  }

  section {
    page-break-inside: avoid;
  }
}

/* Accessibility: Focus Styles */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Dark Mode Support (Optional - for future enhancement) */
@media (prefers-color-scheme: dark) {
  /* Uncomment if dark mode support is needed in the future */
  /* body {
    background-color: #0f172a;
    color: #f8fafc;
  } */
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  body {
    font-weight: 500;
  }

  button, a {
    text-decoration: underline;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Timeline Styles */
.timeline-item {
  transition: transform 0.3s ease;
}

.timeline-item:hover {
  transform: translateY(-2px);
}

/* Google Maps レスポンシブ対応 */
iframe[src*="google.com/maps"] {
  width: 100%;
  min-height: 300px;
}

/* タイムライン最後のアイテムの線を非表示 */
.timeline-line:last-child {
  display: none;
}

/* ===========================
   Modal Styles
   =========================== */

/* Modal Overlay */
#modalOverlay {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Modal Animations */
#modalOverlay.modal-fade-in {
  animation: fadeIn 0.3s ease-out;
}

#modalOverlay.modal-fade-out {
  animation: fadeOut 0.3s ease-out;
}

#modalContent.modal-scale-in {
  animation: scaleIn 0.3s ease-out;
}

#modalContent.modal-scale-out {
  animation: scaleOut 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scaleOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

/* Modal Content Scrollbar Styling */
#modalContent {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

#modalContent::-webkit-scrollbar {
  width: 8px;
}

#modalContent::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

#modalContent::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

#modalContent::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Modal Responsive */
@media (max-width: 768px) {
  #modalContent {
    max-width: 95vw;
  }

  #modalBody {
    padding: 1.5rem;
  }
}

/* ===========================
   Contact Form Modal Optimization
   =========================== */

/* Ensure modal content doesn't exceed viewport height */
#modalContent {
  max-height: 90vh;
  overflow-y: auto;
}

/* モーダル内のフォームを2カラムからモバイルで1カラムに */
@media (max-width: 1023px) {
  #modalContent .grid.lg\:grid-cols-2 {
    grid-template-columns: 1fr !important;
  }
}

/* モーダル内のフォームフィールドのフォントサイズ調整（モバイル） */
@media (max-width: 768px) {
  #modalContent input,
  #modalContent textarea,
  #modalContent select {
    font-size: 14px;
  }
}
