/**
 * Nutwise-app - Custom Styles
 * Professional Industrial Design System
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  /* Primary Colors */
  --primary: #0d6efd;
  --primary-dark: #0b5ed7;
  --primary-light: rgba(13, 110, 253, 0.1);
  
  /* Secondary Colors */
  --secondary: #6c757d;
  --secondary-dark: #5c636a;
  
  /* Industrial Colors */
  --industrial-dark: #1a1a2e;
  --industrial-darker: #16213e;
  --industrial-accent: #0f3460;
  --industrial-light: #e9ecef;
  
  /* Accent Colors */
  --success: #198754;
  --warning: #ffc107;
  --danger: #dc3545;
  --info: #0dcaf0;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
  --gradient-dark: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  --gradient-hero: linear-gradient(135deg, #1a1a2e 0%, #0f3460 50%, #16213e 100%);
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.2);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background-color: #f8f9fa;
  color: #212529;
  line-height: 1.6;
  min-height: 100vh;
}

.app-body {
  padding-top: 56px;
}

/* ============================================
   NAVBAR STYLES
   ============================================ */
.navbar {
  backdrop-filter: blur(10px);
  background-color: rgba(26, 26, 46, 0.95) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand-icon {
  font-size: 1.5rem;
  color: var(--primary);
}

.brand-text {
  font-weight: 700;
  font-size: 1.25rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-link {
  font-weight: 500;
  transition: var(--transition-fast);
}

.nav-link:hover {
  color: var(--primary) !important;
}

/* ============================================
   LANDING PAGE STYLES
   ============================================ */
.landing-body {
  background: var(--industrial-dark);
}

.landing-nav {
  transition: var(--transition-normal);
}

.landing-nav.scrolled {
  background-color: rgba(26, 26, 46, 0.98) !important;
  box-shadow: var(--shadow-md);
}

/* Hero Section */
.hero-section {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-hero);
  z-index: 0;
}

.hero-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-image-container {
  position: relative;
  z-index: 1;
}

.hero-mockup {
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px;
  max-width: 400px;
  margin: 0 auto;
}

.mockup-header {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.mockup-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.mockup-dot:first-child { background: #ff5f56; }
.mockup-dot:nth-child(2) { background: #ffbd2e; }
.mockup-dot:last-child { background: #27ca40; }

.mockup-content {
  display: flex;
  gap: 20px;
  align-items: center;
}

.fastener-preview {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fastener-preview i {
  font-size: 2.5rem;
  color: var(--primary);
}

.spec-lines {
  flex: 1;
}

.spec-line {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  margin-bottom: 8px;
}

.spec-line.short { width: 60%; }
.spec-line.medium { width: 80%; }

/* Floating Cards */
.floating-card {
  position: absolute;
  background: white;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: float 3s ease-in-out infinite;
  z-index: 2;
}

.floating-card i {
  font-size: 1.5rem;
}

.floating-card.card-1 {
  top: 20%;
  right: 10%;
  animation-delay: 0s;
}

.floating-card.card-2 {
  top: 50%;
  left: 5%;
  animation-delay: 1s;
}

.floating-card.card-3 {
  bottom: 20%;
  right: 15%;
  animation-delay: 2s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Feature Cards */
.feature-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 30px;
  border: 1px solid var(--industrial-light);
  transition: var(--transition-normal);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.feature-icon i {
  font-size: 1.75rem;
  color: white;
}

.feature-icon.bg-primary-gradient { background: var(--gradient-primary); }
.feature-icon.bg-success-gradient { background: linear-gradient(135deg, #198754 0%, #157347 100%); }
.feature-icon.bg-warning-gradient { background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%); }
.feature-icon.bg-danger-gradient { background: linear-gradient(135deg, #dc3545 0%, #bb2d3b 100%); }
.feature-icon.bg-info-gradient { background: linear-gradient(135deg, #0dcaf0 0%, #0aa2c0 100%); }
.feature-icon.bg-secondary-gradient { background: linear-gradient(135deg, #6c757d 0%, #5c636a 100%); }

/* Step Cards */
.step-card {
  padding: 40px 30px;
}

.step-number {
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 20px;
}

.step-icon {
  width: 80px;
  height: 80px;
  background: var(--primary-light);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.step-icon i {
  font-size: 2.5rem;
  color: var(--primary);
}

/* ============================================
   PRICING CARDS
   ============================================ */
.pricing-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 30px;
  border: 2px solid var(--industrial-light);
  transition: var(--transition-normal);
  position: relative;
}

.pricing-card.featured {
  border-color: var(--primary);
  transform: scale(1.05);
}

.pricing-card.current {
  border-color: var(--success);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--primary);
  color: white;
}

.pricing-price {
  text-align: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--industrial-light);
  margin-bottom: 20px;
}

.pricing-price .currency {
  font-size: 1.25rem;
  vertical-align: top;
}

.pricing-price .amount {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--industrial-dark);
}

.pricing-price .period {
  color: var(--secondary);
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 30px;
}

.pricing-features li {
  padding: 10px 0;
  border-bottom: 1px solid var(--industrial-light);
}

.pricing-features li:last-child {
  border-bottom: none;
}

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-page {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  padding: 40px 0;
}

.min-vh-75 {
  min-height: 75vh;
}

.auth-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.brand-icon-large {
  font-size: 3rem;
  color: var(--primary);
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--industrial-light);
}

.auth-divider span {
  padding: 0 15px;
  color: var(--secondary);
  font-size: 0.875rem;
}

/* ============================================
   DASHBOARD STYLES
   ============================================ */
.upgrade-banner {
  background: linear-gradient(135deg, #0f3460 0%, #1a1a2e 100%);
  border-radius: var(--radius-lg);
  padding: 20px 30px;
}

/* Stat Cards */
.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon i {
  font-size: 1.5rem;
}

.stat-icon.bg-primary-light { background: rgba(13, 110, 253, 0.1); }
.stat-icon.bg-success-light { background: rgba(25, 135, 84, 0.1); }
.stat-icon.bg-warning-light { background: rgba(255, 193, 7, 0.1); }
.stat-icon.bg-info-light { background: rgba(13, 202, 240, 0.1); }

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--industrial-dark);
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--secondary);
  margin: 0;
}

/* Project Cards */
.project-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: var(--transition-normal);
  border: 1px solid transparent;
}

.project-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 20px 0;
}

.project-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-icon i {
  font-size: 1.25rem;
  color: var(--primary);
}

.project-body {
  padding: 15px 20px;
  flex: 1;
}

.project-title {
  font-weight: 600;
  margin-bottom: 5px;
}

.project-description {
  font-size: 0.875rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-stats {
  margin-top: 15px;
}

.project-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-top: 1px solid var(--industrial-light);
  background: var(--industrial-light);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: var(--radius-lg);
}

.empty-icon {
  width: 80px;
  height: 80px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.empty-icon i {
  font-size: 2.5rem;
  color: var(--primary);
}

/* ============================================
   SCANNER STYLES
   ============================================ */
.scanner-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.camera-container {
  position: relative;
  min-height: 400px;
  background: #000;
}

#cameraPreview {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

.camera-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--industrial-dark);
}

.camera-placeholder-content {
  text-align: center;
  color: white;
}

.camera-placeholder-content i {
  font-size: 4rem;
  margin-bottom: 15px;
  display: block;
}

.camera-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

/* Upload Zone */
.upload-container {
  padding: 30px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.upload-zone {
  border: 2px dashed var(--industrial-light);
  border-radius: var(--radius-lg);
  padding: 60px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-normal);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-content i {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 15px;
}

.upload-preview {
  text-align: center;
}

.upload-preview img {
  max-width: 100%;
  max-height: 300px;
  border-radius: var(--radius-md);
  margin-bottom: 15px;
}

.preview-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.spinner-border-lg {
  width: 3rem;
  height: 3rem;
}

/* Tips & Features Cards */
.tips-card,
.features-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tips-header,
.features-header {
  background: var(--industrial-light);
  padding: 15px 20px;
  font-weight: 600;
}

.tips-list {
  list-style: none;
  padding: 20px;
  margin: 0;
}

.tips-list li {
  padding: 8px 0;
  font-size: 0.875rem;
}

.features-list {
  padding: 15px;
}

.feature-item {
  display: flex;
  align-items: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 5px;
}

.feature-item.available {
  background: rgba(25, 135, 84, 0.05);
}

.feature-item.locked {
  background: rgba(108, 117, 125, 0.05);
}

.feature-item i {
  margin-right: 10px;
}

/* ============================================
   RESULT PAGE STYLES
   ============================================ */
.result-image-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.result-image {
  background: var(--industrial-dark);
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-image img {
  max-width: 100%;
  max-height: 400px;
}

.result-image-info {
  padding: 15px;
  border-top: 1px solid var(--industrial-light);
}

.confidence-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 15px;
  box-shadow: var(--shadow-sm);
}

/* Spec Card */
.spec-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.spec-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: var(--industrial-light);
  border-bottom: 1px solid var(--industrial-light);
}

.spec-section {
  padding: 20px;
  border-bottom: 1px solid var(--industrial-light);
}

.spec-section:last-child {
  border-bottom: none;
}

.spec-section-title {
  font-weight: 600;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

.spec-table {
  display: flex;
  flex-direction: column;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--industrial-light);
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-label {
  font-weight: 500;
  color: var(--secondary);
}

.spec-value {
  font-weight: 500;
}

.spec-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.875rem;
}

/* Locked Section */
.locked-section {
  position: relative;
}

.spec-locked {
  padding: 30px;
  text-align: center;
  background: rgba(108, 117, 125, 0.05);
  border-radius: var(--radius-md);
}

.locked-content i {
  font-size: 2rem;
  color: var(--secondary);
  margin-bottom: 10px;
}

.locked-content p {
  color: var(--secondary);
  margin-bottom: 15px;
}

.spec-notes {
  background: var(--industrial-light);
  padding: 15px;
  border-radius: var(--radius-md);
  font-style: italic;
}

/* ============================================
   FASTENER CARD
   ============================================ */
.fastener-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.fastener-card:hover {
  box-shadow: var(--shadow-md);
}

.fastener-image {
  height: 150px;
  background: var(--industrial-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.fastener-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fastener-placeholder {
  width: 60px;
  height: 60px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fastener-placeholder i {
  font-size: 1.5rem;
  color: var(--primary);
}

.fastener-body {
  padding: 15px;
}

.fastener-title {
  font-weight: 600;
  margin-bottom: 10px;
}

.fastener-specs {
  margin-bottom: 10px;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  padding: 3px 0;
}

.fastener-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fastener-footer {
  padding: 10px 15px;
  border-top: 1px solid var(--industrial-light);
  text-align: right;
}

/* ============================================
   ERROR PAGE
   ============================================ */
.error-page {
  padding: 80px 0;
  text-align: center;
}

.error-code {
  font-size: 8rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--industrial-dark) !important;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */
@media (max-width: 991.98px) {
  .floating-card {
    display: none;
  }
  
  .pricing-card.featured {
    transform: none;
  }
  
  .hero-section {
    text-align: center;
  }
  
  .hero-image-container {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .auth-card {
    padding: 25px;
  }
  
  .stat-card {
    flex-direction: column;
    text-align: center;
  }
  
  .project-footer {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  
  .camera-container {
    min-height: 300px;
  }
  
  #cameraPreview {
    height: 300px;
  }
  
  .upload-zone {
    padding: 40px 15px;
  }
  
  .error-code {
    font-size: 5rem;
  }
  
  .spec-row {
    flex-direction: column;
    gap: 5px;
  }
}

@media (max-width: 575.98px) {
  .upgrade-banner {
    text-align: center;
  }
  
  .upgrade-banner .row {
    text-align: center;
  }
  
  .upgrade-banner .text-md-end {
    text-align: center !important;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-white-50 {
  color: rgba(255, 255, 255, 0.5) !important;
}

.scroll-link {
  cursor: pointer;
}

/* Tab Styles */
.nav-tabs {
  border-bottom: 2px solid var(--industrial-light);
}

.nav-tabs .nav-link {
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--secondary);
}

.nav-tabs .nav-link:hover {
  border-color: transparent;
  border-bottom-color: var(--primary);
  color: var(--primary);
}

.nav-tabs .nav-link.active {
  color: var(--primary);
  background: transparent;
  border-color: transparent;
  border-bottom-color: var(--primary);
}
