:root {
  --primary: #0ea5e9;
  --primary-hover: #0284c7;
  --bg-main: #ffffff;
  --bg-soft: #f8fafc;
  --bg-2: #f1f5f9;
  --text-dark: #0f172a;
  --text-main: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 25px -5px rgba(0,0,0,0.05);
  --mint: #10b981;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ================= NAVIGACIJA IR LOGOTIPAS ================= */
.navbar {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  z-index: 100;
}

.nav-container-full {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 40px;
}

.logo-container {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.logo-container:hover {
  transform: scale(1.02);
}

.nav-links { display: flex; gap: 35px; align-items: center; }

.nav-link { 
  color: var(--text-dark); 
  text-decoration: none; 
  font-weight: 700; 
  font-size: 0.95rem; 
  text-transform: uppercase; 
  letter-spacing: 1.5px; 
  transition: color 0.3s ease; 
  cursor: pointer; 
  position: relative; 
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px; 
  left: 0;
  background-color: var(--primary);
  transition: width 0.3s ease;
}

.nav-link:hover::after { width: 100%; }
.nav-link:hover { color: var(--primary); }

.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  display: none; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%); background: white; min-width: 180px;
  box-shadow: var(--shadow-md); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden; z-index: 101; padding: 10px 0;
}
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-item {
  padding: 10px 20px; display: block; color: var(--text-main);
  text-decoration: none; font-weight: 500; transition: 0.2s;
}
.dropdown-item:hover { background: var(--bg-soft); color: var(--primary); }

/* ================= KONTEKSTO MYGTUKAI ================= */
.context-switch {
  display: flex; background: var(--bg-soft); padding: 4px;
  border-radius: 100px; border: 1px solid var(--border);
}

.ctx-btn {
  border: none; background: none; padding: 8px 20px; border-radius: 100px;
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  color: var(--text-muted); transition: 0.3s;
}

.ctx-btn.active { background: white; color: var(--primary); box-shadow: var(--shadow-sm); }

/* ================= BENDRI ELEMENTAI IR KORTELĖS ================= */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
@media (max-width: 768px) { .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: white; border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 40px; transition: 0.3s; box-shadow: var(--shadow-sm);
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.card-title { font-size: 1.5rem; color: var(--text-dark); margin-bottom: 15px; }

.card-tag { 
  padding: 5px 12px; border-radius: 100px; font-size: 0.85rem; font-weight: bold; 
  background: #e0f2fe; color: var(--primary); border: 1px solid #bae6fd; 
}

.gradient-text {
  background: linear-gradient(90deg, var(--text-dark), var(--primary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 800;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #3b82f6); color: white;
  padding: 12px 32px; border-radius: 100px; text-decoration: none;
  font-weight: 800; font-size: 0.9rem; text-transform: uppercase;
  letter-spacing: 1.5px; display: inline-block; transition: all 0.3s ease;
  border: none; cursor: pointer; text-align: center;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(14, 165, 233, 0.6); }

/* ================= MODALAI ================= */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center; z-index: 1000;
}
.modal-overlay.active { display: flex; }
.modal-content { background: white; padding: 40px; border-radius: var(--radius-xl); max-width: 500px; width: 90%; }

.feature-card { cursor: pointer; position: relative; overflow: hidden; }
.feature-card::after { content: 'Skaityti plačiau ➔'; display: block; margin-top: 20px; color: var(--primary); font-weight: 600; font-size: 0.9rem; transition: 0.3s; }
.feature-card:hover::after { transform: translateX(5px); }

.guide-card { cursor: pointer; transition: 0.3s; }
.guide-card:hover { transform: translateY(-8px); border-color: var(--primary); box-shadow: var(--shadow-md); }
.guide-card::after { content: 'Sužinoti plačiau ➔'; display: block; margin-top: 20px; color: var(--primary); font-weight: 600; font-size: 0.9rem; transition: 0.3s; text-align: center; }
.guide-card:hover::after { transform: translateX(5px); }

.feature-modal-content {
  background: white; padding: 60px 50px; border-radius: var(--radius-xl); max-width: 650px; width: 95%; position: relative; text-align: left; animation: modalFadeIn 0.3s ease;
}

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

.close-modal-btn {
  position: absolute; top: 20px; right: 20px; background: var(--bg-soft); border: none; width: 44px; height: 44px; border-radius: 50%; font-size: 1.8rem; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: 0.2s;
}
.close-modal-btn:hover { background: #fee2e2; color: #ef4444; }

#fm-illustration {
  font-size: 8rem; background: var(--bg-soft); padding: 30px; border-radius: 30px; display: flex; justify-content: center; align-items: center; margin-right: 30px;
}

/* ================= 3D KONFIGŪRATORIUS IR LABORATORIJA ================= */
.config-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: start; }
@media (max-width: 800px) { .config-layout { grid-template-columns: 1fr; } }

.config-section { margin-bottom: 30px; }
.config-title { font-size: 1.1rem; color: var(--text-dark); margin-bottom: 15px; font-weight: bold; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.config-option { display: flex; justify-content: space-between; align-items: center; background: var(--bg-main); padding: 15px; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 10px; cursor: pointer; transition: 0.2s; }
.config-option:hover, .config-option:has(input:checked) { border-color: var(--primary); box-shadow: 0 4px 15px rgba(14, 165, 233, 0.1); }

.help-btn { background: #e0f2fe; color: var(--primary); border: none; width: 30px; height: 30px; border-radius: 50%; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.help-btn:hover { background: var(--primary); color: white; }

/* Futuristiniai laboratorijos stiliai */
.viewer-container { 
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%); 
  border-radius: var(--radius-xl); 
  border: 1px solid #334155; 
  box-shadow: inset 0 0 50px rgba(0,0,0,0.5), 0 10px 30px rgba(14, 165, 233, 0.2); 
  position: sticky; 
  top: 100px; 
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.viewer-container::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(14, 165, 233, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14, 165, 233, 0.05) 1px, transparent 1px);
  background-size: 30px 30px;
  z-index: 0;
}

.viewer-container::after {
  content: '';
  position: absolute;
  bottom: 15%;
  left: 50%;
  transform: translateX(-50%) rotateX(75deg);
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.3) 0%, transparent 60%);
  box-shadow: 0 0 30px rgba(14, 165, 233, 0.4);
  z-index: 1;
}

