/* Global Styles */
:root {
  --primary: #38bdf8;
  --bg-dark: #020617;
  --bg-card: rgba(255, 255, 255, 0.05);
  --border: rgba(56, 189, 248, 0.2);
}

* {
  font-family: 'Plus Jakarta Sans', sans-serif;
  scroll-behavior: smooth;
}

body {
  background: #0b0f1a;
  color: #fff;
  margin: 0;
  overflow-x: hidden;
}

/* Hide scrollbar */
::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
html, body {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;     /* Firefox */
}

/* Navbar */
.navbar {
  background: rgba(11, 15, 26, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s;
  z-index: 1000;
}
.navbar-brand { font-size: 1.5rem; letter-spacing: 2px; }
.nav-link { font-weight: 500; margin-left: 20px; transition: 0.3s; }
.nav-link:hover { color: var(--primary) !important; }

/* Hero Section with Photo Background */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #020617; 
  padding: 100px 0;
  overflow: hidden;
}

/* The Photo Layer */
.hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('rushi.jpg');
  background-size: cover;
  background-position: center 20%;
  opacity: 0.25; 
  z-index: 1;
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

.hero .container {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 800;
  background: linear-gradient(to right, #fff, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: var(--primary);
  min-height: 1.6em;
  font-weight: 300;
}

.hero-buttons .btn {
  padding: 12px 35px;
  border-radius: 50px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: 0.4s;
}

/* Sections */
.section { padding: 100px 0; position: relative; z-index: 2; }
.section.dark { background: var(--bg-dark); }

.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 60px;
}

.section-title span { color: var(--primary); }

/* Experience Card */
.experience-card {
  background: var(--bg-card);
  padding: 40px;
  border-radius: 24px;
  border: 1px solid var(--border);
  max-width: 850px;
  margin: 0 auto 30px;
  transition: 0.4s;
}
.experience-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.1);
  transform: translateY(-5px);
}

.achievement-badge {
  background: rgba(56, 189, 248, 0.1);
  color: var(--primary);
  padding: 8px 20px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-block;
  margin-bottom: 20px;
}

/* Skills Styling */
.skill-category-title {
  text-align: left;
  color: var(--primary);
  font-weight: 700;
  margin: 40px 0 20px;
  letter-spacing: 2px;
  border-left: 4px solid var(--primary);
  padding-left: 15px;
  text-transform: uppercase;
  font-size: 1.2rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 20px;
  margin-bottom: 50px;
}

.skill-box {
  background: var(--bg-card);
  padding: 25px 15px;
  border-radius: 16px;
  text-align: center;
  border: 1px solid var(--border);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 125px;
  opacity: 0; 
  transform: translateY(20px);
}

.skill-box i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  color: var(--primary);
}

.skill-box span {
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.skill-box:hover {
  transform: translateY(-10px) !important;
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--primary);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

/* Projects Grid */
.projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
}

.project-card {
  background: var(--bg-card);
  padding: 35px;
  border-radius: 24px;
  border: 1px solid var(--border);
  transition: all 0.4s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  opacity: 0; 
  transform: translateY(30px);
}

.project-card:hover {
  border-color: var(--primary);
  transform: translateY(-10px) !important;
  background: rgba(56, 189, 248, 0.05);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.project-card h4 {
  color: var(--primary);
  margin-bottom: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-card ul {
  padding-left: 0;
  list-style: none;
  flex-grow: 1;
}

.project-card ul li {
  font-size: 0.95rem;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.7);
  position: relative;
  padding-left: 20px;
}
.project-card ul li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--primary);
}

.project-card a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 25px;
  background: rgba(56, 189, 248, 0.1);
  border-radius: 50px;
  transition: 0.3s;
  width: fit-content;
  margin-top: 20px;
  border: 1px solid transparent;
}

.project-card a:hover {
  background: var(--primary);
  color: var(--bg-dark);
}

/* Contact Section */
.contact-wrapper {
  background: var(--bg-card);
  padding: 50px;
  border-radius: 30px;
  max-width: 700px;
  margin: 0 auto;
  border: 1px solid var(--border);
}

.form-control::placeholder {
  color: #999;
  opacity: 1;
}

