/* FirstLab Enhanced - Modern Responsive Design System */

/* =============================================================
   RESET AND BASE STYLES
   ============================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  line-height: 1.6;
  color: var(--ink, #1F2454);
  background: var(--surface, #FAFBFF);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =============================================================
   MODERN SPLASH SCREEN
   ============================================================= */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--grad-hero-green, linear-gradient(135deg, #1B4332 0%, #2B2E83 50%, #6C4CF1 100%));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.splash-content {
  text-align: center;
  max-width: 90%;
  width: 400px;
}

.splash-logo {
  width: 80px;
  height: 80px;
  background: var(--white, #FFFFFF);
  border-radius: var(--r-xl, 16px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--sp-lg, 24px);
  animation: scaleIn 0.6s ease-out;
  box-shadow: var(--shadow-lg);
}

.logo-icon {
  font-size: 2.5rem;
  animation: sparkle 2s ease-in-out infinite;
}

.splash-wordmark {
  font-size: var(--text-4xl, 2.25rem);
  font-weight: 800;
  color: var(--white, #FFFFFF);
  margin-bottom: var(--sp-md, 16px);
  animation: slideUp 0.8s ease-out 0.2s both;
  font-family: 'Space Grotesk', sans-serif;
}

.splash-tagline {
  font-size: var(--text-lg, 1.125rem);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--sp-2xl, 48px);
  animation: slideUp 0.8s ease-out 0.4s both;
}

.splash-loader {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--r-full, 9999px);
  overflow: hidden;
  margin: 0 auto;
  animation: slideUp 0.8s ease-out 0.6s both;
}

.splash-hint {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 1rem;
  opacity: 0;
  animation: fadeIn 1s ease-in-out 2s forwards;
}