model-viewer { 
  width: 100%; 
  height: 500px; 
  outline: none; 
  background: transparent; 
  position: relative;
  z-index: 2; 
}

#viewerTitle {
  position: relative;
  z-index: 3;
  color: #38bdf8 !important; 
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.9rem;
  padding: 20px;
  margin: 0;
  text-align: left !important;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.2);
}
/* ================= 5 KORTELIŲ EILUTĖ (MODERNI) ================= */
.features-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

@media (max-width: 992px) {
  .features-row { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}

.feature-card-modern {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.feature-card-modern:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px -10px rgba(14, 165, 233, 0.15);
  border-color: var(--primary);
}

.fc-number {
  position: absolute;
  top: -15px;
  left: -5px;
  font-size: 6rem;
  font-weight: 900;
  color: var(--bg-soft);
  z-index: 0;
  transition: color 0.4s ease;
  line-height: 1;
}

.feature-card-modern:hover .fc-number {
  color: #e0f2fe; 
}

.fc-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.feature-card-modern:hover .fc-icon {
  transform: scale(1.1);
}

.fc-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  position: relative;
  z-index: 1;
}

/* ================= MODERNUS VAIZDINIS MODALAS ================= */
.feature-modal-modern {
  background: white;
  border-radius: var(--radius-xl);
  max-width: 850px;
  width: 95%;
  display: flex;
  overflow: hidden;
  position: relative;
  animation: modalFadeIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.fm-left {
  flex: 1;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 350px;
}

/* Besisukantis CSS energijos branduolys (radaro/šviesos efektas) */
.fm-glow-bg {
  position: absolute;
  width: 250%;
  height: 250%;
  background: conic-gradient(from 0deg, transparent 0%, rgba(14, 165, 233, 0.1) 25%, rgba(14, 165, 233, 0.8) 50%, transparent 55%);
  animation: rotateGlow 4s linear infinite;
}

@keyframes rotateGlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.fm-right {
  flex: 1.5;
  padding: 50px;
  text-align: left;
  background: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 768px) {
  .feature-modal-modern { flex-direction: column; }
  .fm-left { min-height: 200px; }
  .fm-right { padding: 30px; }
}