:root {
  color-scheme: dark;

  --bg-primary: #0a0e27;
  --bg-secondary: rgba(15, 20, 40, 0.85);
  --theme-bg: #0a0a0a;
  --theme-text: #e8eaf6;
  --theme-card-bg: rgba(20, 20, 20, 0.9);
  --accent-primary: #667eea;
  --accent-secondary: #f093fb;
  --status-success: #00e676;
  --status-warning: #ff9800;
  --navbar-bg: rgba(10, 10, 10, 0.95);
  --blue: #667eea;
  --purple: #764ba2;
  --pink: #f093fb;
}

body.light-mode {
  --bg-primary: #f5f7fa;
  --bg-secondary: rgba(255, 255, 255, 0.95);
  --theme-bg: #f5f5f5;
  --theme-text: #1a1a1a;
  --theme-card-bg: rgba(255, 255, 255, 0.95);
  --accent-primary: #ff8c00;
  --accent-secondary: #009688;
  --status-success: #388e3c;
  --status-warning: #d32f2f;
  --navbar-bg: rgba(255, 255, 255, 0.95);
  --blue: #4b6ef2;
  --purple: #8c56d5;
  --pink: #ff9cf5;
}

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

body {
  background: var(--theme-bg);
  color: var(--theme-text);
  font-family: "Inter", "Segoe UI", Tahoma, sans-serif;
  overflow-x: hidden;
  transition:
    background-color 0.3s,
    color 0.3s;
}

.bg-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.shape {
  position: absolute;
  opacity: 0.25;
  animation: float-shape 20s infinite ease-in-out;
}

.shape-1 {
  width: 200px;
  height: 200px;
  border: 4px solid var(--accent-primary);
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  top: 10%;
  left: 8%;
  box-shadow: 0 0 60px var(--accent-primary);
}

.shape-2 {
  width: 180px;
  height: 180px;
  border: 4px solid var(--accent-secondary);
  border-radius: 50%;
  top: 55%;
  right: 10%;
  animation-delay: 4s;
  box-shadow: 0 0 60px var(--accent-secondary);
}

.shape-3 {
  width: 160px;
  height: 160px;
  border: 4px solid var(--accent-primary);
  transform: rotate(45deg);
  bottom: 15%;
  left: 55%;
  animation-delay: 8s;
  box-shadow: 0 0 60px var(--accent-primary);
}

.shape-4 {
  width: 140px;
  height: 140px;
  border: 4px solid var(--accent-secondary);
  border-radius: 40% 60% 70% 30% / 60% 30% 70% 40%;
  top: 40%;
  left: 20%;
  animation-delay: 2s;
  box-shadow: 0 0 60px var(--accent-secondary);
}

@keyframes float-shape {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(50px, -50px) rotate(90deg);
  }
  50% {
    transform: translate(-40px, 60px) rotate(180deg);
  }
  75% {
    transform: translate(60px, 40px) rotate(270deg);
  }
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  animation: float-orb 25s infinite ease-in-out;
  opacity: 0.3;
}

.orb1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    var(--accent-primary) 0%,
    transparent 70%
  );
  top: 5%;
  left: -10%;
}

.orb2 {
  width: 450px;
  height: 450px;
  background: radial-gradient(
    circle,
    var(--accent-secondary) 0%,
    transparent 70%
  );
  top: 45%;
  right: -10%;
  animation-delay: 8s;
}

.orb3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    var(--accent-primary) 0%,
    transparent 70%
  );
  bottom: 10%;
  left: 45%;
  animation-delay: 16s;
}

@keyframes float-orb {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(60px, -70px) scale(1.2);
  }
  50% {
    transform: translate(-50px, 60px) scale(0.8);
  }
  75% {
    transform: translate(70px, 50px) scale(1.1);
  }
}

.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(255, 140, 0, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 140, 0, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -1;
}

.dark-theme .grid-overlay {
  background-image:
    linear-gradient(rgba(102, 126, 234, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102, 126, 234, 0.03) 1px, transparent 1px);
}

