* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* The "Alignment Charm" */
}

@font-face {
  font-family: 'HarryPotter';
  /* Give your font a custom name */
  src: url('HARRYP__.TTF') format('truetype');
  /* Point to your font file */
  font-weight: normal;
  font-style: normal;
}

body {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48'><text y='27' x='0' style='font-size: 32px; text-shadow: 0 0 5px gold, 0 0 10px gold, 0 0 15px gold;'>🪄</text></svg>"), auto;
  /* background-color: white; */
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  font-size: 1rem;
  color: #fff;
  text-shadow: 0 0 5px #363201, 0 0 10px #5c6606, 0 0 15px #9cac0f;

  overflow-x:hidden;
  width:100%;
  position:relative;
  
  /* background */
  background-color: #0b0b14; 
  /* dark slate/midnight blue fallback such that the white text is visible if bg doesn't load */
  background-image: url(bg.png);
  background-size: cover;
  /* This makes the image cover the entire body */
  background-position: center;
  /* This centers the image in the background */
  background-attachment: fixed;
  /* This makes the background image stay in place when scrolling */
}

body:active {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48'><text y='27' x='0' style='font-size: 32px; text-shadow: 0 0 5px red, 0 0 10px red, 0 0 15px red;'>⚡</text></svg>"), auto;
}

a:hover {
  cursor: pointer;
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='48' height='48'><text y='27' x='0' style='font-size: 32px; text-shadow: 0 0 5px gold, 0 0 10px gold, 0 0 15px gold;'>⚡</text></svg>"), pointer;
}

header {
  background-color: rgba(13, 13, 43, 0.8);
  color: rgba(236, 176, 10, 0.705);
  padding: 1% 2%;

  /* for alignment */
  /* justify-content: center;
  text-align: center; */
  width: 100%;
  box-sizing: border-box;
  text-shadow: 0 0 5px #363201, 0 0 10px #5c6606, 0 0 15px #9cac0f;
  display: grid;
  place-items: end;
  position: fixed;
  /* width: calc(100% - 100px); */
  top: 0;
  z-index: 1000;

  display: flex;
}

.header-logo {
  height: 48px;
  width: auto;
  margin-right: 20%;   /* Space between logo and header text */
  margin-left: 0;
  display: block;
}

a:hover {
  animation: glitter 1.5s infinite alternate;
  transform: scale(1);
  font-size: 1.2rem;
  text-shadow: 0 0 5px #363201, 0 0 10px #5c6606, 0 0 15px #9cac0f;
}

a:active {
  animation: pulse 0.6s ease-out;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
    /* Increase size to 1.2 */
  }

  100% {
    transform: scale(1);
    /* Return to original size */
  }
}


@keyframes pulseGlow {
    0% {
        text-shadow: 0 0 5px #363201, 0 0 10px #5c6606, 0 0 15px #9cac0f;
    }
    50% {
        text-shadow: 0 10px 25px rgba(6, 232, 240, 0.61);
    }
    100% {
        text-shadow: 0 0 5px #363201, 0 0 10px #5c6606, 0 0 15px #9cac0f;
    }
}
header h1 {
  flex-shrink: 1;
  text-align: center;
  /* This will center the text within its container */
  font-family: 'HarryPotter', sans-serif;
  font-size: 3.3rem;
  margin: auto;
  /* Remove default margin to ensure perfect centering */
  animation: pulseGlow 4s ease-in-out infinite;

}

header nav {
  /* display: flex; */
  /* align-items: center; */
}

header nav a {
  font-family: 'Elsie Swash Caps', serif;
  font-weight: 400;
  font-size: 1.2rem; /* Elsie needs to be slightly larger to see the detail */
  letter-spacing: 1px;
  color: #f0c129b2;
  text-decoration: none;
  font-weight: bold;
  margin-left: 20px;
  /* position: absolute;
  right: 0px; */
}
header nav a:hover {
    transform: translateY(-3px);
    font-size: 1.4rem;
}

/* Effects for header */
header h1 {
  position: relative;
  cursor: pointer; 
}

header h1::after {
  content: "Bombarda! You opened the Chamber of Secrets!";
  position: absolute;
  bottom: -40px; 
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap; /* Prevents the message from wrapping to a new line */
  background-color: rgba(236, 176, 10, 0.705);
  color: #111;
  padding: 5px 10px;
  border-radius: 5px;
  opacity: 0; /* Hidden by default */
  pointer-events: none; /* Prevents the element from blocking clicks */
  transition: opacity 0.3s ease-in-out; /* Smooth transition for fading in/out */
}

header h1:hover::after {
  opacity: 1; /* Make the message visible on hover */
}





