.logo-icon {
  font-size: 2.5rem;
  display: inline-block;
  animation: logo-pulse 2s ease-in-out infinite
}

.mode-selector {
    display: flex;
    justify-content: center;
    gap: 2rem; /* Added gap between buttons */
    margin-bottom: 2rem;
    background: transparent; /* Remove background */
    border-radius: 0; /* Remove border radius */
    padding: 0; /* Remove padding */
    border: none; /* Remove border */
    position: relative;
    overflow: visible; /* Change from hidden */
}

@media (max-width: 768px) {
    .mode-selector {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
}



.mode-btn {
    padding: 1rem 2rem;
    background: linear-gradient(145deg, #2d2d3e, #1a1a2e); /* 3D gradient */
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 16px; /* More rounded for 3D effect */
    transition: all var(--transition-normal);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    position: relative;
    display: flex;
    flex-direction: column; /* Stack vertically */
    align-items: flex-start; /* Align text to left */
    gap: 0.5rem;
    z-index: 1;
    opacity: 0.9;
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3); /* 3D box shadow */
    text-align: left; /* Left align text */
    min-width: 200px; /* Ensure consistent width */
    min-height: 60px; /* Reduced height */
}

.mode-btn[data-mode="key"] {
    min-width: 380px; /* Make key mode button even wider */
    min-height: 80px; /* Reduced height while keeping larger animation */
    padding: 0.5rem 2rem; /* Reduced vertical padding */
    display: flex;
    flex-direction: row; /* Override the default column direction */
    align-items: center;
    gap: 1rem;
}

.mode-btn-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.mode-btn[data-mode="key"] .mode-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
}

.mode-btn[data-mode="key"] .mode-icon {
    flex-shrink: 0;
    width: 100px; /* Increased to accommodate wider lock container */
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mode-btn[data-mode="key"] .lock-container {
    transform: scale(1);
    margin: 0;
}

.mode-btn:hover {
    color: var(--text-primary);
    background: linear-gradient(145deg, #3d3d4e, #2a2a3e);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.4);
}

.mode-btn.active {
    background: linear-gradient(145deg, var(--accent-cyan), var(--accent-magenta));
    color: white;
    box-shadow: 
        0 6px 15px var(--glow-cyan),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    transform: translateY(-3px);
    border-color: var(--accent-cyan);
}

.mode-icon {
  font-size: 1.2rem;
  transition: transform var(--transition-normal);
  position: relative;
  display: inline-block;
  overflow: hidden;
  z-index: 1;
}

.algorithm-section {
  margin-bottom: 2rem
}

.algorithm-section h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--accent-cyan);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative
}

.section-icon {
  font-size: 1.5rem;
  animation: section-icon-rotate 4s ease-in-out infinite
}

.section-accent {
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-magenta));
  animation: accent-pulse 2s ease-in-out infinite
}

.algorithm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  align-items: stretch
}

.algorithm-card {
  min-height: 600px;
  padding: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: visible;
  backdrop-filter: blur(10px);
  z-index: 1;
  opacity: 0.85;
}

.algorithm-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--gradient-90-base);
  transition: left 0.6s ease;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
}

.algorithm-card:hover::before {
  left: 100%;
  opacity: 1;
}

.algorithm-card.selected {
  border-color: var(--accent-cyan);
  background: rgba(0, 255, 255, 0.08);
  box-shadow: 0 12px 30px var(--glow-cyan);
  transform: translateY(-4px);
  opacity: 0.9;
}

.algorithm-card.disabled {
  opacity: 0.25;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(1);
  pointer-events: none;
  background: rgba(0, 0, 0, 0.8);
}

.algorithm-card:hover:not(.disabled) {
  border-color: var(--accent-cyan);
  background: rgba(0, 255, 255, 0.06);
  transform: translateY(-8px) rotateX(2deg) rotateY(2deg);
  box-shadow: 0 20px 40px var(--glow-cyan), inset 0 1px 0 var(--white-10);
  z-index: 10;
  opacity: 0.9;
}

.algorithm-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-magenta));
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(0, 255, 255, 0.3);
  z-index: 10;
  text-align: center;
  min-width: 80px;
  white-space: nowrap;
}

.card-header {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 7rem 1rem 1.5rem;
  margin-bottom: 0;
  min-height: 120px;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  justify-content: center;
}

.card-title-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.algorithm-icon {
  font-size: 2rem;
  flex-shrink: 0;
  width: 40px;
  text-align: center;
  transition: transform var(--transition-normal);
  font-family: var(--font-emoji);
}

.algorithm-card:hover:not(.disabled) .algorithm-icon {
  transform: var(--scale-icon-hover);
}

.card-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  flex: 1;
}

.algorithm-card h3 {
  font-size: 1.3rem;
  line-height: 1.2;
  color: var(--text-primary);
  margin: 0;
  font-weight: 700;
}

.algorithm-subtitle {
  font-size: 0.85rem;
  line-height: 1.2;
  color: var(--text-secondary);
  font-weight: 400;
}

.algorithm-description {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0 1.5rem;
  justify-content: flex-start;
  overflow: hidden;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2;
  overflow: hidden;
  min-height: 240px;
}