/* Navbar Styles */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--navbar-bg);
  backdrop-filter: blur(20px);
  padding: 20px 40px;
  box-shadow: 0 2px 20px rgba(102, 126, 234, 0.5);
  border-bottom: 1px solid rgba(102, 126, 234, 0.15);
  transition: all 0.4s ease;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--blue), var(--purple), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.3s ease;
  letter-spacing: 1px;
}

.nav-logo:hover {
  transform: scale(1.05);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 5px;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background: var(--blue);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 35px;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
}

.nav-link {
  text-decoration: none;
  color: var(--theme-text);
  font-weight: 600;
  padding: 8px 16px;
  transition: all 0.3s ease;
  border-radius: 6px;
  font-size: 0.95rem;
  position: relative;
  display: block;
  cursor: pointer;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--blue);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 80%;
}

.nav-link:hover {
  color: var(--blue);
  background: rgba(102, 126, 234, 0.15);
}

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: var(--navbar-bg);
  border: 1px solid rgba(102, 126, 234, 0.15);
  border-left: 2px solid var(--blue);
  border-radius: 12px;
  padding: 12px 0;
  /* min-width: 200px; */
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 40px rgba(102, 126, 234, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  list-style: none;
  z-index: 1100;
}

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

.dropdown-link {
  display: block;
  padding: 12px 24px;
  text-decoration: none;
  color: var(--theme-text);
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  white-space: nowrap;
}

.dropdown-link:hover {
  color: var(--blue);
  background: rgba(102, 126, 234, 0.15);
  padding-left: 30px;
}

.flow-wrapper {
  padding: 120px 20px 60px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.flow-header {
  text-align: center;
  margin-bottom: 80px;
  padding: 0 15px;
}

.header-prompt {
  color: var(--accent-primary);
  font-size: 0.95rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.master-title {
  font-size: 3rem;
  font-weight: 700;
  color: var(--theme-text);
  letter-spacing: 3px;
  margin-bottom: 15px;
  text-shadow: 0 0 20px rgba(255, 140, 0, 0.3);
  word-wrap: break-word;
}

.dark-theme .master-title {
  text-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
}

.header-subtitle {
  font-size: 1.2rem;
  color: var(--accent-secondary);
  font-style: italic;
  line-height: 1.4;
}

.node-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 50px;
  padding: 0 20px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.flow-node {
  background: var(--theme-card-bg);
  border: 2px solid rgba(255, 140, 0, 0.2);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  font-family: "Courier New", Courier, monospace;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.4s ease;
  padding: 30px;
  min-height: 320px;
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.dark-theme .flow-node {
  border-color: rgba(102, 126, 234, 0.3);
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.2);
}

.flow-node::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--accent-primary),
    var(--accent-secondary)
  );
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.flow-node:hover::before {
  transform: scaleX(1);
}

.flow-node:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(255, 140, 0, 0.3);
  border-color: var(--accent-primary);
}