#about h2 {
  text-align: center;
  font-size: 2.5rem;
  font-family: 'HarryPotter', sans-serif;
  color: #f8d03f;
  /* A lighter, more visible yellow */
  text-shadow: 0 0 5px #363201, 0 0 10px #5c6606, 0 0 15px #9cac0f;
  padding-top: 90px;
}


/* For text animation at #about */
/* Container styles */
.typewriter-container {
  font-size: 2rem;
  font-family: 'Courier New', Courier, monospace;
  overflow: hidden;
  /* Hide the overflow text */
  white-space: pre-wrap;
  /* This ensures that newlines are respected */
  display: block;
  margin: 20px auto;
  width: fit-content;
  position: relative;
  border-right: 2px solid;
}

.typewriter-text::after {
  content: '|';
  animation: blink 0.7s step-start infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.about-container {
  max-width: 800px;
  padding: 20px;
  margin: 20px auto;
  font-size: medium;
  background-color: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 215, 0, 0.5);
  /* Gold border to match the theme */
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  /* Gold glow effect */
}


/* caraousel */
.carousel-wrapper {
  margin: 50px auto;
  height: 300px;
  /* background: #ffffff; */
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
  overflow: hidden;
  width: 100vw;
  /* height: 300px; */
  position: relative;
  /* transform-style: preserve-3d; */
}

.carousel {

  width: 200px;
  height: 150px;
  position: relative;
  transform-style: preserve-3d;
  animation: rotate 30s linear infinite;
  transform-origin: center center;
}

.carousel:hover {
  animation-play-state: paused;
  /* ✅ Pause on hover */
}

.carousel a {
  position: absolute;
  width: 200px;
  height: 150px;
  display: block;
  transform-origin: center;
}

.carousel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s;
}

.carousel img:hover {
  transform: scale(1.1);
  /* Zoom on hover */
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(6, 232, 240, 0.61);
}

@keyframes rotate {
  from {
    transform: rotateY(0deg);
  }

  to {
    transform: rotateY(360deg);
  }
}

/* description part of caraousel */
.desc-overlay {
    display: none;
    position: absolute;
    bottom: 10px; /* Positions it at the bottom of the wrapper */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    border: 1px solid #f8d03f;
    padding: 10px 20px;
    z-index: 5000;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    color: #f8d03f;
    /* font-family: 'HarryPotter', sans-serif; */
    text-align: center;
    box-shadow: 0 0 15px rgba(248, 208, 63, 0.4);
}
/* it(caraousel) ends here */


/* projects section */
/* Styling for the new "Mischief Managed" section */
#projects {
  padding: 50px 20px;
  text-align: center;
}

#projects h2 {
  font-size: 2.5rem;
  font-family: 'HarryPotter', sans-serif;
  color: #f8d03f;
  /* A lighter, more visible yellow */
  text-shadow: 0 0 5px #363201, 0 0 10px #5c6606, 0 0 15px #9cac0f;
  /* text-shadow: 0 0 10px #F8D13F, 0 0 20px #F8D13F, 0 0 30px #F8D13F; Stronger glow effect */
}

.projects-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  /* Space between the project cards */
  margin-top: 50px;
}

.project-card {
  background-color: rgba(0, 0, 0, 0.7);
  /* A darker, more prominent semi-transparent background */
  border: 2px solid rgba(0, 255, 255, 0.5);
  border-radius: 10px;
  padding: 25px;
  width: 300px;
  text-align: left;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
  transition: transform 0.3s ease-in-out;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 25px rgba(0, 255, 255, 0.7);
}


.project-card h3 {
    font-family: 'Algerian', 'serif'; /* Falls back to serif if Algerian isn't on the system */
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-transform: uppercase; /* Algerian looks best in all caps */
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    margin-bottom: 10px;
    color: #00FFFF;
}

.project-card .description {
  font-size: 1rem;
  line-height: 1.5;
}

.tech-used {
  list-style-type: none;
  /* Removes the default bullet points */
  padding: 0;
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tech-used li {
  background-color: rgba(255, 215, 0, 0.2);
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 0.9rem;
  color: #FFD700;
  font-weight: bold;
}

/* work for links button of github and project */
/* Container for alignment */
.project-links {
    margin-top: 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
}

/* Base button styling */
.btn-magic {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    text-decoration: none;
    color: #f8d03f; /* Gold text */
    /* font-family: 'HarryPotter', sans-serif; */
    font-size: 0.9rem;
    border: 1px solid #f8d03f;
    border-radius: 5px;
    background: rgba(248, 208, 63, 0.1);
    transition: all 0.3s ease-in-out;
    text-shadow: 0 0 5px #363201;
}

/* Hover effect - "Glow" */
.btn-magic:hover {
    background: rgba(248, 208, 63, 0.3);
    box-shadow: 0 0 15px #f8d03f;
    transform: translateY(-3px);
    font-size: 0.95rem;
    color: #fff;
}

.btn-magic i {
    font-size: 1rem;
}

/* Skills and Experience Section */
#skills-experience {
    padding: 80px 20px;
    background-color: transparent;
    text-align: center;
}

