html {
  height: 100%;
  margin: 0;
  padding: 0;
  /* More forceful scrollbar hiding for WebKit */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}
html::-webkit-scrollbar {
  display: none; /* WebKit browsers */
}

:root {
  --primary-glow: #4f46e5;
  --secondary-glow: #10b981;
  --terminal-bg: rgba(15, 15, 25, 0.95);
  --terminal-border: #3730a3;
  --text-primary: #f9fafb;
  --text-secondary: #a3a3a3;
  --background-primary: #0a0a1a;
  --background-secondary: #111827;
}

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

body {
  background: linear-gradient(
    135deg,
    var(--background-primary),
    var(--background-secondary)
  );
  color: var(--text-primary);
  font-family: "Poppins", "Rubik", sans-serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  /* Hide default scrollbar */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

body::-webkit-scrollbar {
  display: none; /* WebKit browsers - kept for body-specific cases if any */
}

#page-content-wrapper {
  flex: 1 0 auto;
  position: relative;
  overflow: hidden;
  padding-bottom: 2rem;
}

.glow-text {
  text-shadow: 0 0 10px var(--primary-glow), 0 0 20px var(--primary-glow),
    0 0 30px var(--primary-glow);
}

.gradient-text {
  background: linear-gradient(
    90deg,
    var(--primary-glow),
    var(--secondary-glow)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.code-font {
  font-family: "JetBrains Mono", monospace;
}

/* Terminal styles */
.terminal {
  background-color: var(--terminal-bg);
  border: 1px solid var(--terminal-border);
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.3), 0 0 30px rgba(79, 70, 229, 0.2);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(5px);
}

.terminal-header {
  padding: 0.5rem 1rem;
  background: rgba(30, 30, 50, 0.8);
  border-bottom: 1px solid rgba(79, 70, 229, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.terminal-circles {
  display: flex;
  gap: 0.5rem;
}

.circle {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.red {
  background-color: #ff5f57;
}
.yellow {
  background-color: #febc2e;
}
.green {
  background-color: #28c840;
}

.terminal-body {
  position: relative;
  padding: 1.5rem;
  /* Adjust padding-right if scrollbar is inside and takes space */
  /* padding-right: calc(1.5rem + 12px); */ /* Example: 1.5rem original + 10px bar + 2px space */
  height: 320px;
  overflow-y: auto; /* Keep this, JS will manage thumb based on it */
  /* Hide default scrollbar */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.terminal-body::-webkit-scrollbar {
  display: none; /* WebKit browsers */
}

.terminal-prompt {
  color: #10b981;
}

.terminal-input {
  margin-left: 4px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: "JetBrains Mono", monospace;
  width: calc(100% - 70px);
  outline: none;
  caret-color: var(--primary-glow);
}

.terminal-line {
  margin-bottom: 1rem;
  overflow-wrap: break-word;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 18px;
  background: var(--primary-glow);
  margin-left: 2px;
  animation: cursor-blink 1s infinite;
}

.btn-terminal {
  background: rgba(79, 70, 229, 0.2);
  border: 1px solid rgba(79, 70, 229, 0.5);
  color: var(--text-primary);
  padding: 0.5rem 1.5rem;
  border-radius: 4px;
  margin-right: 0.5rem;
  cursor: pointer;
  transition: all 0.3s;
  font-family: "JetBrains Mono", monospace;
}

.btn-terminal:hover {
  background: rgba(79, 70, 229, 0.4);
  box-shadow: 0 0 10px rgba(79, 70, 229, 0.5);
}

.btn-yes {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.2);
}

.btn-yes:hover {
  background: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.btn-no {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.2);
}

.btn-no:hover {
  background: rgba(239, 68, 68, 0.4);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* Access code field */
.access-field {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  background: rgba(30, 30, 50, 0.4);
  border: 1px solid var(--terminal-border);
  border-radius: 4px;
  padding: 0.5rem;
  transition: all 0.3s;
}

.access-field:focus-within {
  box-shadow: 0 0 10px rgba(79, 70, 229, 0.5);
  border-color: var(--primary-glow);
}

.access-field input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: "JetBrains Mono", monospace;
  outline: none;
  padding: 0.25rem 0.5rem;
}

.access-field button {
  background: rgba(79, 70, 229, 0.3);
  border: none;
  color: var(--text-primary);
  padding: 0.25rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.access-field button:hover {
  background: rgba(79, 70, 229, 0.5);
}

/* Animations */
@keyframes cursor-blink {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.8;
  }
  50% {
    opacity: 0.3;
  }
}

.float {
  animation: float 4s ease-in-out infinite;
}

.pulse {
  animation: pulse 2s infinite;
}

/* Particle background */
.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background-color: rgba(79, 70, 229, 0.5);
  border-radius: 50%;
}

/* Social links */
.social-links {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(30, 30, 50, 0.5);
  border: 1px solid rgba(79, 70, 229, 0.3);
  color: var(--text-primary);
  transition: all 0.3s;
}

.social-link:hover {
  background: rgba(79, 70, 229, 0.3);
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.5);
  transform: translateY(-3px);
}

/* Media queries for responsive design */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    padding: 2rem 1rem;
  }

  .intro-section {
    width: 100%;
    padding-right: 0;
  }

  .terminal-section {
    width: 100%;
    margin-top: 2rem;
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 1.5rem;
  }
}

/* Blobs */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  z-index: -1;
  opacity: 0.3;
}

.blob1 {
  width: 300px;
  height: 300px;
  background: var(--primary-glow);
  top: -100px;
  left: -100px;
}

.blob2 {
  width: 400px;
  height: 400px;
  background: var(--secondary-glow);
  bottom: -150px;
  right: -150px;
}

