/* ============================================================
   TechieNova - Optimized Stylesheet - Professional Corporate Theme
   Clean, minimal, black-white-blue design
   ============================================================ */

/* Root CSS Variables */
:root {
  /* Smooth scrolling behavior */
  --techienova-scroll-behavior: smooth;
  
  /* Spacing System (8px base) */
  --spacing-xs: 0.5rem;    /* 8px */
  --spacing-sm: 1rem;      /* 16px */
  --spacing-md: 1.5rem;    /* 24px */
  --spacing-lg: 2rem;      /* 32px */
  --spacing-xl: 3rem;      /* 48px */
  --spacing-2xl: 4rem;     /* 64px */
  
  /* Shadow Scale - Professional depth hierarchy */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  /* Typography Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  
  /* Line Heights - Optimal readability */
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  --line-height-loose: 2;
  
  /* Brand Colors - Professional Blue/White/Black */
  --color-primary: #2563eb; /* Professional blue */
  --color-primary-dark: #1d4ed8; /* Darker blue */
  --color-primary-light: #dbeafe; /* Light blue */
  --color-secondary: #2563eb; /* Unified to blue */
  --color-success: #059669; /* Professional green */
  --color-warning: #d97706; /* Professional orange */
  --color-danger: #dc2626; /* Professional red */
  --color-text-primary: #111827; /* Near black */
  --color-text-secondary: #4b5563; /* Charcoal */
  --color-border: #e5e7eb; /* Light gray */
  
  /* Transition Timing */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: var(--text-base);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: #ffffff;
}

/* ============================================================
   Typography Optimizations - Clean and Professional
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: inherit;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: var(--line-height-tight);
  margin: 0;
  color: var(--color-text-primary);
}

h1 {
  font-size: var(--text-4xl);
  font-weight: 800;
  margin-bottom: var(--spacing-md);
}

h2 {
  font-size: var(--text-3xl);
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  margin-top: var(--spacing-lg);
}

h3 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

h4 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

h5 {
  font-size: var(--text-lg);
  font-weight: 600;
}

h6 {
  font-size: var(--text-base);
  font-weight: 600;
}

p {
  line-height: var(--line-height-normal);
  margin-bottom: var(--spacing-sm);
}

small, .text-sm {
  font-size: var(--text-sm);
}

code, pre {
  font-family: 'Monaco', 'Courier New', monospace;
}

/* ============================================================
   Custom Animations - Minimal and Professional
   Only essential transitions, no decorative animations
   ============================================================ */

/* ============================================================
   Component-Specific Styles
   ============================================================ */

/* Page Sections - Standardized Padding */
.page-section {
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
  margin-top: 0;
  margin-bottom: 0;
}

.main-section {
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
  margin-top: 0;
  margin-bottom: 0;
}

/* Hero Section */
.hero-section {
  position: relative;
  overflow: hidden;
  padding: var(--spacing-xl) var(--spacing-md);
  background: #ffffff;
}

.hero-background {
  position: absolute;
  inset: 0;
  background: #ffffff;
  z-index: -1;
}

/* Marketplace Cards */
.marketplace-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 8px;
  background: white;
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
}

.marketplace-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

/* Card Grid - Responsive Layout */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--spacing-md);
  width: 100%;
}

.card {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  transition: all var(--transition-normal);
  border: 1px solid var(--color-border);
  background: white;
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--color-primary);
}