.section-heading {
    font-family: 'HarryPotter', sans-serif;
    font-size: 3rem;
    color: #FFD700;
    margin-bottom: 50px;
    text-shadow: 0 0 5px gold, 0 0 10px gold, 0 0 15px gold;
}

.skills-grid {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

/* Common Card Styles */
.skills-card, .experience-card {
    border-radius: 10px;
    padding: 30px;
    max-width: 450px;
    transition: transform 0.3s ease-in-out;
}

.skills-card:hover, .experience-card:hover {
    transform: translateY(-10px);
}

.skills-card h3, .experience-card h3 {
    font-family: 'HarryPotter', sans-serif;
    color: #f8d13f;
    font-size: 2rem;
    margin-bottom: 20px;
}

.skills-card ul, .job ul {
    list-style: none;
    padding: 0;
    text-align: left;
}


/* Skills Card - Potions Shelf Styling */
.skills-card {
    background: rgba(0, 0, 0, 0.4);
    border: 3px solid #00FFFF;
    position: relative;
    box-shadow: 0 0 20px #00ffff79, 0 0 30px #00ffff79;
}

.skills-card h3 {
    color: #00FFFF;
}

.skills-card ul {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.skills-card li {
    color: #E0FFFF;
    font-size: 1.3rem;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    transition: all 0.3s ease-in-out;
}

.skills-card li:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.8), inset 0 0 10px rgba(0, 255, 255, 0.5);
}

.skills-card li i {
    color: #00FFFF;
    margin-right: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Experience Card - Magical Scroll Styling */
.experience-card {
    background: rgba(0, 0, 0, 0.4);
    border: 3px solid #FF00FF; /* Changed to a magical purple */
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px #ff00ff81, 0 0 30px #ff00ff81; /* Added warm glow */
}

.experience-card h3 {
  color: #ff00ffb2;
}

.experience-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255, 0, 255, 0.2), transparent, rgba(255, 0, 255, 0.2));
    z-index: 1;
}

.job {
    margin-bottom: 25px;
    border-bottom: 1px dashed rgba(255, 215, 0, 0.3);
    padding-bottom: 20px;
    position: relative;
    z-index: 2;
}

.job:last-child {
    border-bottom: none;
}

.job h4 {
    font-family: 'Algerian', 'serif';
    font-size: 1.5rem;
    color: #f8d13f;
    text-shadow: 0 0 15px rgba(248, 208, 63, 0.4);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.job .company, .job .dates {
    color: #d68e07;
    font-size: 1.2rem;
    margin-bottom: 5px;
}
.job ul {
  padding: 0;
  margin-top: 0.5rem;
}
.job ul li {
  display: flex; /* Apply flexbox to the list items for icon alignment */
  align-items: flex-start;
  margin-bottom: 0.5rem;
}
.job ul li i {
  margin-right: 0.5rem; /* Space between the icon and the text */
  margin-top: 0.2rem; /* Fine-tune vertical alignment of the icon */
}



/* Contact Section Styles */
#contact {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 100px 0;
  text-align: center;
}

.contact-container {
  max-width: 800px;
  padding: 20px;
  background-color: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(255, 215, 0, 0.5);
  /* Gold border to match the theme */
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  /* Gold glow effect */
}

.contact-container h2 {
  font-family: 'HarryPotter', sans-serif;
  font-size: 2.5rem;
  color: #F8D13F;
  /* Lighter gold for readability */
  text-shadow: 0 0 5px #363201, 0 0 10px #5c6606, 0 0 15px #9cac0f;
}

.contact-container p {
  font-size: 1.2rem;
  color: #f0f0f0;
  line-height: 1.6;
  margin-bottom: 30px;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 30px;
}

.social-icon {
  font-size: 2.5rem;
  color: #F8D13F;
  text-shadow: 0 0 5px #F8D13F;
  transition: transform 0.3s ease-in-out, text-shadow 0.3s ease-in-out;
}

.social-icon:hover {
  transform: scale(1.2);
  text-shadow: 0 0 10px #F8D13F, 0 0 20px #F8D13F, 0 0 30px #F8D13F;
}


/* for special texts in b/w para */
.spcl_txts {
  font-size: 1.5rem;
  font-family: 'HarryPotter', sans-serif;
  color: #f8d03f;
  /* A lighter, more visible yellow */
  text-shadow: 0 0 5px #363201, 0 0 10px #5c6606, 0 0 15px #9cac0f;
}