.splash-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-bar {
  width: 100%;
  height: 100%;
  background: var(--grad-logo, linear-gradient(135deg, #6C4CF1 0%, #A78BFA 50%, #57B6FF 100%));
  border-radius: var(--r-full);
  animation: loading 2s ease-in-out infinite;
}

@keyframes loading {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* =============================================================
   APP CONTAINER
   ============================================================= */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =============================================================
   RESPONSIVE HEADER
   ============================================================= */
.main-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border, #E5DEFF);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-lg, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-md, 16px);
}

.header-logo {
  width: 48px;
  height: 48px;
  background: var(--grad-logo-green);
  border-radius: var(--r-lg, 12px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.header-wordmark {
  font-size: var(--text-xl, 1.25rem);
  font-weight: 700;
  color: var(--ink, #1F2454);
  font-family: 'Space Grotesk', sans-serif;
}

/* Desktop Navigation */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-xs, 4px);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--sp-sm, 8px);
  padding: var(--sp-sm, 8px) var(--sp-md, 16px);
  border: none;
  background: none;
  border-radius: var(--r-md, 12px);
  color: var(--muted, #68709C);
  font-size: var(--text-sm, 0.875rem);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--violet, #6C4CF1);
  background: var(--mist, #F3EEFF);
}

.nav-link.active {
  color: var(--violet, #6C4CF1);
  background: var(--mist, #F3EEFF);
}

.nav-icon {
  font-size: 1rem;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-sm, 8px);
}

.action-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--surface, #FAFBFF);
  border-radius: var(--r-md, 12px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: var(--mist, #F3EEFF);
  transform: translateY(-1px);
}

.btn-icon {
  font-size: 1.125rem;
}

.btn-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--error, #EF4444);
  color: var(--white, #FFFFFF);
  font-size: var(--text-xs, 0.75rem);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--r-full, 9999px);
  min-width: 18px;
  text-align: center;
  display: none;
}

.btn-badge.show {
  display: block;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px;
  gap: 3px;
}

.hamburger-line {
  width: 100%;
  height: 2px;
  background: var(--ink, #1F2454);
  border-radius: 1px;
  transition: all 0.2s ease;
}

/* Mobile Navigation */
.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white, #FFFFFF);
  border-top: 1px solid var(--border, #E5DEFF);
  padding: var(--sp-md, 16px);
  box-shadow: var(--shadow-lg);
}

.mobile-nav.show {
  display: block;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: var(--sp-md, 16px);
  width: 100%;
  padding: var(--sp-md, 16px);
  border: none;
  background: none;
  border-radius: var(--r-md, 12px);
  color: var(--muted, #68709C);
  font-size: var(--text-base, 1rem);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-nav-link:hover {
  color: var(--violet, #6C4CF1);
  background: var(--mist, #F3EEFF);
}

/* =============================================================
   MAIN CONTENT
   ============================================================= */
.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--sp-xl, 32px) var(--sp-lg, 24px);
  width: 100%;
}

.screen {
  display: none;
  min-height: calc(100vh - 200px);
}

.screen.active {
  display: block;
}

/* =============================================================
   MODERN HERO SECTION
   ============================================================= */
.hero-section {
  margin-bottom: var(--sp-2xl, 48px);
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-xl, 32px);
  align-items: center;
}

.hero-text {
  text-align: center;
}

.hero-kicker {
  display: inline-block;
  background: rgba(108, 76, 241, 0.12);
  color: var(--violet-dark, #5538D4);
  border: 1px solid var(--border, #E5DEFF);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: var(--sp-md, 16px);
}

.hero-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: var(--sp-md, 16px);
}

.hero-title-logo {
  width: 70px;
  height: 70px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 6px 12px rgba(31, 36, 84, 0.18));
}

.hero-headline {
  font-size: var(--text-4xl, 2.25rem);
  font-weight: 800;
  color: var(--ink, #1F2454);
  margin-bottom: 0;
  line-height: 1.2;
  font-family: 'Space Grotesk', sans-serif;
}

.hero-emphasis {
  background: var(--grad-hero-green);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: var(--text-lg, 1.125rem);
  color: var(--muted, #68709C);
  margin-bottom: var(--sp-xl, 32px);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md, 16px);
  align-items: center;
  margin-bottom: var(--sp-md, 16px);
}

.hero-proof {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-proof-item {
  font-size: 0.8rem;
  color: var(--muted, #68709C);
  border: 1px solid var(--border, #E5DEFF);
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--white, #FFFFFF);
}

.hero-visual {
  position: relative;
  display: block;
  max-width: 560px;
  margin: 0 auto;
}

.hero-image-frame {
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border, #E5DEFF);
  box-shadow: 0 16px 34px rgba(31, 36, 84, 0.16);
  background: var(--white, #FFFFFF);
}

.hero-image {
  width: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 16 / 9;
}

.hero-image-caption {
  font-size: 0.84rem;
  color: var(--muted, #68709C);
  padding: 10px 14px;
  background: linear-gradient(180deg, #fff, #f7f5ff);
}

.hero-stat-card {
  position: absolute;
  display: grid;
  gap: 2px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border, #E5DEFF);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 10px 12px;
}

.hero-stat-card-top {
  top: 10px;
  right: -10px;
}

.hero-stat-card-bottom {
  left: -10px;
  bottom: 52px;
}

.hero-stat-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--forest, #1B4332);
}

.hero-stat-label {
  font-size: 0.72rem;
  color: var(--muted, #68709C);
}

.hero-visual-strip {
  margin: 4px 0 var(--sp-2xl, 48px);
}

.visual-strip-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.visual-strip-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border, #E5DEFF);
  min-height: 180px;
  background: var(--white, #fff);
  box-shadow: 0 10px 22px rgba(31, 36, 84, 0.12);
}

.visual-strip-image {
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
  display: block;
}

.visual-strip-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(15, 40, 24, 0.04) 0%, rgba(15, 40, 24, 0.82) 100%);
  color: var(--white, #fff);
}

.visual-strip-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 2px;
}

.visual-strip-text {
  font-size: 0.78rem;
  opacity: 0.95;
  line-height: 1.4;
}

/* =============================================================
   BUTTONS
   ============================================================= */
.btn-primary, .btn-secondary, .btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-sm, 8px);
  padding: var(--sp-md, 16px) var(--sp-lg, 24px);
  border: none;
  border-radius: var(--r-lg, 12px);
  font-size: var(--text-base, 1rem);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  min-height: 48px;
}

.btn-large {
  padding: var(--sp-lg, 24px) var(--sp-xl, 32px);
  font-size: var(--text-lg, 1.125rem);
  min-height: 56px;
}

.btn-primary {
  background: var(--grad-logo-green);
  color: var(--white, #FFFFFF);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--white, #FFFFFF);
  color: var(--violet, #6C4CF1);
  border: 2px solid var(--violet, #6C4CF1);
}

.btn-secondary:hover {
  background: var(--mist, #F3EEFF);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--violet, #6C4CF1);
  border: 2px solid var(--violet, #6C4CF1);
}

.btn-outline:hover {
  background: var(--violet, #6C4CF1);
  color: var(--white, #FFFFFF);
}

/* =============================================================
   SCORE SECTION
   ============================================================= */
.score-section {
  margin-bottom: var(--sp-2xl, 48px);
}

.score-container {
  background: var(--white, #FFFFFF);
  border-radius: var(--r-xl, 16px);
  padding: var(--sp-xl, 32px);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border, #E5DEFF);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-lg, 24px);
}

.score-visual {
  position: relative;
  width: 80px;
  height: 80px;
}

.score-ring {
  position: relative;
  width: 80px;
  height: 80px;
}

.score-svg {
  transform: rotate(-90deg);
}

.score-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.score-number {
  display: block;
  font-size: var(--text-2xl, 1.5rem);
  font-weight: 800;
  color: var(--ink, #1F2454);
  line-height: 1;
}

.score-label {
  font-size: var(--text-xs, 0.75rem);
  color: var(--muted, #68709C);
  font-weight: 500;
}

.score-info {
  text-align: center;
}

.score-title {
  font-size: var(--text-xl, 1.25rem);
  font-weight: 600;
  color: var(--ink, #1F2454);
  margin-bottom: var(--sp-sm, 8px);
}

.score-description {
  color: var(--muted, #68709C);
  margin-bottom: var(--sp-md, 16px);
}

/* =============================================================
   QUICK ACTIONS
   ============================================================= */
.quick-actions-section {
  margin-bottom: var(--sp-2xl, 48px);
}

.section-title {
  font-size: var(--text-2xl, 1.5rem);
  font-weight: 700;
  color: var(--ink, #1F2454);
  margin-bottom: var(--sp-lg, 24px);
  text-align: center;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-md, 16px);
}

.quick-action-card {
  background: var(--white, #FFFFFF);
  border: 1px solid var(--border, #E5DEFF);
  border-radius: var(--r-lg, 12px);
  padding: var(--sp-lg, 24px);
  display: flex;
  align-items: center;
  gap: var(--sp-md, 16px);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  border: none;
}

.quick-action-card:hover {
  border-color: var(--violet, #6C4CF1);
  background: var(--mist, #F3EEFF);
  transform: translateY(-1px);
}

.quick-action-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.quick-action-title {
  font-size: var(--text-lg, 1.125rem);
  font-weight: 600;
  color: var(--ink, #1F2454);
  margin-bottom: var(--sp-xs, 4px);
}

.quick-action-desc {
  font-size: var(--text-sm, 0.875rem);
  color: var(--muted, #68709C);
}

/* =============================================================
   PREVIEW SECTIONS
   ============================================================= */
.preview-section {
  margin-bottom: var(--sp-2xl, 48px);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-lg, 24px);
}

.view-all-btn {
  background: none;
  border: none;
  color: var(--violet, #6C4CF1);
  font-size: var(--text-sm, 0.875rem);
  font-weight: 500;
  cursor: pointer;
  padding: var(--sp-sm, 8px);
  border-radius: var(--r-md, 12px);
  transition: all 0.2s ease;
}

.view-all-btn:hover {
  background: var(--mist, #F3EEFF);
}

.preview-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-md, 16px);
}

/* =============================================================
   SCREEN HEADERS
   ============================================================= */
.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-xl, 32px);
  padding-bottom: var(--sp-md, 16px);
  border-bottom: 1px solid var(--border, #E5DEFF);
}

.screen-title {
  font-size: var(--text-3xl, 1.875rem);
  font-weight: 800;
  color: var(--ink, #1F2454);
  font-family: 'Space Grotesk', sans-serif;
}

.filter-toggle {
  background: var(--white, #FFFFFF);
  border: 1px solid var(--border, #E5DEFF);
  border-radius: var(--r-md, 12px);
  padding: var(--sp-sm, 8px) var(--sp-md, 16px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-toggle:hover {
  background: var(--mist, #F3EEFF);
}

/* =============================================================
   RESPONSIVE DESIGN - TABLET
   ============================================================= */
@media (min-width: 768px) {
  .header-container {
    padding: 0 var(--sp-xl, 32px);
  }
  
  .main-content {
    padding: var(--sp-2xl, 48px) var(--sp-xl, 32px);
  }
  
  .hero-content {
    grid-template-columns: 2fr 1fr;
    gap: var(--sp-2xl, 48px);
  }
  
  .hero-text {
    text-align: left;
  }

  .hero-title-row {
    justify-content: flex-start;
    gap: 18px;
  }

  .hero-title-logo {
    width: 92px;
    height: 92px;
  }
  
  .hero-headline {
    font-size: var(--text-5xl, 3rem);
  }
  
  .hero-actions {
    flex-direction: row;
    justify-content: flex-start;
  }

  .hero-proof {
    justify-content: flex-start;
  }

  .hero-stat-card-top {
    right: -18px;
  }

  .hero-stat-card-bottom {
    left: -18px;
  }

  .visual-strip-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .visual-strip-card,
  .visual-strip-image {
    min-height: 168px;
  }
  
  .score-container {
    flex-direction: row;
    align-items: center;
    text-align: left;
  }
  
  .score-info {
    text-align: left;
  }
  
  .quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =============================================================
   RESPONSIVE DESIGN - DESKTOP
   ============================================================= */
@media (min-width: 1024px) {
  .header-container {
    max-width: 1200px;
    margin: 0 auto;
  }
  
  .main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--sp-2xl, 48px);
  }
  
  .hero-title-logo {
    width: 108px;
    height: 108px;
  }

  .hero-headline {
    font-size: var(--text-6xl, 3.75rem);
  }
  
  .hero-subtitle {
    font-size: var(--text-xl, 1.25rem);
  }
  
  .quick-actions-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .preview-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =============================================================
   MOBILE NAVIGATION - SHOW/HIDE
   ============================================================= */
@media (max-width: 768px) {
  .desktop-nav {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .main-content {
    padding-top: var(--sp-xl, 32px);
  }

  .hero-title-row {
    align-items: flex-start;
  }

  .hero-title-logo {
    width: 64px;
    height: 64px;
  }
}

/* =============================================================
   ANIMATIONS
   ============================================================= */
@keyframes scaleIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sparkle {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.1) rotate(5deg);
  }
}

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

/* Focus styles */
.nav-link:focus,
.action-btn:focus,
.btn-primary:focus,
.btn-secondary:focus,
.btn-outline:focus {
  outline: 2px solid var(--violet, #6C4CF1);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .btn-primary {
    border: 2px solid var(--violet-dark, #5538D4);
  }
  
  .btn-secondary,
  .btn-outline {
    border-width: 3px;
  }
}