/* Buttons - Clean Professional Style */
.btn-primary {
  background: var(--color-primary);
  color: white;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  transition: all var(--transition-fast);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  font-size: var(--text-base);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary:disabled {
  background: #d1d5db;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: white;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  transition: all var(--transition-fast);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  font-size: var(--text-base);
}

.btn-secondary:hover {
  background: var(--color-primary-light);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.btn-secondary:active {
  transform: translateY(1px);
}

.btn-secondary:disabled {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
}

button:active {
  transform: scale(0.98);
}

/* Forms */
input,
textarea,
select {
  transition: all var(--transition-fast);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.625rem 0.875rem;
  font-family: inherit;
  font-size: var(--text-base);
  color: var(--color-text-primary);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  border-color: var(--color-primary);
  background-color: #fafaf9;
}

input:disabled,
textarea:disabled,
select:disabled {
  background-color: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

/* Icon System - Consistent Sizing */
.icon-xs { width: 0.75rem; height: 0.75rem; }
.icon-sm { width: 1rem; height: 1rem; }
.icon-md { width: 1.5rem; height: 1.5rem; }
.icon-lg { width: 2rem; height: 2rem; }
.icon-xl { width: 2.5rem; height: 2.5rem; }
.icon-2xl { width: 3rem; height: 3rem; }

[data-feather],
.fa-solid,
.fa-regular,
.fas,
.far {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ============================================================
   Accessibility & Utilities
   ============================================================ */

/* Skip to content link */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-to-content:focus {
  top: 0;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: more) {
  body {
    background-color: #fafafa;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode support (future) */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
}

/* ============================================================
   Responsive Utilities
   ============================================================ */

/* ============================================================
   How It Works Section - Clean Professional Design
   ============================================================ */

#how-it-works-section {
  background: #ffffff;
  position: relative;
  overflow: hidden;
}

/* Header styling - SCOPED to first div only */
#how-it-works-section > div > div:first-child h2 {
  color: var(--color-text-primary) !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  line-height: 1.2 !important;
}

/* Step titles - SCOPED to cards only */
#how-it-works-section .group h3 {
  color: var(--color-text-primary) !important;
  font-weight: 700 !important;
  font-size: 1.25rem !important;
  letter-spacing: -0.01em !important;
}

/* Section paragraphs - SCOPED properly */
#how-it-works-section > div > div:first-child p {
  color: var(--color-text-secondary) !important;
  line-height: 1.6 !important;
}

#how-it-works-section .group p {
  color: var(--color-text-secondary) !important;
  line-height: 1.6 !important;
}

/* Card styling - Professional feel */
#how-it-works-section .group {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
}

#how-it-works-section .group:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

/* SVG icons - SCOPED to group only */
#how-it-works-section .group svg {
  display: inline-block;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--color-primary);
}

/* List items - SCOPED to group only */
#how-it-works-section .group ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

#how-it-works-section .group li {
  color: var(--color-text-secondary) !important;
  font-weight: 500 !important;
  line-height: 1.6 !important;
  transition: all 0.2s ease;
  margin-bottom: 0.5rem;
}

#how-it-works-section .group li:hover {
  color: var(--color-primary);
  transform: translateX(2px);
}

/* CTA Buttons */
#how-it-works-section .bg-gradient-to-r,
#how-it-works-section button {
  background: var(--color-primary) !important;
  color: white !important;
  border: none !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#how-it-works-section .bg-gradient-to-r:hover,
#how-it-works-section button:hover {
  background: var(--color-primary-dark) !important;
  transform: translateY(-1px);
}

/* Box shadow for depth */
#how-it-works-section .shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.1) !important;
}

#how-it-works-section .hover\:shadow-2xl:hover {
  box-shadow: 0 20px 40px -10px rgba(37, 99, 235, 0.15) !important;
}

/* Responsive typography */
@media (max-width: 768px) {
  #how-it-works-section {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }
  
  #how-it-works-section h2 {
    font-size: 1.875rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
  }
  
  #how-it-works-section h3 {
    font-size: 1.125rem;
  }
  
  #how-it-works-section p {
    font-size: 0.95rem;
  }
  
  #how-it-works-section .md\:translate-y-8 {
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  #how-it-works-section {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }
  
  #how-it-works-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }
  
  #how-it-works-section h3 {
    font-size: 1rem;
  }
  
  #how-it-works-section p {
    font-size: 0.9rem;
  }
  
  #how-it-works-section li {
    font-size: 0.9rem;
  }
  
  #how-it-works-section .gap-8 {
    gap: 1.5rem;
  }
  
  #how-it-works-section .space-y-4 > li + li {
    margin-top: 0.75rem;
  }
  
  #how-it-works-section .px-10 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  
  #how-it-works-section .py-4 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }
}