/* footer starts here */
footer {
  text-align: center;
  padding: 0.5rem 0;
  background: rgba(13, 13, 43, 0.8);
  color: #fff;
  font-size: 1.1rem;
  text-shadow: 0 0 5px #363201, 0 0 10px #5c6606, 0 0 15px #9cac0f;
} 




/* background effects */
/* Magical Spell Rays Effect */
.background-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Allows clicks to pass through */
  z-index: -1; /* Puts it behind all other content */
}

.particle {
  position: absolute;
  width: 2px; /* Increased width for better visibility */
  height: 150px;
  background: linear-gradient(
    to bottom,
    rgba(255, 215, 0, 0), /* Changed to a golden color */
    rgba(255, 215, 0, 0.8),
    rgba(255, 215, 0, 0)
  );
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.8); /* Increased glow and changed color */
  opacity: 0;
  animation: castSpell 15s linear infinite;
}

/* Random particle positions and rotations */
.particle:nth-child(1) { left: 10%; animation-delay: 1s; transform: rotate(45deg); }
.particle:nth-child(2) { left: 20%; animation-delay: 3s; transform: rotate(-30deg); }
.particle:nth-child(3) { left: 30%; animation-delay: 5s; transform: rotate(60deg); }
.particle:nth-child(4) { left: 40%; animation-delay: 7s; transform: rotate(-15deg); }
.particle:nth-child(5) { left: 50%; animation-delay: 9s; transform: rotate(75deg); }
.particle:nth-child(6) { left: 60%; animation-delay: 11s; transform: rotate(10deg); }
.particle:nth-child(7) { left: 70%; animation-delay: 13s; transform: rotate(-45deg); }
.particle:nth-child(8) { left: 80%; animation-delay: 15s; transform: rotate(30deg); }
.particle:nth-child(9) { left: 90%; animation-delay: 17s; transform: rotate(-70deg); }
.particle:nth-child(10) { left: 95%; animation-delay: 19s; transform: rotate(25deg); }


/* The animation that makes particles appear and move down with a random flash */
@keyframes castSpell {
  0% { transform: translateY(-100vh); opacity: 0; }
  15% { opacity: 1; }
  25% { box-shadow: 0 0 50px rgba(255, 215, 0, 1); } /* Added a bright flash here */
  26% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.8); }
  50% { box-shadow: 0 0 50px rgba(255, 215, 0, 1); } /* Added a second flash */
  51% { box-shadow: 0 0 15px rgba(255, 215, 0, 0.8); }
  75% { opacity: 1; }
  100% { transform: translateY(100vh); opacity: 0; }
}




/* --- CHATBOT INTEGRATION STYLES --- */

/* 1. Styling for the floating chat button */
#open-chat-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    
    /* Match HP Theme */
    background-color: rgba(236, 176, 10, 0.95);
    color: #111;
    font-weight: bold;
    padding: 12px 20px;
    border: none;
    border-radius: 30px; /* Rounded pill style */
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

#open-chat-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.9);
}


/* Chatbot Drawer Modal Container */
.chat-container {
    display: none;
    position: fixed;
    bottom: 85px;
    right: 20px;
    width: 370px;
    height: 520px;
    max-height: 75vh;
    background: rgba(13, 13, 33, 0.75);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 2px solid #f8d03f;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 25px rgba(248, 208, 63, 0.15);
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
    
    /* Magical entrance: scaled down, slightly rotated, blurred */
    transform: scale(0.6) rotate(-8deg) translateY(50px);
    transform-origin: bottom right;
    opacity: 0;
    filter: blur(8px);
    transition: 
        transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), 
        opacity 0.4s ease, 
        filter 0.4s ease, 
        box-shadow 0.4s ease;
}

.chat-container.active {
    display: flex;
    transform: scale(1) rotate(0deg) translateY(0);
    opacity: 1;
    filter: blur(0);
    /* Pulsating magical glow */
    animation: magicPulse 3s infinite alternate;
}

@keyframes magicPulse {
    0% {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(248, 208, 63, 0.25);
    }
    100% {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 40px rgba(248, 208, 63, 0.5), inset 0 0 15px rgba(248, 208, 63, 0.15);
    }
}

/* Chat Header */
.chat-header {
    background-color: rgba(236, 176, 10, 0.18);
    border-bottom: 1px solid rgba(248, 208, 63, 0.25);
    padding: 10px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 48px;
    box-sizing: border-box;
}

.chat-title {
    font-weight: bold;
    font-size: 1.2rem;
    color: #f8d03f;
    font-family: 'HarryPotter', sans-serif;
    letter-spacing: 1px;
    text-shadow: 0 0 5px #363201;
}

