/* CSS Variables */
:root {
  --font-primary: 'Inter', sans-serif;
  --bg-color: #FFFFFF;
  --text-color: #000000;
  --accent-color: #0077B5;
  --secondary-accent: #f59e0b;
  --header-height: 70px;
  --transition-speed: 0.3s;
  --gradient-start: #0077B5;
  --gradient-end: #0077B5;
  --gradient-start-rgb: 99, 102, 241;
}
body.dark-mode {
  --bg-color: #1a1a1a;
  --text-color: #f8fafc;
  --accent-color: #0077B5;
  --gradient-start: #0077B5;
  --gradient-end: #0077B5;
  --gradient-start-rgb: 129, 140, 248;
}

/* Global Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  cursor: none; /* Hide default cursor */
}
body {
  font-family: var(--font-primary);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

a {
  text-decoration: none;
  color: inherit;
}

/* Custom Cursor */
.custom-cursor {
    position: fixed;
    width: 25px;
    height: 25px;
    background-color: var(--accent-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease-out;
    transform: translate(-50%, -50%);
    mix-blend-mode: difference; /* Optional: for a cool color effect */
    display: block; /* Ensure it is visible */
}

.custom-cursor-inner {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: var(--text-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: transform 0.05s linear;
    display: block; /* Ensure it is visible */
}

/* Preloader */
#preloader {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
#preloader .loader {
  border: 8px solid var(--accent-color);
  border-top: 8px solid #0077B5;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Header & Navigation */
header {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--header-height);
  background: var(--bg-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
  z-index: 1500;
  transition: background-color var(--transition-speed);
}
.header-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}
.logo {
  font-size: 1.8em;
  font-weight: bold;
  background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

nav {
  flex-grow: 1;
  max-width: 800px;
  margin: 0 auto;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease-in-out;
  gap: 2rem;
  padding: 0;
  margin: 0;
}
nav ul li {
  margin-left: 20px;
}
nav ul li a {
  font-weight: 600;
  transition: color var(--transition-speed);
  position: relative;
}
nav ul li a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-start);
  transition: width 0.3s ease;
}
nav ul li a:hover::after {
  width: 100%;
}

/* Dark Mode Toggle Button */
#darkModeToggle {
  background: none;
  border: none;
  cursor: none; /* Hide default cursor */
  font-size: 1.4em;
  color: var(--text-color);
  transition: color var(--transition-speed);
}

/* Hamburger for Mobile */
#mobileToggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8em;
  color: var(--text-color);
  cursor: none; /* Hide default cursor */
  transition: transform 0.3s ease;
}
#mobileToggle.active i::before {
  content: "\eb97";
}

/* Main content */
main {
  padding-top: calc(var(--header-height) + 20px);
}
section {
  padding: 80px 20px;
  max-width: 1100px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(20px);
}
section.visible {
  animation: fadeInUp 0.8s forwards;
}
@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* About Section */
#about {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align:center;
}
.about-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 900px;
  margin: 20px auto;
}
.about-text {
  text-align: left;
  flex: 1;
  position: relative;
}
.about-text h1 {
  font-size: 3em;
  margin-bottom: 10px;
  background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

#about img {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  margin-left: 60px;
  position: relative;
  top: -30px;
  display: block;
  margin-bottom: 100px;
  border: 3px solid var(--gradient-start);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
 
#about p {
  font-size: 1.2em;
  margin-bottom: 70px;
  max-width: 600px;
  line-height: 1.8;
}

#resumeDownload {
  display: inline-block;
  background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end));
  color: #fff;
  padding: 12px 24px;
  border-radius: 15px;
  transition: transform var(--transition-speed);
  border: 2px solid var(--accent-color);
}
#resumeDownload:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Skills Section - Updated for scrolling effect */
#skills h2 {
  margin-bottom: 40px;
  font-size: 2.5em;
  text-align: center;
}

.scrolling-skills-container {
  overflow: hidden; /* Hide overflowing content */
  -webkit-mask-image: linear-gradient(90deg, transparent, #fff 10%, #fff 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #fff 10%, #fff 90%, transparent);
}

.skill-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  width: max-content; /* Ensure the row is wide enough for all items */
  margin: 20px 0;
  padding: 10px 0;
}

.skill-row.row-1 {
  animation: scroll-right 30s linear infinite;
}

.skill-row.row-2 {
  animation: scroll-left 30s linear infinite;
}

.skill {
  background-color: transparent;
  color: var(--accent-color);
  padding: 12px 20px;
  border: 2px solid var(--accent-color);
  border-radius: 15px;
  font-size: 1em;
  min-width: 120px;
  text-align: center;
  transition: all var(--transition-speed);
  position: relative;
  overflow: hidden;
  flex-shrink: 0; /* Prevents items from shrinking */
}
.skill::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--gradient-start);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.skill:hover::after {
  transform: scaleX(1);
}
.skill:hover {
  transform: scale(1.05);
  background-color: var(--accent-color);
  color: var(--bg-color);
}
.skill img {
    height: 30px;
    margin-bottom: 5px;
    object-fit: contain;
}