.form-control {
  background: rgba(0, 0, 0, 0.2) !important;
  border: 1px solid var(--border);
  color: #fff !important;
  padding: 15px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.btn-submit {
  background: var(--primary);
  color: var(--bg-dark);
  font-weight: 700;
  border-radius: 12px;
  padding: 15px;
  width: 100%;
  border: none;
  transition: 0.3s;
}

footer {
  padding: 50px 0;
  text-align: center;
  background: #010409;
  color: rgba(255,255,255,0.4);
  border-top: 1px solid var(--border);
}

.social-links a {
  color: #fff;
  font-size: 1.5rem;
  margin: 0 15px;
  transition: 0.3s;
  opacity: 0.6;
}
.social-links a:hover { color: var(--primary); opacity: 1; }

/* --- NEW: Preloader Styles --- */
body.loading {
  overflow: hidden; /* Prevents scrolling while loading */
}

.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg-dark);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loader-content {
  text-align: center;
  width: 300px;
}

.loader-brand {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 20px;
  letter-spacing: 2px;
}

.loader-bar-container {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 10px;
}

.loader-bar {
  width: 0%;
  height: 100%;
  background: var(--primary);
}

.loader-text {
  color: var(--primary);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 1px;
}

/* Required Lenis CSS to prevent native scroll clashes */
html.lenis, html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important; 
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}

/* Make the text inside the cards pop out in 3D */
.project-card, .experience-card {
  transform-style: preserve-3d;
  will-change: transform;
}
.project-card > *, .experience-card > * {
  transform: translateZ(30px);
}

/* --- NEW: Custom Cursor --- */
body, a, button, .magnetic-btn, .project-card, .experience-card {
  cursor: none !important; /* Hides default cursor */
}

.cursor-dot, .cursor-outline {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 99999;
  pointer-events: none; /* Lets you click through it */
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background-color: var(--primary);
}

.cursor-outline {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(56, 189, 248, 0.5);
  transition: width 0.2s ease, height 0.2s ease, background-color 0.2s ease;
}

/* --- NEW: Dynamic Floating Navbar --- */
.navbar {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar.scrolled {
  top: 20px;
  width: 90%;
  margin: 0 auto;
  border-radius: 50px;
  background: rgba(11, 15, 26, 0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  border: 1px solid var(--primary);
}

/* --- NEW: Interactive Particle Background --- */
#particles-js {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1; /* Keeps it behind your text */
}

/* Ensure the hero container stays clickable above the particles */
.hero .container {
  position: relative;
  z-index: 2; 
  pointer-events: auto;
}

/* NEW: Disable Custom Cursor on Mobile & Tablets */
@media (hover: none) and (pointer: coarse) {
  /* Bring back default touch behavior */
  body, a, button, .magnetic-btn, .project-card, .experience-card {
    cursor: auto !important; 
  }
  
  /* Completely hide the neon dot and ring */
  .cursor-dot, .cursor-outline {
    display: none !important; 
  }
}

/* ==========================================================================
   NEW: BrocknCode AI Chatbot
   ========================================================================== */
#chatbot-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 1.5rem;
  z-index: 1000;
  box-shadow: 0 5px 20px rgba(56, 189, 248, 0.3);
  transition: 0.3s;
}

#chatbot-toggle:hover {
  background: var(--primary);
  color: var(--bg-dark);
}

#chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 350px;
  height: 450px;
  background: rgba(2, 6, 23, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border);
  border-radius: 20px;
  z-index: 1000;
  display: none; /* Hidden by default */
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
}

.chat-header {
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header h5 {
  margin: 0;
  font-weight: 700;
  font-size: 1.1rem;
}

#close-chat {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  opacity: 0.7;
  transition: 0.3s;
}

#close-chat:hover {
  color: var(--primary);
  opacity: 1;
}

.chat-messages {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  overscroll-behavior: contain;
}

.message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 15px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.ai-message {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.user-message {
  background: var(--primary);
  color: var(--bg-dark);
  font-weight: 600;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}

.chat-input-area {
  padding: 15px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}

#chat-input {
  flex-grow: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 10px 15px;
  border-radius: 50px;
  outline: none;
}

#chat-input:focus {
  border-color: var(--primary);
}

#send-btn {
  background: var(--primary);
  border: none;
  color: var(--bg-dark);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  transition: 0.3s;
}

#send-btn:hover {
  transform: scale(1.1);
}