#close-chat-btn {
    background: none;
    border: none;
    font-size: 1.3rem; /* Styled for Font Awesome icon */
    color: #f8d03f;
    cursor: pointer;
    transition: transform 0.3s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    width: 32px;
    height: 32px;
}

#close-chat-btn:hover {
    color: #fff;
    transform: scale(1.15) rotate(90deg); /* Magical rotation on hover */
}

/* Chat Box (Message Area) */
.chat-box {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(10, 10, 20, 0.35);
}

/* Custom Scrollbar for Chat Box */
.chat-box::-webkit-scrollbar {
    width: 5px;
}

.chat-box::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.chat-box::-webkit-scrollbar-thumb {
    background: #f8d03f;
    border-radius: 3px;
}

/* Message Rows */
.message-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 85%;
}

.user-message-row {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.bot-message-row {
    align-self: flex-start;
}

/* Avatars */
.bot-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(248, 208, 63, 0.5);
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(13, 13, 33, 0.9);
}

/* Message Bubbles */
.message {
    padding: 10px 14px;
    border-radius: 15px;
    font-size: 0.92rem;
    line-height: 1.45;
    word-wrap: break-word;
}

.user-message {
    background: rgba(248, 208, 63, 0.15);
    border: 1px solid rgba(248, 208, 63, 0.4);
    color: #fff;
    border-bottom-right-radius: 2px;
    text-shadow: none;
}

.bot-message {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e0e0e0;
    border-bottom-left-radius: 2px;
    text-shadow: none;
}

.bot-message p {
    margin: 6px 0;
}

.bot-message p:first-child {
    margin-top: 0;
}

.bot-message p:last-child {
    margin-bottom: 0;
}

.bot-message a {
    color: #f8d03f;
    text-decoration: underline;
}

.bot-message ul, .bot-message ol {
    padding-left: 18px;
    margin: 6px 0;
}

/* Typing Indicator Animation */
.typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #f8d03f;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite both;
    margin-right: 3px;
}

.typing-indicator span:nth-child(2) { animation-delay: .2s; }
.typing-indicator span:nth-child(3) { animation-delay: .4s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Input Area */
.chat-input-area {
    display: flex;
    padding: 10px 15px;
    border-top: 1px solid rgba(248, 208, 63, 0.25);
    background: rgba(13, 13, 33, 0.95);
    gap: 10px;
    align-items: center;
    box-sizing: border-box;
}

.chat-input-area input {
    flex: 1;
    border: 1px solid rgba(248, 208, 63, 0.3);
    padding: 10px 15px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    outline: none;
    font-size: 0.95rem;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s;
    text-shadow: none;
}

.chat-input-area input:focus {
    border-color: #f8d03f;
}

.chat-input-area button {
    border: none;
    background: rgba(248, 208, 63, 0.9);
    color: #111;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.chat-input-area button:hover {
    background: #fff;
    transform: scale(1.05);
}

/* Mobile Responsive Adaptations */
@media (max-width: 480px) {
    .chat-container {
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        width: 100vw;
        height: 100%; /* fallback */
        height: 100dvh; /* dynamic height to avoid mobile address bar cut-offs */
        max-height: 100dvh;
        border-radius: 0;
        border: none;
        border-top: 3px solid #f8d03f;
        transform-origin: center;
        
        /* Mobile animation: slide up from the bottom */
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    }
    
    .chat-container.active {
        transform: translateY(0);
        animation: none;
        box-shadow: none;
    }
}




#menu-toggle {
    display: none;
}


/* Responsive Design for Mobile Devices */
@media (max-width: 1024px) {
    /* Header & Nav */
  header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px !important;
    height: 64px;
    box-sizing: border-box;
  }

  .header-logo {
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    height: 38px !important;
    display: block;
  }

  header h1 {
    font-size: 1.8rem !important;
    margin: 0 !important;
  }

  /* Display and style the Hamburger toggle */
  #menu-toggle {
    display: block;
    background: none;
    border: none;
    color: #f8d03f;
    font-size: 1.6rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 1001;
  }

  #menu-toggle.active {
    transform: rotate(90deg);
  }

  /* Turn nav bar into sliding overlay drawer */
  header nav {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    width: 260px;
    height: 100vh;
    background: rgba(13, 13, 33, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-left: 2px solid #f8d03f;
    padding: 90px 25px 20px 25px;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
    justify-content: flex-start;
    gap: 30px;
    z-index: 1000;
    
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  header nav.active {
    transform: translateX(0);
  }

  header nav a {
    margin: 0 !important;
    font-size: 1.25rem !important;
    width: 100%;
    text-align: left;
    border-bottom: 1px dashed rgba(248, 208, 63, 0.2);
    padding-bottom: 8px;
  }
    
  header h1::after {
    font-size: 0.95rem !important;
    white-space: normal !important;
    width: 200px !important;
    bottom: -55px !important;
    background-color: rgba(236, 176, 10, 0.95) !important; /* solid background */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
    border: 1px solid #f8d03f !important;
  }

  /* Carousel - Shrink the radius for small screens */
  .carousel-wrapper {
    margin-top: 100px;    /* Move it down from the fixed header */
    margin-bottom: 20px;  /* Reduce the vacant space below */
    height: 250px;        /* Height needed for the 3D rotation */
    perspective: 800px;   /* Sharper perspective for smaller screens */
  }

  .carousel {
    width: 120px; /* Smaller images */
    height: 90px;
  }

  .carousel a {
    width: 120px;
    height: 90px;
  }

  /* About & Containers */
  #about{
    margin-top: 0;
    padding-top: 20px;
  }
  #about h2 {
    padding-top: 0; /* Remove the large padding since we handled it in the wrapper */
  }
  .about-container, .contact-container {
    width: 95%;
    margin: 10px auto;
    padding: 15px;
  }

  .typewriter-container {
    font-size: 1.2rem;
    width: 90%;
  }

  /* Skills & Experience - Stack them vertically */
  .skills-grid {
    flex-direction: column;
    align-items: center;
  }

  .skills-card, .experience-card {
    width: 100%;
    max-width: none;
  }
}