/* Animation Keyframes */
@keyframes scroll-left {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

@keyframes scroll-right {
  from {
    transform: translateX(-50%);
  }
  to {
    transform: translateX(0);
  }
}

/* Projects Section */
#projects h2 {
  margin-bottom: 40px;
  font-size: 2.5em;
  text-align: center;
}

.projects-container {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 30px;
  padding: 0 20px 20px;
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

.projects-container::-webkit-scrollbar {
    display: none;
}

.project-card {
  position: relative;
  background: var(--bg-color);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  border: 5px solid rgba(0,0,0,0.1);
  flex: 0 0 450px;
  scroll-snap-align: start;
  height: 400px;
}

.project-card .actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 20px;
}

.project-card .actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 2px solid var(--gradient-start);
  border-radius: 15px;
  font-size: 0.9em;
  white-space: normal;
  word-break: break-word;
  line-height: 1.2;
  min-width: auto;
  width: 100%;
  height: 40px;
  text-align: center;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
}

.project-card .actions a i {
  margin-right: 6px;
  font-size: 1.1em;
}
.project-card .actions a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.3s ease;
}
.project-card .actions a:hover {
  background: var(--gradient-start);
  color: var(--bg-color);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(var(--gradient-start-rgb), 0.2);
}
.project-card .actions a:hover::after {
  width: 100%;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, var(--gradient-start), var(--gradient-end));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none; 
}
.project-card:hover::before {
  opacity: 0.1;
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  color: #0077B5;
}
.project-card .badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--gradient-start);
  color: #fff;
  padding: 6px 12px;
  font-size: .9em;
  border-radius: 8px;
  z-index: 2;
}
.project-card .thumb {
  height: 180px;
  background-size: cover;
  background-position: center;
}
.project-card .info h3 {
  color: var(--gradient-start);
}
.project-link {
  cursor: none; /* Hide default cursor */
  text-decoration: none;
  color: inherit;
}

.project-link:hover {
  text-decoration: underline;
}

/* Project in single line */
/* Modified Projects Section */
.projects-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent-color);
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: none; /* Hide default cursor */
  z-index: 10;
  opacity: 0.9;
  transition: all 0.3s ease;
}

.nav-arrow:hover {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}

.nav-arrow.prev {
  left: -20px;
  display: inline;
}

.nav-arrow.next {
  right: -20px;
  display: inline;
}

/* Center project card text */
.project-card .info {
  text-align: center;
}

.project-card .info p {
  text-align: center;
  margin: 15px 0;
}


/* contribution Section */
#contribution h2 {
  margin-bottom: 40px;
  font-size: 2.5em;
  text-align: center;
}

/* Education Section */
#education h2 {
  text-align: center;
  margin-bottom: 40px;
  font-size: 2.5em;
}
.edu-item {
  position: relative;
  border-left: 4px solid var(--gradient-start);
  padding: 20px 30px;
  margin-bottom: 30px;
  border-radius: 15px;
  transition: all 0.3s ease;
  padding-left: 40px;
}
.edu-item::before {
  content: "🎓";
  position: absolute;
  left: -25px;
  top: 0;
  font-size: 1.2em;
  color: #0077B5;
}
.edu-item::after {
  content: " ";
  position: absolute;
  left: -18px;
  top: 30px;
  bottom: -20px;
  width: 2px;
  background: #0077B5;
}
.edu-item:hover {
  background-color: #0077B5;
  color: #ffffff;
  transform: translateY(-5px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Contact Section */
#contact {
  text-align: center;
}
#contact h2 {
  margin-bottom: 40px;
  font-size: 2.5em;
}
.contact-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  max-width: 500px;
  margin: 0 auto;
}
.contact-item {
  background: var(--bg-color);
  border: 2px solid var(--accent-color);
  border-radius: 15px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: var(--text-color);
  cursor: none; /* Hide default cursor */
}
.contact-item i {
  font-size: 1.5em;
  transition: transform 0.3s ease;
}
.contact-item:hover {
  background: var(--accent-color);
  color: var(--bg-color);
  transform: translateY(-5px) scale(1.05);
}
.contact-item:hover i {
  transform: rotate(15deg);
}

/* Footer */
footer {
  background: var(--bg-color);
  padding: 30px 20px;
  text-align: center;
  border-top: 1px solid var(--accent-color);
  margin-top: 40px;
}
.social-links a {
  margin: 0 10px;
  color: var(--accent-color);
  font-size: 1.8em;
  transition: transform var(--transition-speed);
  cursor: none; /* Hide default cursor */
}
.social-links a:hover {
  transform: scale(1.2);
}

