/* ==========================================================================
   Sample Laboratory - Main Stylesheet
   ========================================================================== */

/* CSS Variables */
:root {
  --bg: #ffffff;
  --surface: #f8f9fa;
  --surface2: #e9ecef;
  --text: #212529;
  --text-muted: #6c757d;
  --border: #dee2e6;
  --accent: #1d4ed8;
  --accent-dim: rgba(29, 78, 216, 0.1);
  --accent-hover: #1e40af;
  --radius: 12px;
  --radius-sm: 6px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --header-h: 72px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #07080c;
  --surface: #12151a;
  --surface2: #1a1e26;
  --text: #eef0f5;
  --text-muted: #9ca3af;
  --border: #2a2e38;
  --accent: #3b82f6;
  --accent-dim: rgba(59, 130, 246, 0.1);
  --accent-hover: #60a5fa;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  transition: background-color var(--transition), color var(--transition);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Header
   ========================================================================== */

#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background-color: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: all var(--transition);
}

#header.scrolled {
  box-shadow: var(--shadow);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  transition: opacity var(--transition);
}

.logo:hover {
  opacity: 0.8;
}

.logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.logo-text {
  display: inline-block;
}

/* Navigation */
.nav-desktop {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 0;
  position: relative;
  transition: color var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--accent);
}

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Language Switcher */
.lang-switcher {
  position: relative;
}

.btn-lang {
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background-color: var(--surface);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.btn-lang:hover {
  background-color: var(--surface2);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition);
  min-width: 120px;
}

.lang-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-menu button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  font-size: 14px;
  background-color: transparent;
  transition: background-color var(--transition);
}

.lang-menu button:hover {
  background-color: var(--surface2);
}

/* Theme Toggle */
.btn-theme {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--surface);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.btn-theme:hover {
  background-color: var(--surface2);
}

.icon-sun,
.icon-moon {
  transition: opacity var(--transition);
}

[data-theme="light"] .icon-moon {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: none;
}

/* Mobile Menu Button */
.btn-mobile-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background-color: var(--surface);
  border-radius: var(--radius-sm);
}

.btn-mobile-menu span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--text);
  transition: all var(--transition);
}

.btn-mobile-menu.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.btn-mobile-menu.active span:nth-child(2) {
  opacity: 0;
}

.btn-mobile-menu.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile Navigation */
.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  pointer-events: none;
}

.mobile-nav.active {
  pointer-events: auto;
}

.mobile-nav-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity var(--transition);
}

.mobile-nav.active .mobile-nav-backdrop {
  opacity: 1;
}

.mobile-nav-panel {
  position: absolute;
  top: var(--header-h);
  right: 0;
  width: 280px;
  max-width: 80vw;
  height: calc(100vh - var(--header-h));
  background-color: var(--surface);
  border-left: 1px solid var(--border);
  padding: 24px;
  transform: translateX(100%);
  transition: transform var(--transition);
  overflow-y: auto;
}

.mobile-nav.active .mobile-nav-panel {
  transform: translateX(0);
}

.mobile-nav-panel .nav-link {
  display: block;
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.mobile-nav-panel .nav-link:hover,
.mobile-nav-panel .nav-link.active {
  background-color: var(--accent-dim);
  color: var(--accent);
}

/* ==========================================================================
   Main Content
   ========================================================================== */

#main-content {
  min-height: calc(100vh - var(--header-h));
  margin-top: var(--header-h);
}

/* Page Transitions */
.page-container {
  animation: pageEnter 0.4s ease;
}

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

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
  position: relative;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #ffffff;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="white" opacity="0.1"/></svg>');
  opacity: 0.3;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: 40px 20px;
}

.hero h1 {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 24px;
}

.hero h1 em {
  font-style: normal;
  display: block;
  font-weight: 800;
}

.hero p {
  font-size: 20px;
  line-height: 1.6;
  margin-bottom: 32px;
  opacity: 0.9;
}

.hero-cta {
  display: inline-flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius);
  transition: all var(--transition);
  text-align: center;
  gap: 8px;
}

.btn-primary {
  background-color: #ffffff;
  color: var(--accent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-outline {
  background-color: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-outline:hover {
  background-color: var(--accent);
  color: #ffffff;
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  padding: 80px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-title {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.section-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* ==========================================================================
   Cards
   ========================================================================== */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
}

.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all var(--transition);
}

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

.card-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-dim);
  color: var(--accent);
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 28px;
}

.card-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.card-text {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   Products
   ========================================================================== */

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
}

.product-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}

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

.product-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background-color: var(--surface2);
}

.product-content {
  padding: 24px;
}

.product-tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  background-color: var(--accent-dim);
  color: var(--accent);
  border-radius: 20px;
  margin-bottom: 12px;
}

.product-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.product-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   Gallery
   ========================================================================== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: pointer;
  background-color: var(--surface2);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.gallery-item:hover::after {
  opacity: 1;
}

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

.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.faq-item.reveal {
  opacity: 1 !important;
  transform: none !important;
}

.faq-question {
  width: 100%;
  padding: 20px 24px;
  text-align: left;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition);
  opacity: 1 !important;
}

.faq-question:hover {
  background-color: var(--surface2);
}

.faq-icon {
  font-size: 24px;
  transition: transform var(--transition);
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition);
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

.faq-answer-content {
  padding: 0 24px 20px 24px;
  color: var(--text-muted);
  line-height: 1.7;
  opacity: 1 !important;
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact-item {
  display: flex;
  gap: 16px;
}

.contact-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-dim);
  color: var(--accent);
  border-radius: var(--radius);
  flex-shrink: 0;
  font-size: 24px;
}

.contact-details h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.contact-details p {
  color: var(--text-muted);
  font-size: 15px;
}

/* Form */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-submit {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  background-color: var(--accent);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

.form-submit:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.form-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */

#footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border);
  padding: 60px 0 24px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.footer-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-bottom p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1060px) {
  .nav-desktop {
    display: none;
  }

  .btn-mobile-menu {
    display: flex;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 40px;
  }

  .hero p {
    font-size: 18px;
  }

  .section {
    padding: 60px 0;
  }

  .section-title {
    font-size: 32px;
  }

  .section-subtitle {
    font-size: 16px;
  }

  .cards-grid,
  .products-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .hero {
    min-height: 500px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero p {
    font-size: 16px;
  }

  .btn {
    padding: 12px 20px;
    font-size: 14px;
  }

  .card {
    padding: 24px;
  }

  .product-content {
    padding: 20px;
  }
}