.dark-theme .flow-node:hover {
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.node-profile {
  text-align: center;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.node-img-container {
  width: 130px;
  height: 130px;
  margin: 0 auto 20px;
  border: 3px solid var(--accent-primary);
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(255, 140, 0, 0.4);
  transition: all 0.4s ease;
}

.dark-theme .node-img-container {
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}

.flow-node:hover .node-img-container {
  border-color: var(--accent-secondary);
  box-shadow: 0 0 30px var(--accent-secondary);
  transform: scale(1.08) rotate(5deg);
}

.node-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(20%);
  transition: filter 0.4s;
}

.flow-node:hover .node-img {
  filter: grayscale(0%);
}

.node-name {
  font-size: 1.4rem;
  color: var(--theme-text);
  margin: 10px 0 8px;
  font-weight: 700;
  line-height: 1.3;
}

.node-tag {
  color: var(--accent-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
}

.data-pulse {
  padding-top: 20px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--theme-text);
  opacity: 0.9;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.node-status {
  margin-top: 15px;
  padding-top: 15px;
  font-weight: bold;
  border-top: 1px solid rgba(255, 140, 0, 0.2);
  font-size: 0.85rem;
}

.dark-theme .node-status {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.footer-section {
  padding: 50px 20px;
  border-top: 1px solid rgba(255, 140, 0, 0.2);
  margin-top: 20px;
}

.dark-theme .footer-section {
  border-top-color: rgba(102, 126, 234, 0.2);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-logo {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(
    135deg,
    var(--accent-primary) 0%,
    var(--accent-secondary) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 15px;
  letter-spacing: 2px;
  line-height: 1.3;
}

.footer-status {
  color: var(--theme-text);
  font-size: 0.9rem;
  margin-top: 10px;
  opacity: 0.8;
}

@keyframes ripple {
  0% {
    width: 20px;
    height: 20px;
    opacity: 1;
  }
  100% {
    width: 300px;
    height: 300px;
    opacity: 0;
  }
}

/* Mobile Styles */
@media (max-width: 768px) {
  /* .navbar { */
  /*   padding: 15px 20px; */
  /* } */
  /**/
  /* .nav-toggle { */
  /*   display: flex; */
  /* } */
  /**/
  /* .nav-menu { */
  /*   position: fixed; */
  /*   top: 65px; */
  /*   left: -100%; */
  /*   flex-direction: column; */
  /*   background: var(--navbar-bg); */
  /*   backdrop-filter: blur(20px); */
  /*   width: 100%; */
  /*   height: calc(100vh - 65px); */
  /*   padding: 20px 0; */
  /*   gap: 0; */
  /*   transition: left 0.3s ease; */
  /*   align-items: flex-start; */
  /*   box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3); */
  /*   overflow-y: auto; */
  /*   z-index: 999; */
  /* } */
  /**/
  /* .nav-menu.active { */
  /*   left: 0; */
  /* } */
  /**/
  /* .nav-item { */
  /*   width: 100%; */
  /*   border-bottom: 1px solid rgba(102, 126, 234, 0.1); */
  /* } */
  /**/
  /* .nav-link { */
  /*   padding: 18px 30px; */
  /*   width: 100%; */
  /*   justify-content: space-between; */
  /*   font-size: 1rem; */
  /* } */
  /**/
  /* .dropdown-menu { */
  /*   position: static; */
  /*   opacity: 1; */
  /*   visibility: visible; */
  /*   transform: none; */
  /*   box-shadow: none; */
  /*   border: none; */
  /*   background: transparent; */
  /*   margin-top: 0; */
  /*   padding-left: 30px; */
  /*   max-height: 0; */
  /*   overflow: hidden; */
  /*   transition: max-height 0.3s ease; */
  /*   border-radius: 0; */
  /*   width: 100%; */
  /*   min-width: auto; */
  /* } */
  /**/
  /* .dropdown.active .dropdown-menu { */
  /*   max-height: 300px; */
  /*   margin-bottom: 10px; */
  /* } */
  /**/
  /* .dropdown-link { */
  /*   padding: 15px 30px; */
  /*   border-bottom: 1px solid rgba(102, 126, 234, 0.05); */
  /*   font-size: 0.95rem; */
  /* } */

  .master-title {
    font-size: 2rem;
    letter-spacing: 1px;
    padding: 0 10px;
    line-height: 1.2;
  }

  .header-subtitle {
    font-size: 1rem;
    padding: 0 15px;
    line-height: 1.3;
  }

  .flow-wrapper {
    padding: 100px 15px 40px;
  }

  .flow-header {
    margin-bottom: 50px;
  }

  .node-grid {
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 100%;
    padding: 0 15px;
  }

  .flow-node {
    min-height: 300px;
    padding: 25px;
    margin: 0 auto;
    max-width: 100%;
    width: 100%;
  }

  .node-img-container {
    width: 110px;
    height: 110px;
  }

  .node-name {
    font-size: 1.3rem;
  }

  .shape {
    display: none;
  }

  .orb {
    opacity: 0.15;
  }
}

@media (min-width: 769px) and (max-width: 1100px) {
  .node-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }

  .flow-node {
    min-height: 340px;
  }
}

@media (max-width: 360px) {
  .master-title {
    font-size: 1.7rem;
  }

  .header-subtitle {
    font-size: 0.9rem;
  }

  .flow-node {
    padding: 20px;
  }

  .node-name {
    font-size: 1.2rem;
  }

  .node-img-container {
    width: 100px;
    height: 100px;
  }
}
