/* ========================================
   HABERIC LAB Inc. - Corporate Website
   Custom Styles (Tailwind CSS Supplement)
   ======================================== */

/* CSS Variables (Design Tokens) */
:root {
  /* Brand Colors */
  --color-primary: #21305C;     /* Navy Blue - HABERIC LAB Logo */
  --color-secondary: #94B595;   /* Sage Green - Growth & Nature */
  --color-accent-pink: #FFB6C1; /* Soft Pink - Qulmia warmth */
  --color-accent-orange: #FFD4A3; /* Soft Orange */

  /* Neutral Colors */
  --color-white: #FFFFFF;
  --color-gray-50: #F9FAFB;
  --color-gray-100: #F3F4F6;
  --color-gray-200: #E5E7EB;
  --color-gray-600: #4B5563;
  --color-gray-900: #111827;

  /* Typography */
  --font-sans: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Poppins', 'Noto Sans JP', sans-serif;

  /* Spacing */
  --container-max-width: 1200px;
  --section-padding-y: 80px;

  /* Transitions */
  --transition-base: all 0.3s ease;
}

/* ========================================
   Base Styles
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-gray-900);
  line-height: 1.7;
  background-color: var(--color-white);
}

/* Container */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Section Spacing */
.section {
  padding: var(--section-padding-y) 0;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-primary);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1.25rem;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
}

/* ========================================
   Header & Navigation
   ======================================== */
.site-header {
  background-color: var(--color-white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition-base);
}

.site-header.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  max-width: var(--container-max-width);
  margin: 0 auto;
}

.logo {
  height: 50px;
  transition: var(--transition-base);
}

.logo:hover {
  opacity: 0.8;
}

.nav-menu {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-menu a {
  color: var(--color-gray-900);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition-base);
  position: relative;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-secondary);
  transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

.nav-menu a:hover {
  color: var(--color-primary);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--color-primary);
  margin: 5px 0;
  transition: var(--transition-base);
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    right: -100%;
    width: 100%;
    max-width: 300px;
    height: calc(100vh - 70px);
    background-color: var(--color-white);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
  }

  .nav-menu.active {
    right: 0;
  }

  .menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
  }

  /* Hero adjustments for mobile */
  .hero {
    min-height: 350px;
  }

  .hero-content {
    padding: 1.5rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Transparent background - images will be set via JavaScript */
  background: transparent;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--color-white);
  overflow: hidden;
  transition: background 1.5s ease-in-out;
}

/* Animated background layer for slideshow effect */
.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Use CSS variable for dynamic background control from JavaScript */
  background: var(--hero-bg, transparent);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 1;
  /* Smooth fade transition */
  transition: opacity 1.5s ease-in-out;
  /* No initial scale - images display at normal size */
  transform: scale(1.0);
  z-index: 0;
}

/* Fade out effect */
.hero.fade-out::after {
  opacity: 0;
}

/* Fade in effect */
.hero.fade-in::after {
  opacity: 1;
}

/* Pan effect - slow horizontal movement */
.hero.pan-left::after {
  animation: panLeft 7s ease-out forwards;
}

.hero.pan-right::after {
  animation: panRight 7s ease-out forwards;
}

/* Dark overlay removed - images have enough contrast */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: 2rem;
}

.hero h1 {
  color: var(--color-white);
  margin-bottom: 1.5rem;
  /* Enhanced text shadow with corporate navy blue glow for better visibility */
  text-shadow:
    0 0 20px rgba(33, 48, 92, 0.9),
    0 0 40px rgba(33, 48, 92, 0.7),
    0 2px 15px rgba(0, 0, 0, 0.6),
    0 4px 25px rgba(0, 0, 0, 0.4);
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.95;
  /* Enhanced text shadow with corporate navy blue glow for better visibility */
  text-shadow:
    0 0 15px rgba(33, 48, 92, 0.8),
    0 0 30px rgba(33, 48, 92, 0.6),
    0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Enhanced button visibility in hero section */
.hero .btn {
  box-shadow:
    0 0 20px rgba(33, 48, 92, 0.6),
    0 4px 15px rgba(0, 0, 0, 0.3);
}

.hero .btn:hover {
  box-shadow:
    0 0 30px rgba(33, 48, 92, 0.8),
    0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Page-specific hero backgrounds */
/* TODO: Replace all images with AI-generated photos */
.hero-about {
  background-image: url('../images/hero-about.jpg');
}

.hero-services {
  background-image: url('../images/hero-services.jpg');
}

.hero-company {
  background-image: url('../images/hero-company.jpg');
}

.hero-contact {
  background-image: url('../images/hero-contact.jpg');
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: var(--transition-base);
  cursor: pointer;
  border: 2px solid transparent;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--color-secondary);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: #7fa380;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(148, 181, 149, 0.3);
}

.btn-secondary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn-secondary:hover {
  background-color: #2A4073;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(33, 48, 92, 0.3);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}

.btn-outline:hover {
  background-color: var(--color-white);
  color: var(--color-primary);
}

/* ========================================
   Cards
   ======================================== */
.card {
  background-color: var(--color-white);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: var(--transition-base);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.card h3 {
  margin-bottom: 1rem;
}

.card-icon {
  width: 60px;
  height: 60px;
  background-color: var(--color-gray-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--color-primary);
  font-size: 1.5rem;
}

/* ========================================
   Grid System
   ======================================== */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ========================================
   Form Styles
   ======================================== */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--color-gray-900);
}

.form-label.required::after {
  content: ' *';
  color: #EF4444;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--color-gray-200);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: var(--transition-base);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(148, 181, 149, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 150px;
}

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.form-checkbox input[type="checkbox"] {
  margin-top: 0.25rem;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.form-error {
  color: #EF4444;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
  background-color: var(--color-primary);
  color: var(--color-white);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  color: var(--color-white);
  font-size: 1.125rem;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
  transition: var(--transition-base);
}

.footer-links a:hover {
  color: var(--color-secondary);
  padding-left: 5px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  opacity: 0.8;
}

/* ========================================
   Utility Classes
   ======================================== */
.text-center {
  text-align: center;
}

.text-primary {
  color: var(--color-primary);
}

.text-secondary {
  color: var(--color-secondary);
}

.bg-gray {
  background-color: var(--color-gray-50);
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

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

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

/* Scroll animations (will be triggered by JavaScript) */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Hero slideshow pan animations */
@keyframes panLeft {
  from {
    transform: scale(1.05) translateX(0);
  }
  to {
    transform: scale(1.05) translateX(-3%);
  }
}

@keyframes panRight {
  from {
    transform: scale(1.05) translateX(0);
  }
  to {
    transform: scale(1.05) translateX(3%);
  }
}
