@import url("https://fonts.googleapis.com/css?family=Poppins:400,500,600,700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
  color: #e0e0e0;
}

body {
  background: linear-gradient(135deg, #121212 0%, #1e1e1e 100%);
  overflow: auto;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      circle at 20% 20%,
      rgba(0, 188, 212, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(255, 215, 0, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 40% 60%,
      rgba(255, 100, 50, 0.15) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: -1;
}

nav {
  background: rgba(30, 30, 30, 0.85);
  width: 100%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav:after {
  content: "";
  clear: both;
  display: table;
}

nav ul {
  list-style: none;
  position: relative;
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 10px;
}

nav ul li {
  display: inline-block;
  margin: 0 15px;
  color: #e0e0e0;
  position: relative;
}

nav ul li a {
  color: #e0e0e0;
  text-decoration: none;
  line-height: 60px;
  font-size: 16px;
  padding: 10px 18px;
  text-align: center;
  transition: all 0.3s ease;
  border-radius: 8px;
  user-select: none;
}

.clickable:hover,
nav ul li a:hover {
  background: linear-gradient(135deg, #00bcd4 0%, #0097a7 100%);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 188, 212, 0.5);
  cursor: pointer;
}

nav ul ul {
  position: absolute;
  top: 60px;
  opacity: 0;
  visibility: hidden;
  background: rgba(30, 30, 30, 0.95);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.95);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  z-index: 1000;
  min-width: 180px;
}

nav ul :hover > ul {
  opacity: 1;
  visibility: visible;
  transform: translateY(8px);
}

nav ul ul li {
  background: transparent;
  position: relative;
  margin: 0px;
  width: 100%;
  float: none;
  display: list-item;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav ul ul li:last-child {
  border-bottom: none;
}

nav ul ul li a {
  line-height: 50px;
  padding: 0 20px;
  display: block;
  font-size: 15px;
  letter-spacing: 0.5px;
}

nav ul ul li a:hover {
  background: linear-gradient(
    135deg,
    rgba(0, 188, 212, 0.25) 0%,
    rgba(0, 151, 167, 0.25) 100%
  );
}

.range-input {
  background: linear-gradient(90deg, #00bcd4 0%, #0097a7 100%);
  -webkit-appearance: none;
  height: 8px;
  outline: none;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  transition: background 0.3s ease;
}

.range-input:hover {
  background: linear-gradient(90deg, #0097a7 0%, #00bcd4 100%);
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00bcd4 0%, #0097a7 100%);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 188, 212, 0.9), 0 0 25px rgba(0, 188, 212, 0.5);
  border: 3px solid #ffffff;
  transition: all 0.3s ease;
}

.range-input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 18px rgba(0, 188, 212, 1), 0 0 30px rgba(0, 188, 212, 0.7);
}

.range-input::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00bcd4 0%, #0097a7 100%);
  cursor: pointer;
  box-shadow: 0 0 12px rgba(0, 188, 212, 0.9), 0 0 25px rgba(0, 188, 212, 0.5);
  border: 3px solid #ffffff;
  transition: all 0.3s ease;
}

.range-input::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 18px rgba(0, 188, 212, 1), 0 0 30px rgba(0, 188, 212, 0.7);
}

/* Canvas container styling */
.canvas-container {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin: 30px auto;
  padding: 30px 60px 60px 30px; /* Added extra padding on right and bottom */
  background: rgba(20, 20, 20, 0.85);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 188, 212, 0.3);
  box-shadow: 0 15px 50px rgba(0, 188, 212, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  max-width: 95%;
  position: relative;
  overflow: visible;
  min-height: 520px;
  transition: all 0.3s ease;
}

.canvas-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 188, 212, 0.7) 50%,
    transparent 100%
  );
  border-radius: 10px;
  transition: all 0.3s ease;
}

canvas {
  display: block;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 188, 212, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(0, 188, 212, 0.3);
  transition: all 0.3s ease;
}

/* Status indicators */
#time {
  font-weight: 700;
  background: linear-gradient(
    135deg,
    rgba(0, 188, 212, 0.3) 0%,
    rgba(0, 151, 167, 0.3) 100%
  );
  border-radius: 8px;
  padding: 10px 20px;
  border: 1px solid rgba(0, 188, 212, 0.5);
  user-select: none;
  transition: all 0.3s ease;
}

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Algorithm display styling */
#algo-display-container {
  text-align: center;
  margin: 25px 0;
  padding: 20px;
  background: rgba(10, 10, 10, 0.85);
  border-radius: 16px;
  backdrop-filter: blur(15px);
  border: 1px solid rgba(0, 188, 212, 0.4);
  box-shadow: 0 10px 40px rgba(0, 188, 212, 0.5);
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 10;
  transition: all 0.3s ease;
}

.canvas-container {
  margin-top: 30px;
}

#current-algo {
  font-size: 2.4rem;
  font-weight: 700;
  color: #00bcd4;
  text-shadow: 2px 2px 12px rgba(0, 188, 212, 0.8);
  user-select: none;
  margin: 0;
  padding: 12px;
  letter-spacing: 1.5px;
  background: linear-gradient(
    135deg,
    rgba(0, 188, 212, 0.15) 0%,
    rgba(0, 151, 167, 0.15) 100%
  );
  border-radius: 12px;
  border: 1px solid rgba(0, 188, 212, 0.3);
  transition: all 0.3s ease;
}