#magic-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none; /* Crucial: lets you click buttons through the canvas */
    z-index: 9999; /* Put it on top of everything to see the trail */
}



/* --- COMPACT HEADER FOR MOBILE LANDSCAPE --- */
@media (max-height: 480px) and (orientation: landscape) {
    header {
        height: 48px !important; /* Shrunk from 64px */
        padding: 5px 15px !important;
    }

    .header-logo {
        height: 30px !important; /* Shrunk from 38px */
    }

    header h1 {
        font-size: 1.4rem !important; /* Smaller title font */
    }

    #menu-toggle {
        font-size: 1.3rem !important; /* Smaller toggle icon */
    }

    /* Adjust the navigation drawer list padding so items don't overflow vertically */
    header nav {
        padding-top: 60px !important;
        gap: 15px !important;
        width: 220px !important;
    }
    
    header nav a {
        font-size: 1rem !important;
        padding-bottom: 5px !important;
    }

    /* Reduce vertical padding of the Chamberlain Tooltip on short landscape views */
    header h1::after {
        bottom: -45px !important;
        font-size: 0.7rem !important;
        padding: 3px 8px !important;
    }
}



/* --- PHONE-ONLY TOOLTIP SHRINK --- */
@media (max-width: 480px) {
    header h1::after {
        font-size: 0.75rem !important; /* Only tiny on small phones */
        width: 180px !important;
        bottom: -60px !important;
    }
}



/* --- SPOTLIGHT OVERLAY (LUMOS) --- */
#lumos-spotlight {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none; /* Crucial: lets you click elements underneath */
    z-index: 9998; /* Just below particles canvas */
    background: radial-gradient(circle 120px at 0px 0px, transparent 100%, rgba(0, 0, 0, 0.95) 100%);
    transition: opacity 0.5s ease;
}

/* --- HOGWARTS LETTER EASTER EGG --- */
.letter-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 20000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    box-sizing: border-box;
}

.letter-modal.active {
    display: flex;
    opacity: 1;
}

.letter-content {
    background-color: #f3edd3; /* Vintage Parchment Paper */
    background-image: radial-gradient(rgba(139, 107, 35, 0.05) 1px, transparent 0);
    background-size: 20px 20px;
    border: 6px double #8b6b23;
    border-radius: 4px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 35px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), inset 0 0 50px rgba(139, 107, 35, 0.2);
    position: relative;
    color: #382c16; /* Dark Sepia Ink */
    font-family: 'Georgia', serif;
    line-height: 1.5;
    transform: translateY(-60px);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-sizing: border-box;
}

.letter-modal.active .letter-content {
    transform: translateY(0);
}

.close-letter {
    position: absolute;
    top: 10px;
    right: 18px;
    font-size: 2.2rem;
    color: #8b6b23;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
    z-index: 2;
}

.close-letter:hover {
    color: #b52b2b; /* Red wax seal color */
    transform: scale(1.1);
}