/* Widgets Section */
/* The .widgets-container rule is removed as Tailwind handles its spacing.
   If specific container styles are needed in the future, they can be added here.
*/

.widget {
  /* Tailwind classes p-6 rounded-lg shadow-lg backdrop-filter backdrop-blur-md bg-opacity-30 bg-gray-800 border border-gray-700 handle most styling */
  /* Add any additional common widget styles here */
  display: flex;
  flex-direction: column;
}

/* Mini Game Widget */
#mini-game-widget #game-area {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

#mini-game-widget #game-button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* Typing Speed Test Widget */
.terminal-like-typing {
  /* Resembles the main terminal */
  background-color: var(--terminal-bg, rgba(15, 15, 25, 0.95));
  border: 1px solid var(--terminal-border, #3730a3);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.2);
  height: 100%; /* Make it fill the widget space */
  display: flex;
  flex-direction: column;
}

#typing-text-display {
  background-color: rgba(10, 10, 20, 0.8); /* Darker than widget bg */
  border: 1px solid rgba(79, 70, 229, 0.2);
  min-height: 90px; /* Adjust as needed */
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.6;
  flex-grow: 1;
}

#typing-text-display span {
  transition: color 0.2s ease-in-out;
}

#typing-input {
  background-color: rgba(30, 30, 50, 0.5);
  border: 1px solid var(--terminal-border, #3730a3);
  resize: none; /* Prevent manual resize */
}

#typing-stats {
  font-size: 0.875rem; /* text-sm */
}

/* Projects Showcase Widget */
.project-card {
  /* Tailwind classes handle most styling */
  /* Add specific card styles here if needed */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  box-shadow: 0 0 20px var(--primary-glow, #4f46e5);
}

/* Responsive adjustments for widgets if needed */
@media (max-width: 768px) {
  .widgets-container .grid {
    grid-template-columns: 1fr; /* Stack widgets on mobile */
  }
  #typing-test-widget {
    grid-column: span 1 / span 1; /* Override col-span on mobile */
  }
  #projects-showcase-widget {
    grid-column: span 1 / span 1; /* Override col-span on mobile */
  }
}

/* Footer */
.site-footer {
  /* Tailwind class pt-8, text-center, border-t, border-gray-700 handle some styling */
  width: 100%;
  flex-shrink: 0; /* Added per user spec */
  margin-top: 0; /* Added per user spec */
  padding-bottom: 0; /* Added per user spec */
  /* background-color: rgba(10, 10, 20, 0.5); */ /* Optional: if you want a slightly different bg for footer */
}

.site-footer p i.fas {
  transition: color 0.3s ease;
}

.site-footer p i.fas:hover {
  color: var(--secondary-glow);
}

#terminal-tooltip-icon {
  /* Tailwind classes used: absolute top-2 right-2 text-gray-400 hover:text-white cursor-pointer */
  /* Additional styles if needed */
}

#terminal-tooltip {
  /* Tailwind classes used: absolute inset-0 bg-gray-900 bg-opacity-90 p-4 rounded-lg z-10 flex flex-col items-center justify-center hidden */
  /* Ensure it covers the terminal body. The parent .terminal-section might need position: relative if .terminal isn't already a positioning context */
}

#suggestions-container {
  /* Tailwind classes are applied in JS: 
     absolute bg-gray-800 bg-opacity-95 border border-gray-700 
     rounded-md shadow-lg p-1 text-sm code-font z-20 hidden 
  */
  /* JS also sets: left, bottom, width, maxHeight, overflowY */
  /* Ensure z-index is high enough if other elements overlap */
  z-index: 20;
}

#suggestions-container > div {
  /* Tailwind classes: p-1 hover:bg-gray-700 cursor-pointer text-gray-300 */
  /* Highlight class in JS: bg-gray-600 */
  transition: background-color 0.1s ease-in-out;
}

/* Horizontal Scroll Progress Bar */
#scroll-progress-bar-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px; /* Adjust height as needed */
  background-color: rgba(30, 30, 50, 0.5); /* Subtle background for the track */
  z-index: 1000; /* Ensure it's above most other content */
}

#scroll-progress-bar {
  height: 100%;
  width: 0; /* Initial width, will be updated by JS */
  background: linear-gradient(
    90deg,
    var(--primary-glow),
    var(--secondary-glow)
  );
  border-radius: 0 2px 2px 0; /* Slight rounding on the right edge */
  transition: width 0.1s ease-out; /* Smooth transition for width changes */
}

/* Adjust body padding if navbar is fixed and opaque, not needed here as progress bar is thin */
/* body {
  padding-top: 4px; 
} */

/* Custom Page Scrollbar */
#page-scrollbar-track {
  position: fixed;
  right: 0;
  top: 4px; /* Adjusted for 4px height of scroll-progress-bar-container */
  bottom: 0;
  width: 10px; /* Width of the track */
  background-color: rgba(30, 30, 50, 0.3); /* Subtle track color */
  z-index: 998; /* Below progress bar, above most content */
  border-left: 1px solid var(--terminal-border);
}

#page-scrollbar-thumb {
  position: absolute;
  right: 1px; /* Indent from track edge */
  width: 8px; /* Width of the thumb, slightly smaller than track */
  background-color: var(--primary-glow);
  opacity: 0.7;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s ease-in-out;
}

#page-scrollbar-thumb:hover {
  opacity: 1;
  background-color: var(--secondary-glow);
}

/* Adjust #page-scrollbar-track top if horizontal bar has significant height */
/* Example if horizontal bar is 4px: 
#page-scrollbar-track {
  top: 4px; 
}
*/
