/*
  General Styles
  - Sets up the basic page layout, fonts, and background.
  - Uses a dark background to make the vibrant torus and text stand out.
*/
body {
  margin: 0;
  font-family: 'Georgia', sans-serif;
  background-color: #0d0d0d;
  color: #e0e0e0;
  overflow: hidden; /* Prevents scrollbars from appearing */
  cursor: default; /* Sets a consistent cursor */
  
  /* Background Image */
  background-image: url('../images/background.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed; /* Ensures the background stays in place while content scrolls */
  background-repeat: no-repeat;
}

/*
Canvas Container
- Positions the WebGL canvas to cover the entire viewport.
- This ensures the 3D torus is the primary visual element.
*/
#torus-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

#glCanvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/*
Message Box
- Provides a subtle, styled notification area for user feedback.
- Initially hidden and fades in and out with JavaScript.
*/
.message-box {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(30, 30, 30, 0.8);
  color: #f0f0f0;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9em;
  z-index: 100;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  display: none;
  text-align: center;
}

/* Card Container */
.card-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10; /* Ensures the card is above the torus */
  pointer-events: none; /* Allows clicks to pass through initially */
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0; /* Starts hidden */
  transition: opacity 0.5s ease-in-out, backdrop-filter 0.5s ease-in-out;
}

/* Make container interactive when the card is shown */
.card-container.visible {
  pointer-events: auto;
  opacity: 1;
}

/* The card itself */
.card {
  position: relative;
  width: clamp(300px, 80vw, 800px);
  max-height: 80vh;
  padding: 40px;
  background-color: rgba(0, 0, 0, 0.4); /* Translucent background */
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px); /* Frosted glass effect */
  -webkit-backdrop-filter: blur(10px);
  color: #e0e0e0;
  text-align: left;
  overflow-y: auto; /* Allows scrolling for long content */
  transform: translateY(-20px);
  transition: transform 0.5s ease-in-out;
}

.card-container.visible .card {
  transform: translateY(0);
}

/* Card content styling */
.card-content h2 {
  font-size: 2.5em;
  font-weight: bold;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.card-content p {
  font-size: 1.1em;
  line-height: 1.6;
  margin-bottom: 20px;
}

.card-content a {
  color: #64b5f6; /* A distinct color for links */
  text-decoration: none;
  border-bottom: 1px solid rgba(100, 181, 246, 0.5);
  transition: border-bottom-color 0.3s ease;
}

.card-content a:hover {
  border-bottom-color: #64b5f6;
}

/* Close button */
.close-button {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: #e0e0e0;
  font-size: 2em;
  cursor: pointer;
  transition: color 0.3s ease, transform 0.3s ease;
}

.close-button:hover {
  color: #fff;
  transform: rotate(90deg);
}