.letter-header {
    text-align: center;
    border-bottom: 1px solid rgba(139, 107, 35, 0.25);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.letter-crest {
    height: 55px;
    width: auto;
    margin-bottom: 10px;
    filter: sepia(1) saturate(1.8) hue-rotate(5deg) contrast(0.9);
}

.school-title {
    font-family: 'HarryPotter', sans-serif;
    color: #6d1a1a; /* Crimson Red */
    font-size: 1.25rem;
    letter-spacing: 1px;
    margin: 0;
    text-shadow: none !important;
}

.letter-body {
    font-size: 0.9rem;
    text-shadow: none !important;
}

.letter-body p {
    margin-bottom: 12px;
}

.letter-body strong {
    color: #6d1a1a;
}

.letter-sign {
    margin-top: 25px !important;
    margin-bottom: 3px !important;
}

.letter-sign-name {
    font-family: 'Elsie Swash Caps', serif;
    font-size: 1.1rem;
    font-weight: bold;
    color: #8b6b23;
    line-height: 1.2;
}

.letter-sign-name span {
    font-family: 'Poppins', sans-serif;
    font-size: 0.75rem;
    color: #777;
    font-weight: normal;
}

/* Name Prompt Input specific style overlay */
.name-prompt-content input {
    border: 2px solid rgba(139, 107, 35, 0.4);
    background: rgba(255, 255, 255, 0.5);
    color: #382c16;
    padding: 10px 15px;
    border-radius: 20px;
    outline: none;
    font-size: 1rem;
    width: 100%;
    max-width: 300px;
    margin: 15px auto;
    display: block;
    box-sizing: border-box;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    text-shadow: none !important;
}

.name-prompt-content input:focus {
    border-color: #8b6b23;
    box-shadow: 0 0 8px rgba(139, 107, 35, 0.3);
}

.name-prompt-content .btn-magic {
    display: block;
    margin: 0 auto;
    border-radius: 20px !important;
    background-color: #8b1c1c; /* Crimson background for high contrast */
    color: #f8d03f; /* Gold text */
    border: 2px solid #8b6b23; /* Dark gold border */
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.name-prompt-content .btn-magic:hover {
    background-color: #f8d03f; /* Gold background on hover */
    color: #8b1c1c; /* Crimson text on hover */
    border-color: #8b1c1c;
    box-shadow: 0 4px 15px rgba(139, 28, 28, 0.4);
    transform: translateY(-2px);
}


/* --- 3D CHAMBER DOORS OVERLAY --- */
.door-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 19999;
    perspective: 1200px;
    overflow: hidden;
    background-color: #050508;
}

.door-panel {
    position: absolute;
    width: 50%;
    height: 100%;
    top: 0;
    background: #19120a; /* Dark ancient wood panel */
    transition: transform 1.5s cubic-bezier(0.77, 0, 0.175, 1);
    transform-style: preserve-3d;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.9);
    z-index: 1;
}

.door-texture {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 15px solid #0a0704;
    box-sizing: border-box;
    background-image: 
        repeating-linear-gradient(90deg, transparent, transparent 35px, rgba(0,0,0,0.2) 35px, rgba(0,0,0,0.2) 70px),
        linear-gradient(to right, rgba(0,0,0,0.4), transparent, rgba(0,0,0,0.4));
}

.left-panel {
    left: 0;
    transform-origin: left center;
    border-right: 5px solid #070503;
}

.right-panel {
    right: 0;
    transform-origin: right center;
    border-left: 5px solid #070503;
}

/* Door opening trigger states */
.door-overlay.open .left-panel {
    transform: rotateY(-110deg);
}

.door-overlay.open .right-panel {
    transform: rotateY(110deg);
}

.lock-plate {
    position: absolute;
    left: -25px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 100px;
    background: #211c16;
    border: 3px solid #f8d03f;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.6);
    z-index: 2;
}

.keyhole {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 25px;
    background: #000;
    clip-path: polygon(30% 0%, 70% 0%, 70% 40%, 100% 100%, 0% 100%, 30% 40%);
    box-shadow: 0 0 10px rgba(248, 208, 63, 0);
    transition: box-shadow 0.4s, background-color 0.4s;
}

/* Glowing keyhole unlocking indicator */
.door-overlay.unlocking .keyhole {
    box-shadow: 0 0 15px #f8d03f, 0 0 25px #f8d03f;
    background-color: #f8d03f;
}


/* --- MAGICAL ENVELOPE WRAPPER --- */
.envelope-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    z-index: 0; /* Floats behind closed doors */
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.door-overlay.open .envelope-wrapper {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
    animation: floatEnvelope 3s ease-in-out infinite;
}

@keyframes floatEnvelope {
    0%, 100% { transform: translate(-50%, -50%) translateY(0) rotate(0deg); }
    50% { transform: translate(-50%, -50%) translateY(-15px) rotate(2deg); }
}

.envelope {
    width: 320px;
    height: 210px;
    background-color: #f3edd3; /* Parchment Cream */
    border-radius: 4px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(139, 107, 35, 0.25);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-left: 160px solid transparent;
    border-right: 160px solid transparent;
    border-top: 100px solid #e2dac0;
    z-index: 1;
}