/* Back To Top Button */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--gradient-start);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 50%;
  font-size: 1.2em;
  cursor: none; /* Hide default cursor */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s;
  z-index: 1500;
}
#backToTop.show {
  opacity: 1;
  visibility: visible;
}

/* Typing Effect */
#typing-text::after {
  content: "|";
  animation: blink 1s infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* Responsive Styles */
@media (max-width: 768px) {
  .about-content {
    flex-direction: column-reverse;
    align-items: center;
  }
  
  #about h1 {
    text-align: center;
  }
  
  #about img {
    margin-left: 0;
    margin-bottom: 20px;
    top: 0;
  }
  
  .about-text {
    text-align: center;
  }
  .logo {
    flex: 1;
    text-align: center;
  }
 
  nav ul {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-color);
    flex-direction: column;
    display: none;
    width: 100%;
    text-align: center;
    padding: 20px 0;
    transform: translateY(-20px);
    opacity: 0;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 1000;
    gap: 0.01rem;
  }
  
  nav ul.show {
    display: flex;
    transform: translateY(0);
    opacity: 1;
  }
  
  nav ul li {
    margin: 15px 0;
    padding: 0 20px;
  }
  
  #mobileToggle {
    display: block;
    order: 2;
  }
  
  #darkModeToggle {
    order: 1;
  }
  
  .header-controls {
    position: relative;
    z-index: 2000;
    flex: 0;
  }
  .project-card .actions a:active {
    background: var(--accent-color);
    color: var(--bg-color);
  }
  .custom-cursor, .custom-cursor-inner {
    display: none; /* Hide custom cursor on mobile */
  }
  /* Skills Section Responsive Fixes */
  .scrolling-skills-container {
    -webkit-mask-image: none;
    mask-image: none;
  }
}

.nav-arrow {
  display:none;
}
.projects-container {
  padding: 0 10px 20px;
}

/* Styles for the Chatbot */
#chatbot-icon {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: var(--gradient-start);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  z-index: 2000;
  transition: transform 0.3s ease;
  cursor: none;
}

#chatbot-icon:hover {
  transform: scale(1.1);
}

#chatbot-icon.open i {
  transform: rotate(180deg);
}

#chatbot-window {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 350px;
  max-width: 90vw;
  height: 500px;
  background: var(--bg-color);
  border-radius: 15px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  border: 2px solid var(--accent-color);
}

#chatbot-window.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.chatbot-header {
  padding: 15px;
  background: var(--accent-color);
  color: #fff;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  text-align: center;
  font-weight: bold;
  font-size: 1.1em;
  position: relative;
}

#close-chatbot {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5em;
  cursor: none;
}

.chat-messages {
  flex-grow: 1;
  padding: 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.chat-messages::-webkit-scrollbar {
  display: none;
}

.message {
  padding: 10px 15px;
  border-radius: 15px;
  max-width: 80%;
  word-wrap: break-word;
  line-height: 1.4;
  font-size: 0.9em;
}

.message.user {
  align-self: flex-end;
  background: var(--accent-color);
  color: #fff;
  border-bottom-right-radius: 5px;
}

.message.bot {
  align-self: flex-start;
  background: #f1f1f1;
  color: #333;
  border: 1px solid #ddd;
  border-bottom-left-radius: 5px;
}


body.dark-mode .message.bot {
  background: #333;
  color: #f8fafc;
  border: 1px solid #444;
}

.message a.button-link {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 20px;
  background-color: var(--accent-color);
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  margin-top: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

.message a.button-link:hover {
  background-color: #005f95; /* A slightly darker blue for hover effect */
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.message a.button-link i {
  margin-right: 5px;
}

body.dark-mode .message a.button-link {
  background-color: var(--accent-color);
}

body.dark-mode .message a.button-link:hover {
  background-color: #005f95;
}


.typing-indicator {
  display: none;
  align-self: flex-start;
  padding: 10px 15px;
  background: #f1f1f1;
  border-radius: 15px;
  font-style: italic;
  color: #888;
  font-size: 0.9em;
}

body.dark-mode .typing-indicator {
  background: #333;
  color: #999;
}

.chat-input {
  display: flex;
  padding: 10px;
  border-top: 1px solid #ddd;
  background: var(--bg-color);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.chat-input input {
  flex-grow: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-family: var(--font-primary);
  background: var(--bg-color);
  color: var(--text-color);
  padding-right: 40px; /* Make space for the button */
  cursor: none;
}

.chat-input button {
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2em;
  margin-left: -40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  cursor: none;
}

.chat-input button:hover {
  transform: scale(1.1);
}

.chat-input button:disabled {
  background: #ccc;
  cursor: not-allowed;
}
