/* CSS Variables for Themes */
:root {
  /* Professional Theme */
  --bg-primary: #0a192f;
  --bg-secondary: #483A58;
  --text-primary: #ccd6f6;
  --text-secondary: #eaeaea;
  --accent: #978EF5;
  --accent-hover: #837AE3;
  --nav-width: 88px;
  --nav-toggle-size: 36px;
}

[data-theme="pixel"] {
  /* Pixel Theme */
  --bg-primary: #1a1a2e;
  --bg-secondary: #483A58;
  --text-primary: #eaeaea;
  --text-secondary: #eaeaea;
  --accent: #978EF5;
  --accent-hover: #837AE3;
}

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

a {
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navigation Styles */
.navbar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 50;
  width: var(--nav-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 4rem 0 1.5rem;
  background-color: rgba(17, 34, 64, 0.8);
  backdrop-filter: blur(12px);
  border-right: 1px solid rgba(151, 142, 245, 0.2);
  transition: transform 0.3s ease;
}

.navbar-horizontal {
  position: relative;
  z-index: 50;
  background-color: rgba(17, 34, 64, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(151, 142, 245, 0.2);
  /* Reduce vertical padding for smaller height, but keep enough for any background effects */
  padding: 0.2rem 1.5rem;
  min-height: 48px;
}

.navbar-horizontal .nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: auto;
}

.logo-image {
  height: 56px;
  width: 56px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
  transition: transform 0.3s ease;
}

.logo-image-home {
  height: 56px;
  width: 56px;
}

.logo-link:hover .logo-image {
  transform: scale(1.03);
}

.navbar-horizontal.not-sticky {
  position: absolute;
}

/* Dropdown Styles */
.dropdown {
  position: relative;
  display: inline-flex;
}

.dropdown-toggle {
  padding: 0.5rem;
  width: 42px;
  height: 42px;
  background-color: rgba(151, 142, 245, 0.15);
  color: var(--accent);
  border: 1px solid rgba(151, 142, 245, 0.2);
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dropdown-toggle:hover,
.dropdown-toggle[aria-expanded="true"] {
  background-color: rgba(151, 142, 245, 0.25);
  border-color: rgba(151, 142, 245, 0.4);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 200px;
  background-color: var(--bg-secondary);
  border: 1px solid rgba(151, 142, 245, 0.3);
  border-radius: 0.75rem;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
  padding: 0.75rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}

.dropdown-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.dropdown-item {
  width: 100%;
  background: rgba(151, 142, 245, 0.12);
  color: var(--text-primary);
  border: 1px solid transparent;
  border-radius: 0.5rem;
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.dropdown-item span {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.dropdown-item:hover {
  border-color: rgba(151, 142, 245, 0.4);
  background-color: rgba(151, 142, 245, 0.2);
}

.navbar-horizontal .nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: flex-end;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-links-right {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  justify-content: flex-end;
}

.navbar .nav-links {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  align-items: center;
  margin-top: 1.5rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1.5rem;
  transition: color 0.3s ease;
  position: relative;
}

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

.nav-link-text {
  font-size: 1.125rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.navbar .nav-link-text {
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.2;
}

.nav-toggle-btn {
  position: fixed;
  top: 1rem;
  left: 0.75rem;
  width: var(--nav-toggle-size);
  height: var(--nav-toggle-size);
  border-radius: 0.5rem;
  border: 1px solid rgba(151, 142, 245, 0.35);
  background: rgba(17, 34, 64, 0.9);
  color: var(--text-primary);
  cursor: pointer;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-toggle-btn:hover {
  background: rgba(151, 142, 245, 0.2);
  border-color: rgba(151, 142, 245, 0.5);
}

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

.theme-toggle {
  margin-top: auto;
  margin-bottom: 2rem;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.theme-toggle-horizontal {
  padding: 0.5rem 1rem;
  background-color: rgba(151, 142, 245, 0.1);
  color: var(--accent);
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.theme-toggle-horizontal:hover {
  background-color: rgba(151, 142, 245, 0.2);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--nav-width);
  padding: 2rem 1.5rem;
  transition: margin-left 0.3s ease;
}

.main-content-horizontal {
  flex: 1;
  padding: 2rem 1.5rem;
}
body.nav-collapsed .navbar {
  transform: translateX(-100%);
}

body.nav-collapsed .main-content,
body.nav-collapsed .main-content-horizontal {
  margin-left: 0;
}

.container {
  max-width: 1024px;
  margin: 0 auto;
}

/* Typography */
h1 {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

h2 {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

h3 {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.text-accent {
  color: var(--accent);
}

.text-secondary {
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.25rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

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

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: scale(1.05);
}

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

.btn-outline:hover {
  background-color: rgba(151, 142, 245, 0.1);
  transform: scale(1.05);
}

/* Cards */
.card {
  background-color: rgba(47, 47, 52, 0.2);
  backdrop-filter: blur(9px);
  border-radius: 0.5rem;
  padding: 1.5rem;
  border: 1px solid rgba(210, 206, 255, 0.2);
  transition: all 0.3s ease;
}

.card:hover {
  border-color: rgba(238, 220, 255, 0.4);
  transform: scale(1.02);
}

/* Footer */
.footer {
  width: 100%;
  padding: 2rem 0;
  border-top: 1px solid rgba(151, 142, 245, 0.2);
  margin-top: auto;
}

.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.footer-social {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.social-link {
  font-size: 1.5rem;
  text-decoration: none;
  transition: transform 0.3s ease, color 0.3s ease;
}

.social-link:hover {
  transform: scale(1.1);
  color: white;
}

/* Responsive */
@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
  }

  .navbar .nav-link-text {
    font-size: 0.75rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

/* Pixel theme specific */
[data-theme="pixel"] * {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Carousel Styles */
.carousel-container {
  position: relative;
  width: 100%;
  height: 400px;
  margin: 3rem 0;
  overflow: hidden;
  border-radius: 1rem;
  background: rgba(17, 34, 64, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(151, 142, 245, 0.2);
}

.carousel-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
  position: relative;
  gap: 2rem;
  padding: 2rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.carousel-wrapper::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.carousel-item {
  position: relative;
  flex-shrink: 0;
  width: 200px;
  height: 300px;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              z-index 0.4s ease,
              opacity 0.4s ease;
  transform-origin: center;
  opacity: 0.7;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 34, 64, 0.2);
  border-radius: 0.75rem;
}

.carousel-item:hover {
  transform: translateY(-20px) scale(1.1);
  z-index: 10;
  opacity: 1;
}

.carousel-item.active {
  transform: translateY(-20px) scale(1.1);
  z-index: 10;
  opacity: 1;
}

.carousel-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 0.75rem;
  border: 2px solid rgba(151, 142, 245, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background: rgba(17, 34, 64, 0.4);
  padding: 0.5rem;
}

.carousel-item:hover .carousel-image,
.carousel-item.active .carousel-image {
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(151, 142, 245, 0.4);
}

.carousel-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(10, 25, 47, 0.95), transparent);
  padding: 1rem;
  border-radius: 0 0 0.75rem 0.75rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.carousel-item:hover .carousel-overlay,
.carousel-item.active .carousel-overlay {
  opacity: 1;
}

.carousel-overlay h3 {
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0;
  text-align: center;
}

/* Carousel Modal */
.carousel-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(10, 25, 47, 0.95);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.carousel-modal.show {
  display: flex;
  opacity: 1;
}

.carousel-modal-content {
  position: relative;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  background: #2d1f3a;
  border: 2px solid var(--accent);
  border-radius: 1rem;
  padding: 2.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-modal.show .carousel-modal-content {
  transform: scale(1);
}

.carousel-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(151, 142, 245, 0.2);
  border: 1px solid var(--accent);
  color: var(--accent);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
}

.carousel-modal-close:hover {
  background: var(--accent);
  color: var(--bg-primary);
  transform: rotate(90deg);
}

.carousel-modal-body {
  color: var(--text-primary);
}

.carousel-modal-body img {
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 0.75rem;
  margin: 0 auto 2rem;
  display: block;
  border: 2px solid var(--accent);
}

.carousel-modal-body h2 {
  color: #ffffff;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.carousel-modal-body h3 {
  color: var(--text-primary);
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.5rem;
}

.carousel-modal-body ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
}

.carousel-modal-body li {
  color: var(--text-secondary);
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.6;
}

.carousel-modal-body li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.carousel-modal-body a {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: var(--bg-primary);
  text-decoration: none;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.carousel-modal-body a:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(151, 142, 245, 0.4);
}

/* Responsive Carousel */
@media (max-width: 768px) {
  .carousel-container {
    height: 300px;
  }
  
  .carousel-item {
    width: 150px;
    height: 225px;
  }
  
  .carousel-wrapper {
    gap: 1rem;
    padding: 1rem;
  }
  
  .carousel-modal-content {
    width: 95%;
    padding: 1.5rem;
  }
}

