/**
 * MakeAIHQ Component Styles
 * Replaces Svelte-generated CSS with clean, maintainable vanilla CSS
 */

/* ============================================================================
   NAVIGATION COMPONENTS
   ============================================================================ */

/* Dropdown Menu */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  transition: color 0.2s;
}

.nav-dropdown-trigger:hover {
  color: #D4AF37;
}

.nav-dropdown-trigger svg {
  transition: transform 0.2s;
}

.nav-dropdown.open .nav-dropdown-trigger svg {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #0A0E27;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.5rem 0;
  min-width: 200px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 1000;
}

.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  display: block;
  padding: 0.75rem 1rem;
  color: #E8E9ED;
  transition: background 0.2s, color 0.2s;
}

.nav-dropdown-menu a:hover {
  background: rgba(212, 175, 55, 0.1);
  color: #D4AF37;
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #E8E9ED;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-menu-btn svg {
  transition: transform 0.2s;
}

.mobile-menu-btn.open svg {
  transform: rotate(90deg);
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: #0A0E27;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 2rem;
    flex-direction: column;
    gap: 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
    max-height: calc(100vh - 72px);
    overflow-y: auto;
  }

  .nav-links.mobile-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

/* ============================================================================
   TAB SYSTEM
   ============================================================================ */

.feature-tabs,
.template-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  overflow-x: auto;
}

.feature-tab,
.template-tab {
  background: none;
  border: none;
  color: #A0A0A0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.feature-tab:hover,
.template-tab:hover {
  color: #D4AF37;
}

.feature-tab.active,
.template-tab.active {
  color: #D4AF37;
  border-bottom-color: #D4AF37;
}

.feature-tab svg,
.template-tab svg {
  width: 20px;
  height: 20px;
}

.feature-content-item,
.template-content-item {
  display: none;
  animation: fadeIn 0.3s;
}

.feature-content-item.active,
.template-content-item.active {
  display: grid !important;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
}

@media (max-width: 1024px) {
  .feature-content-item.active,
  .template-content-item.active {
    grid-template-columns: 1fr;
  }
}

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

/* ============================================================================
   ACCORDION / FAQ
   ============================================================================ */

.faq-item,
.accordion-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem 0;
  transition: background 0.2s;
}

.faq-item h3,
.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
}

.faq-item h3::after,
.accordion-header::after {
  content: '+';
  font-size: 1.5rem;
  color: #D4AF37;
  transition: transform 0.2s;
}

.faq-item.open h3::after,
.accordion-item.open .accordion-header::after {
  transform: rotate(45deg);
}

.faq-item:hover h3,
.accordion-item:hover .accordion-header {
  color: #D4AF37;
}

.accordion-content {
  margin-top: 1rem;
  color: #A0A0A0;
  line-height: 1.8;
}

/* ============================================================================
   FORM COMPONENTS
   ============================================================================ */

input.invalid,
textarea.invalid {
  border-color: #ff4444 !important;
}

input.valid,
textarea.valid {
  border-color: #44ff44 !important;
}

.error-message {
  color: #ff4444;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: block;
}

/* Form focus states */
input:focus,
textarea:focus {
  outline: none;
  border-color: #D4AF37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* ============================================================================
   INTERACTIVE STATES
   ============================================================================ */

/* Hover transitions */
.btn,
.cta-primary,
.cta-secondary,
.nav-cta,
button,
a[role="button"] {
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}

.btn:hover,
.cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.4);
}

.cta-secondary:hover,
.nav-cta:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Card hover effects */
.capability-card,
.pricing-card,
.template-card,
.resource-card,
.testimonial-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.capability-card:hover,
.pricing-card:hover,
.template-card:hover,
.resource-card:hover,
.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(212, 175, 55, 0.2);
}

/* Active states */
.active {
  color: #D4AF37;
}

/* ============================================================================
   LOADING STATES
   ============================================================================ */

.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #D4AF37;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Slide up animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Pulse animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Apply animations to elements */
.animate-fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.animate-slide-up {
  animation: slideUp 0.5s ease-in-out;
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.hidden {
  display: none !important;
}

.visible {
  display: block !important;
}

.fade-in {
  animation: fadeIn 0.3s;
}

.slide-up {
  animation: slideUp 0.3s;
}

/* ============================================================================
   RESPONSIVE UTILITIES
   ============================================================================ */

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
}
