/* CrankForge Custom Styles */
/* Extends Tailwind with custom animations and effects */

/* ===== CSS Custom Properties ===== */
:root {
  --forge-dark: #0d0d0d;
  --forge-charcoal: #1a1a1a;
  --forge-steel: #2d2d2d;
  --forge-copper: #b87333;
  --forge-copper-light: #d4956a;
  --forge-copper-dark: #8b5a2b;
  --forge-ember: #ff6b35;
  --forge-spark: #ffd700;
  --forge-silver: #a8a8a8;
  --forge-iron: #6b6b6b;
  --forge-graphite: #404040;
}

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

/* ===== Selection Color ===== */
::selection {
  background-color: var(--forge-copper);
  color: white;
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--forge-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--forge-steel);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--forge-copper);
}

/* ===== Product Card Hover Effects ===== */
.product-card {
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5),
              0 0 40px rgba(184, 115, 51, 0.15);
}

.product-card .card-image {
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.product-card:hover .card-image {
  transform: scale(1.1);
}

/* ===== Button Styles ===== */
.btn-primary {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, var(--forge-copper) 0%, var(--forge-copper-dark) 100%);
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 107, 53, 0.4);
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-secondary {
  position: relative;
  transition: all 0.3s ease;
  border: 2px solid var(--forge-copper);
}

.btn-secondary:hover {
  background-color: var(--forge-copper);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(184, 115, 51, 0.3);
}

/* ===== Navigation Link Underline Animation ===== */
.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--forge-copper), var(--forge-ember));
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--forge-copper);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link.active::after {
  width: 100%;
}

/* ===== Metallic Shimmer Effect ===== */
.metal-shimmer {
  position: relative;
  overflow: hidden;
}

.metal-shimmer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -150%;
  width: 150%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 100%
  );
  transform: skewX(-20deg);
  transition: left 0.7s ease;
}

.metal-shimmer:hover::before {
  left: 150%;
}

/* ===== Ember Glow Effect ===== */
.ember-glow {
  position: relative;
}

.ember-glow::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  height: 150%;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    ellipse at center,
    rgba(255, 107, 53, 0.15) 0%,
    transparent 70%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.ember-glow:hover::after {
  opacity: 1;
}

/* ===== Feature Card Styles ===== */
.feature-card {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.feature-card:hover {
  transform: translateY(-8px);
  background-color: var(--forge-steel);
}

.feature-card .feature-icon {
  transition: all 0.4s ease;
}

.feature-card:hover .feature-icon {
  transform: scale(1.1);
  color: var(--forge-ember);
}

/* ===== Gradient Text ===== */
.gradient-text {
  background: linear-gradient(135deg, var(--forge-copper-light) 0%, var(--forge-copper) 50%, var(--forge-ember) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Hero Background Layers ===== */
.hero-bg-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-texture {
  background-image: url('/images/textures/metal-texture.png');
  opacity: 0.05;
  background-size: cover;
}

.hero-gradient {
  background: radial-gradient(
    ellipse at 50% 100%,
    rgba(255, 107, 53, 0.1) 0%,
    transparent 50%
  );
}

.hero-vignette {
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    rgba(13, 13, 13, 0.8) 100%
  );
}

/* ===== Scroll Indicator Animation ===== */
.scroll-indicator {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0) translateX(-50%);
  }
  40% {
    transform: translateY(-15px) translateX(-50%);
  }
  60% {
    transform: translateY(-7px) translateX(-50%);
  }
}

/* ===== Navbar Transition ===== */
.navbar {
  transition: background-color 0.3s ease,
              backdrop-filter 0.3s ease,
              box-shadow 0.3s ease;
}

.navbar.scrolled {
  background-color: rgba(13, 13, 13, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* ===== Mobile Menu Animation ===== */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mobile-menu.open {
  transform: translateX(0);
}

/* ===== Hamburger Animation ===== */
.hamburger span {
  transition: all 0.3s ease;
}

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

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

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

/* ===== Section Divider ===== */
.section-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--forge-steel) 20%,
    var(--forge-copper) 50%,
    var(--forge-steel) 80%,
    transparent 100%
  );
}

/* ===== Image Loading State ===== */
.img-loading {
  background: linear-gradient(
    90deg,
    var(--forge-charcoal) 0%,
    var(--forge-steel) 50%,
    var(--forge-charcoal) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ===== Form Input Styles ===== */
.form-input {
  transition: all 0.3s ease;
  border: 2px solid var(--forge-steel);
  background-color: var(--forge-charcoal);
}

.form-input:focus {
  border-color: var(--forge-copper);
  box-shadow: 0 0 20px rgba(184, 115, 51, 0.2);
  outline: none;
}

.form-input::placeholder {
  color: var(--forge-iron);
}

/* ===== Timeline Styles ===== */
.timeline-item {
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--forge-copper), var(--forge-steel));
}

.timeline-item::after {
  content: '';
  position: absolute;
  left: -6px;
  top: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--forge-copper);
  border: 3px solid var(--forge-dark);
}

/* ===== Accordion Styles ===== */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.accordion-content.open {
  max-height: 500px;
}

.accordion-icon {
  transition: transform 0.3s ease;
}

.accordion-btn.open .accordion-icon {
  transform: rotate(180deg);
}

/* ===== Tooltip ===== */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 8px 12px;
  background: var(--forge-charcoal);
  color: var(--forge-silver);
  font-size: 0.875rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  border: 1px solid var(--forge-steel);
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ===== Responsive Utilities ===== */
@media (max-width: 768px) {
  .product-card:hover {
    transform: translateY(-6px);
  }

  .feature-card:hover {
    transform: translateY(-4px);
  }
}

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

  html {
    scroll-behavior: auto;
  }
}
