:root {
  /* Base Colors */
  --bg-primary: #050505;
  --bg-secondary: #0f172a;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  /* Glass UI */
  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(18px);

  /* Dynamic Theme Variables (Default to Riga/Global) */
  --theme-color-1: #3b82f6; /* Blue */
  --theme-color-2: #fbbf24; /* Gold */
  
  --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dynamic Themes Setup */
body.theme-riga { --theme-color-1: #3b82f6; --theme-color-2: #fbbf24; }
body.theme-jurmala { --theme-color-1: #06b6d4; --theme-color-2: #fde047; }
body.theme-sigulda { --theme-color-1: #22c55e; --theme-color-2: #b45309; }
body.theme-liepaja { --theme-color-1: #f97316; --theme-color-2: #a855f7; }

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

html {
  scroll-behavior: smooth;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  transition: --theme-color-1 1s ease, --theme-color-2 1s ease;
}

/* Dynamic Background Glow */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, var(--theme-color-1) 0%, transparent 40%),
              radial-gradient(circle at bottom right, var(--theme-color-2) 0%, transparent 40%);
  opacity: 0.05;
  z-index: -1;
  pointer-events: none;
  transition: background 1.5s ease-in-out;
}

/* Typography */
h1, h2, h3, h4, h5 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 5vw, 5rem); }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.5rem); }

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

/* Layout */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 5%;
}

section {
  padding: 6rem 0;
  position: relative;
}

/* Glass Components */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2rem;
}

/* Header & Nav */
header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  transition: var(--transition-smooth);
  padding: 1.5rem 0;
}

header.scrolled {
  background: rgba(5, 5, 5, 0.8);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 1rem 0;
  border-bottom: 1px solid var(--glass-border);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(to right, var(--theme-color-1), var(--theme-color-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: var(--transition-smooth);
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--theme-color-1), var(--theme-color-2));
  transition: var(--transition-smooth);
}

.nav-links a:hover::after, .nav-links a.active::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--theme-color-1), var(--theme-color-2));
  color: #fff;
  box-shadow: 0 10px 20px -10px var(--theme-color-1);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 25px -10px var(--theme-color-1);
}

.btn-glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  color: white;
}

.btn-glass:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-3px);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 800px;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.hero-grid {
  position: absolute;
  top: 0;
  right: -5%;
  width: 60%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  transform: rotate(-10deg) scale(1.2);
  z-index: 1;
  opacity: 0.6;
}

.hero-grid img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  animation: float 10s infinite ease-in-out alternate;
}

.hero-grid img:nth-child(even) {
  margin-top: 100px;
  animation-delay: -5s;
}

/* Cards */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.dest-card {
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 4/5;
  cursor: pointer;
}

.dest-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.dest-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 2rem;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
  transition: var(--transition-smooth);
}

.dest-card:hover img {
  transform: scale(1.05);
}

.dest-card:hover .dest-card-overlay {
  padding-bottom: 3rem;
}

/* Destinations Inner Pages Layout */
.dest-hero {
  height: 60vh;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding-bottom: 4rem;
}

.dest-hero-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover;
  z-index: -1;
  filter: brightness(0.6);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.gallery-grid img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 16px;
  transition: var(--transition-smooth);
}

.gallery-grid img:hover {
  transform: scale(1.03);
}

/* Transport Tabs */
.tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.tab-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.tab-btn.active, .tab-btn:hover {
  background: linear-gradient(135deg, var(--theme-color-1), var(--theme-color-2));
  border-color: transparent;
}

.tab-content {
  display: none;
  animation: fadeIn 0.5s ease;
}

.tab-content.active {
  display: block;
}

/* Timeline */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 20px;
  height: 100%;
  width: 2px;
  background: linear-gradient(to bottom, var(--theme-color-1), var(--theme-color-2));
}

.timeline-item {
  position: relative;
  padding-left: 60px;
  margin-bottom: 3rem;
}

.timeline-dot {
  position: absolute;
  left: 11px;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 4px solid var(--theme-color-1);
}

/* Footer */
footer {
  background: var(--bg-secondary);
  padding: 4rem 0 2rem;
  border-top: 1px solid var(--glass-border);
}

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

.footer-col h4 {
  color: white;
  margin-bottom: 1.5rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.8rem;
}

.footer-col ul a {
  color: var(--text-muted);
}

.footer-col ul a:hover {
  color: var(--theme-color-1);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
  color: var(--text-muted);
}

/* Contact Page Form & Layout Overrides */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
  max-width: 1100px;
  margin: 0 auto 5rem;
}

@media (max-width: 860px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.form-row {
  display: flex;
  gap: 1.5rem;
}

@media (max-width: 600px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }
}

.form-group {
  margin-bottom: 1.5rem;
  width: 100%;
}

.form-group label {
  display: block;
  margin-bottom: 0.6rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition-smooth);
}

.form-control:focus {
  outline: none;
  border-color: var(--theme-color-1);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.form-control::placeholder {
  color: rgba(148, 163, 184, 0.6);
}

select.form-control option {
  background: var(--bg-secondary);
  color: var(--text-main);
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition-smooth);
}

.social-icon:hover {
  background: var(--theme-color-1);
  border-color: var(--theme-color-1);
  color: #fff;
  transform: translateY(-4px);
  box-shadow: 0 10px 20px -10px var(--theme-color-1);
}

/* Utility Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease-out;
}

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

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

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

/* Responsive */
@media (max-width: 992px) {
  .hero-grid { opacity: 0.3; right: -20%; }
  .nav-links {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: var(--bg-primary);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
  }
  .nav-links.active { left: 0; }
  .mobile-menu-btn { display: block; }
}