@media (max-width: 640px) {
  .page-section,
  .main-section {
    padding-left: var(--spacing-sm);
    padding-right: var(--spacing-sm);
  }
  
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  
  .card-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }
  
  .sm\:flex-col { flex-direction: column; }
  .sm\:w-full { width: 100%; }
  .sm\:px-4 { padding-left: 1rem; padding-right: 1rem; }
  .sm\:py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
  
  input, textarea, select {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .md\:flex-row { flex-direction: row; }
  
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
}

@media (min-width: 1025px) {
  .page-section,
  .main-section {
    padding-left: var(--spacing-xl);
    padding-right: var(--spacing-xl);
  }
  
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

/* Mobile menu adjustments */
@media (max-width: 768px) {
  #mobile-menu {
    padding: var(--spacing-md);
  }
  
  #mobile-menu a {
    padding: var(--spacing-md) var(--spacing-sm);
  }
}

/* ============================================================
   Performance Optimizations
   ============================================================ */

/* Prevent layout shift */
html {
  scroll-padding-top: 80px;
}

/* GPU acceleration for animations */
.animate-in {
  will-change: transform, opacity;
}

/* Remove will-change after animation */
.animate-in.animate-done {
  will-change: auto;
}

/* ============================================================
   Print Styles
   ============================================================ */

@media print {
  body {
    background-color: white;
    color: black;
  }
  
  a {
    text-decoration: underline;
  }
  
  a[href]:after {
    content: " (" attr(href) ")";
  }
}

/* Message Options Menu - Professional UX */

/* Message wrapper hover state */
.message-wrapper {
  position: relative;
  transition: background-color 0.15s ease-in-out;
}

.message-wrapper:hover {
  background-color: rgba(243, 244, 246, 0.5);
  border-radius: 0.5rem;
}

/* Message options button */
.message-wrapper .group-hover\:opacity-100 {
  transition: opacity 0.15s ease-in-out;
}

/* Options container positioning */
.message-wrapper > div[data-message-id] {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* Options button styling */
.message-wrapper button[title="Message options"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  color: #64748b;
  background-color: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.875rem;
}

.message-wrapper button[title="Message options"]:hover {
  color: var(--color-primary);
  background-color: var(--color-primary-light);
}

.message-wrapper button[title="Message options"]:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Options menu dropdown */
.message-wrapper div[role="menu"] {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 50;
  overflow: hidden;
}

.message-wrapper div[role="menu"].hidden {
  display: none;
}

/* Menu item styling */
.message-wrapper button[role="menuitem"] {
  width: 100%;
  padding: 0.5rem 1rem;
  text-align: left;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  background-color: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.15s ease-in-out;
}

.message-wrapper button[role="menuitem"]:hover:not(:disabled) {
  background-color: #f9fafb;
  color: var(--color-primary);
}

.message-wrapper button[role="menuitem"]:focus {
  background-color: #f9fafb;
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

/* Danger menu items (delete) */
.message-wrapper button[role="menuitem"].text-red-600 {
  color: var(--color-danger);
}

.message-wrapper button[role="menuitem"].text-red-600:hover:not(:disabled) {
  background-color: #fee2e2;
}

/* Disabled menu items */
.message-wrapper button[role="menuitem"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.message-wrapper button[role="menuitem"]:disabled:hover {
  background-color: transparent;
}

/* Menu icons */
.message-wrapper button[role="menuitem"] i {
  font-size: 0.75rem;
  width: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Toast notification styling */
.fixed.bottom-4.right-4 {
  animation: slideInToast 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInToast {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
