/* Theme Toggle Styles */
.theme-toggle {
  position: fixed;
  bottom: 115px;
  right: 7px;
  z-index: 1000000;
  background: var(--branding);
  color:black;
  width: 38px;
  height: 38px;
  border:1px solid var(--background);
  border-radius: 50%;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  outline: none;
}

.theme-toggle:hover {
  transform: scale(1.3);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle i {
  font-size: 1.8rem;
  transition: transform 0.3s ease;
}

/* Animation */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.theme-toggle.animate {
  animation: pulse 0.5s ease;
}

        
/* CSS: use visibility/opacity so animations run */
  #helpOverlay {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%) perspective(1000px);
    width: 97%;
    max-width: 600px;
    height: auto;
    max-height:85%;
    background: var(--background);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--branding);
    border-radius: 10px 10px 0 0;
    z-index: 9999;
    overflow-x: hidden;
    overflow-y:auto;
    pointer-events: none;/*
    opacity: 10;
    box-shadow: 0 -20px 50px rgba(150, 201, 61, 0.3);*/
  }
  
  .figureoverlay {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%) perspective(1000px);
  width: 98%;
  max-width: 600px;
  max-height: 85%;
  background: var(--background);
  backdrop-filter: blur(15px);
  border-top: 1px solid var(--branding);
  border-radius: 10px 10px 0 0;
  z-index: 9999;
  overflow-y: auto;
  pointer-events: none;
}

.figureoverlay.show {
  animation: cosmicReveal 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  pointer-events: auto;
}

.figureoverlay.hide {
  animation: cosmicExit 0.8s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
}

  /* Particle Background */
  .particle-container {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
  }

  /* Mind-Blowing Animations */
  #helpOverlay.show {
    animation: cosmicReveal 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    pointer-events: auto;
  }

  @keyframes cosmicReveal {
    0% {
      opacity: 0;
      transform: translateX(-50%) translateY(100%) rotateX(80deg) scale(0.7);
    }
    20% {
      opacity: 0.8;
      transform: translateX(-50%) translateY(20%) rotateX(30deg) scale(1.1);
    }
    40% {
      transform: translateX(-50%) translateY(-5%) rotateX(-10deg) scale(0.95);
    }
    60% {
      transform: translateX(-50%) translateY(0) rotateX(5deg) scale(1.02);
    }
    100% {
      opacity: 1;
      transform: translateX(-50%) translateY(0) rotateX(0) scale(1);
    }
  }

  #helpOverlay.hide {
    animation: cosmicExit 0.8s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
  }

  @keyframes cosmicExit {
    0% {
      opacity: 1;
      transform: translateX(-50%) translateY(0) rotateX(0);
    }
    100% {
      opacity: 0;
      transform: translateX(-50%) translateY(100%) rotateX(80deg);
    }
  }

  /* Enhanced Content Styling */
  .help-content {
    padding: 10px;
    color: var(--light-text);
    height: 100%;
    overflow-y: auto;
  }

  .help-content h3 {
    font-size: 1.4rem;
    margin: 15px 0;
    background: linear-gradient(to right, var(--branding), #00b09b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
  }

  .help-content p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: left;
  }

  /* Futuristic Close Button */
  .close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid #ff6b6b;
    color: #ff6b6b;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
  }

  .close-btn:hover {
    background: rgba(255, 107, 107, 0.4);
    transform: rotate(90deg);
  }

  
  li {
      margin-bottom:9px;
  }

  ol, ul {
    line-height:1rem; 
    padding-left: 20px;
    font-size:0.85rem;
  }
  
    /* Popup Styles */
        .popup-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.9);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            flex-direction: column; }
        
        .popup-iframe {
            width: 100%;
            height: 100%;
            border: none;
            background: #282c36;
            transition: opacity 0.5s ease;
        }
        
        .popup-close {
            position: fixed;
            top: 10px;
            right: 10px;
            opacity:0.9;
            animation: gentyPulse 1.2s infinite, gentyShake 1.4s infinite;
            background:var(--branding);
            color: white;
            border: none;
            padding: 7px 10px;
            cursor: pointer;
            font-size: 15px;
            border-radius: 7px;
            z-index: 100000;
            transition: transform 0.3s;
        }
        
        .popup-close:hover {
            transform: scale(1.1);
        }
        
        .loading-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }
        
        .loading-spinner {
            border: 6px solid var(--simple-color);
            border-top: 7px solid var(--branding);
            border-radius: 50%;
            width: 50px;
            height: 50px;
            animation: spin 2s linear infinite;
        }
        
        .loading-text {
            margin-top: 10px;
            font-size: 16px;
            color: white;
            font-weight: bold;
            text-align: center;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
  
  
  /* back to top */
  #backToTop {
    position: fixed;
    bottom: 100px;
    left: 7px;
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: var(--card-bg);
    border:1px dashed var(--branding);
    color: var(--branding);
    font-size: 20px;
    cursor: pointer;
    display: none; /* hidden by default */
    justify-content: center;
    align-items: center;
    transition: 0.3s;
    z-index: 1000000;
}

#backToTop:hover {
    background: var(--card-bg);
}