.main-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.4;
  min-height: 50px;
  display: flex;
  align-items: flex-start;
}

.crypto-stack {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 0.75rem;
  border-left: 3px solid var(--accent-cyan);
  flex: 1;
  min-height: 120px;
  display: flex;
  flex-direction: column;
}

.stack-title {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stack-components {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.component {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.component-type {
  background: var(--accent-magenta);
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 50px;
  text-align: center;
  flex-shrink: 0;
  font-family: var(--font-emoji);
  white-space: nowrap;
}

.component-type.kem {
  background: var(--accent-purple);
}

.component-type.sig {
  background: var(--accent-orange);
}

.component-type.ecdh {
  background: var(--accent-green);
}

.component-type.encrypt {
  background: var(--accent-blue);
}

.component-name {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.85rem;
  line-height: 1.2;
  word-break: break-word;
  flex: 1;
}

.algorithm-details {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin: auto 1.5rem 1.5rem 1.5rem;
  position: relative;
  z-index: 2;
  min-height: 80px;
  flex-shrink: 0;
  margin-top: auto;
}

.security-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex-shrink: 0;
}

.security-level {
  font-size: 0.75rem;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all var(--transition-normal);
  white-space: nowrap;
  min-width: fit-content;
}

.level-standard {
  background: rgba(0, 255, 0, 0.15);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
}

.level-hybrid {
  background: rgba(0, 128, 255, 0.15);
  border: 1px solid var(--accent-blue);
  color: var(--accent-blue);
}

.level-quantum {
  background: rgba(255, 0, 255, 0.15);
  border: 1px solid var(--accent-magenta);
  color: var(--accent-magenta);
}

.level-maximum {
  background: rgba(128, 0, 255, 0.15);
  border: 1px solid var(--accent-purple);
  color: var(--accent-purple);
}

.level-ultra {
  background: linear-gradient(45deg, rgba(0, 255, 255, 0.15), rgba(255, 0, 255, 0.15));
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  animation: ultra-glow 2s ease-in-out infinite;
}

.use-case-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
  max-width: 65%;
  min-width: 0;
}

.use-case-tag {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--white-10);
  border: 1px solid var(--white-20);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
  transition: all var(--transition-normal);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
  min-height: 28px;
}

.use-case-tag:hover {
  background: rgba(0, 255, 255, 0.1);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.use-case-tag span:first-child {
  font-family: var(--font-emoji);
  font-size: 0.8em;
  flex-shrink: 0;
}

@keyframes ultra-glow {

  0%,
  100% {
    box-shadow: 0 0 5px var(--glow-cyan);
  }

  50% {
    box-shadow: 0 0 15px var(--glow-magenta);
  }
}

@keyframes header-glow {

  0%,
  100% {
    opacity: var(--opacity-03);
    transform: translateX(-50%) scaleX(1);
  }

  50% {
    opacity: var(--opacity-1);
    transform: translateX(-50%) scaleX(1.5);
  }
}

@keyframes gradient-flow {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

@keyframes logo-pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: var(--scale-hover);
  }
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: var(--opacity-1);
    transform: translateY(-50%) scale(1);
  }

  50% {
    opacity: var(--opacity-03);
    transform: translateY(-50%) scale(1.5);
  }
}

@keyframes underline-expand {

  0%,
  100% {
    width: 100px;
  }

  50% {
    width: 150px;
  }
}

@keyframes selector-glow {

  0%,
  100% {
    transform: var(--translateX-neg100);
  }

  50% {
    transform: var(--translateX-100);
  }
}

@keyframes section-icon-rotate {

  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(5deg);
  }

  75% {
    transform: rotate(-5deg);
  }
}

@keyframes accent-pulse {

  0%,
  100% {
    width: 50px;
    opacity: var(--opacity-07);
  }

  50% {
    width: 80px;
    opacity: var(--opacity-1);
  }
}

@media (max-width: 1200px) {
  .algorithm-grid {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
  }

  .algorithm-card {
    min-height: 580px;
  }
}

@media (max-width: 768px) {
  .algorithm-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .algorithm-card {
    min-height: auto;
  }

  .card-header {
    padding-right: 1.5rem;
    min-height: 100px;
  }

  .algorithm-badge {
    position: static;
    margin: 0.75rem;
    width: calc(100% - 1.5rem);
  }

  .use-case-tags {
    justify-content: flex-start;
    max-width: 100%;
  }

  .algorithm-details {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    min-height: auto;
  }

  .algorithm-description {
    min-height: auto;
  }

  .crypto-stack {
    min-height: 100px;
  }
}

@media (max-width: 480px) {
  .use-case-tags {
    gap: 0.3rem;
  }

  .use-case-tag {
    padding: 0.25rem 0.5rem;
    font-size: 0.65rem;
    min-height: 24px;
  }

  .algorithm-badge {
    width: calc(100% - 1rem);
    margin: 0.5rem;
    padding: 0.5rem;
    min-height: 36px;
    font-size: 0.75rem;
  }

  .main-description {
    min-height: 60px;
  }

  .crypto-stack {
    min-height: 80px;
  }

  .card-header {
    min-height: 80px;
  }
}