.wax-seal {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 44px;
    background-color: #8b1c1c; /* Crimson Red Wax */
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4), inset 0 0 10px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.wax-seal::after {
    content: 'H';
    color: #f8d03f;
    font-family: 'HarryPotter', sans-serif;
    font-weight: bold;
    font-size: 1.4rem;
    text-shadow: none !important;
}

.envelope:hover .wax-seal {
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 6px 12px rgba(0,0,0,0.5), inset 0 0 10px rgba(0,0,0,0.5), 0 0 15px rgba(248, 208, 63, 0.4);
}

.envelope-address {
    position: absolute;
    top: 105px;
    left: 0;
    width: 100%;
    text-align: center;
    font-family: 'Georgia', serif;
    font-size: 0.85rem;
    color: #5c1818; /* Dark Crimson Ink */
    font-style: italic;
    line-height: 1.4;
    z-index: 0;
}

.address-name {
    font-weight: bold;
    font-size: 0.95rem;
}

/* Zoom animation on envelope unseal click */
.envelope-wrapper.zoom-out {
    transform: translate(-50%, -50%) scale(2.2) rotate(-10deg) !important;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.8s ease-in, opacity 0.8s ease;
}


/* --- LUMOS SPOTLIGHT HELP BUTTON & TOOLTIP --- */
#lumos-help-btn {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10005; /* Above black spotlight mask */
    background-color: rgba(248, 208, 63, 0.95);
    color: #111;
    font-weight: bold;
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color 0.2s;
    text-shadow: none !important;
    animation: typingBounce 1.4s infinite both;
}

#lumos-help-btn:hover {
    transform: scale(1.1);
    background-color: #fff;
}

.help-tooltip {
    display: none;
    position: fixed;
    bottom: 75px;
    left: 20px;
    width: 290px;
    background: #f3edd3;
    border: 3px double #8b6b23;
    border-radius: 8px;
    padding: 15px 20px;
    color: #382c16;
    font-family: 'Georgia', serif;
    font-size: 0.88rem;
    line-height: 1.5;
    box-shadow: 0 10px 25px rgba(0,0,0,0.6), inset 0 0 30px rgba(139, 107, 35, 0.15);
    z-index: 10005;
    box-sizing: border-box;
    text-shadow: none !important;
    animation: tooltipPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.close-help {
    position: absolute;
    top: 5px;
    right: 12px;
    font-size: 1.4rem;
    color: #8b6b23;
    cursor: pointer;
    line-height: 1;
}

.close-help:hover {
    color: #b52b2b;
}

@keyframes tooltipPop {
    from { transform: scale(0.8) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}


/* --- SPELLBOOK GAME SECTION STYLES --- */
#spells-game {
    padding: 80px 20px;
    background-color: transparent;
    text-align: center;
}

.game-container {
    max-width: 800px;
    padding: 30px;
    margin: 0 auto;
    background-color: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 215, 0, 0.5); /* Gold border */
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.game-container h2 {
    font-family: 'HarryPotter', sans-serif;
    font-size: 2.5rem;
    color: #F8D13F;
    margin-bottom: 10px;
    text-shadow: 0 0 5px #363201, 0 0 10px #5c6606, 0 0 15px #9cac0f;
}

.game-instructions {
    font-size: 1.1rem;
    color: #e0e0e0;
    margin-bottom: 25px;
    text-shadow: 0 0 5px #363201;
}

.spell-shelf {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.spell-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(248, 208, 63, 0.35);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #ccc;
    transition: transform 0.2s, background-color 0.2s;
    text-shadow: none !important;
}

.spell-item:hover {
    transform: translateY(-3px);
    background-color: rgba(248, 208, 63, 0.1);
    border-color: #f8d03f;
}

.spell-item strong {
    color: #f8d03f;
    display: block;
    font-size: 1.1rem;
    margin-bottom: 3px;
    font-family: 'Georgia', serif;
}

.spell-cast-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
}

#spell-input {
    flex: 1;
    border: 2px solid rgba(248, 208, 63, 0.4);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    padding: 10px 18px;
    border-radius: 25px;
    outline: none;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-shadow: none !important;
}

#spell-input:focus {
    border-color: #f8d03f;
    box-shadow: 0 0 10px rgba(248, 208, 63, 0.4);
}

#cast-spell-btn {
    border-radius: 25px !important;
    padding: 10px 24px !important;
}

#spell-feedback {
    margin-top: 20px;
    font-size: 1.1rem;
    font-weight: bold;
    height: 24px; /* Fix layout jump */
    transition: color 0.3s;
    font-family: 'Elsie Swash Caps', serif;
    letter-spacing: 1px;
    text-shadow: none !important;
}

@media (max-width: 500px) {
    .spell-cast-controls {
        flex-direction: column;
        gap: 10px;
    }
}
