:root {
  --bg-color: #121212;
  --toggle-bg: #444;
  --toggle-circle: #f5f5f5;
  --heading-bg: rgba(255, 255, 255, 0.05);
  --section-title: #f4f4f4;
  --text-color: #c3c3c3;
  --h3-title: #e0e0e0;
  --h5-background: #1e1e1e;
  --icon-box-background: #1e1e1e;
  --card-border: #333333; /* Dark border */
  --a-text: #e8e7e7;
  --box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.6);
  --form-color: rgb(64, 64, 64);
  --form-button: #c18d26;
  --form-button-hover: #977938;
  --meta-text: #888;
}

[data-theme="light"] {
  --bg-color: #ffffff;
  --toggle-bg: #ccc;
  --toggle-circle: #ffffff;
  --heading-bg: #eef0f2;
  --section-title: #3b434a;
  --text-color: #444444;
  --h3-title: #3b434a;
  --h5-background: #eef0f2;
  --icon-box-background: #ffffff;
  --card-border: #e0e0e0; /* Added for definition */
  --a-text: #111;
  --box-shadow: 0px 5px 15px rgba(214, 215, 216, 0.4);
  --form-color: rgb(255, 255, 255);
  --form-button: #ffb727;
  --form-button-hover: #ffc85a;
  --meta-text: #666;
}

html, body {
  overflow-x: hidden;
}

/* Optional: Add a very faint dark glass effect to sections so your text stays easy to read over the moving dots */
#about{
  background-color: transparent;
}

/* --- REPO SECTION STYLES --- */
section.services {
    background-color: var(--bg-color);
    padding: 60px 0;
    transition: background 0.3s ease;
}

.section-title h2 {
    color: var(--section-title);
    font-weight: 700;
}

.section-title p {
    color: var(--text-color);
}

/* Card Design */
.repo-card {
    background: var(--icon-box-background);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 25px;
    height: 100%;
    transition: all 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--box-shadow);
}

.repo-card:hover {
    transform: translateY(-5px);
    border-color: var(--form-button);
}

.repo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.repo-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--h3-title);
    margin: 0;
    word-break: break-word;
}

.repo-description {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
    /* Limit description to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Bottom Metadata Row */
.repo-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--meta-text);
    border-top: 1px solid var(--card-border);
    padding-top: 15px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.language-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--form-button); /* Default color */
}

.repo-link-btn {
    margin-left: auto;
    color: var(--form-button);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.repo-link-btn:hover {
    color: var(--form-button-hover);
}

/* Pagination Styling */
.pagination {
    justify-content: center;
    margin-top: 30px;
}

.page-item .page-link {
    background-color: var(--icon-box-background);
    border-color: var(--card-border);
    color: var(--text-color);
}

.page-item.disabled .page-link {
    background-color: var(--h5-background);
    opacity: 0.6;
}

.page-item .page-link:hover {
    background-color: var(--form-button);
    color: #fff;
    border-color: var(--form-button);
}

/* Certificate */
/* Container for the window */
/* --- 1. CARD GRID DESIGN --- */
.cert-card {
  background: var(--icon-box-background, #fff);
  border: 1px solid var(--card-border, #e0e0e0);
  border-radius: 12px;
  overflow: hidden;
  height: 100%; /* Makes all cards same height */
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  position: relative; /* Keep context */
}

.cert-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  border-color: var(--form-button, #ffb727);
  cursor: pointer;
}

/* Image Wrapper - Forces images to look uniform */
.cert-img-wrapper {
  position: relative;
  width: 100%;
  padding-top: 66.66%; /* 3:2 Aspect Ratio container */
  background-color: #f8f9fa;
  overflow: hidden;
}

.cert-img-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* Shows whole certificate without cropping */
  padding: 10px;       /* White space around cert */
  transition: transform 0.5s ease;
}

.cert-card:hover .cert-img-wrapper img {
  transform: scale(1.05);
}

.cert-body {
  padding: 20px;
  flex-grow: 1; /* Pushes content to fill height */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cert-body h5 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--h3-title, #333);
}

.cert-issuer {
  font-size: 0.9rem;
  color: var(--text-color, #666);
  margin-bottom: 15px;
}

.cert-date {
  font-size: 0.75rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- 2. MODAL (POPUP) FIX --- */
.modal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 100000; /* SUPER HIGH Z-INDEX TO PREVENT FREEZE */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.modal.active {
  display: flex; /* Flex centers everything */
}

/* The Image inside Modal */
.modal-content {
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 50px rgba(0,0,0,0.5);
  animation: zoomIn 0.3s ease;
}

/* The Close Button */
.close-modal {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 50px;
  font-weight: 300;
  cursor: pointer;
  z-index: 100001;
  transition: color 0.2s;
  line-height: 1;
}

.close-modal:hover {
  color: var(--form-button, #ffb727);
}

/* Caption Text */
#modalCaption {
  margin-top: 15px;
  color: #fff;
  font-size: 1.2rem;
  text-align: center;
}

@keyframes zoomIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* --- PAGINATION STYLES --- */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.page-btn {
    background-color: var(--icon-box-background, #fff);
    border: 1px solid var(--card-border, #e0e0e0);
    color: var(--text-color, #444);
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
    user-select: none;
}

.page-btn:hover {
    border-color: var(--form-button, #ffb727);
    color: var(--form-button, #ffb727);
    transform: translateY(-2px);
}

.page-btn.active {
    background-color: var(--form-button, #ffb727);
    color: #fff; /* Text inside active button should be white */
    border-color: var(--form-button, #ffb727);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background-color: rgba(0,0,0,0.05);
}
/*end of certificate*/




.theme-switch {
  display: inline-block;
  height: 30px;
  position: relative;
  width: 60px;
  margin: 0; /* Clears any accidental margins causing misalignment */
}

.theme-switch input {
  display: none;
}

.slider {
  background-color: #e2e8f0; 
  border: 1px solid #cbd5e1;
  bottom: 0;
  cursor: pointer;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: .4s;
  border-radius: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  
  /* CHANGED: Increased padding from 6px to 8px to perfectly center the icons */
  padding: 0 8px; 
}

/* Icons inside the slider */
.slider .bi {
  font-size: 14px;
  z-index: 3; 
  position: relative; 
  transition: 0.4s;
  
  /* CHANGED: This removes the invisible text-spacing that pushes the icon down */
  line-height: 0; 
  display: flex;
  align-items: center;
}

.sun { 
  opacity: 1; 
  transform: rotate(0); 
  color: #ffffff; /* CHANGED: Crisp white sun on top of the yellow circle */ 
} 
.moon { 
  opacity: 0; 
  transform: rotate(90deg); 
  color: #ffffff; 
}

/* The Moving Circle */
.slider:before {
  background-color: #fbbf24; /* Sun Yellow */
  box-shadow: 0 0 10px #fbbf24;
  bottom: 3px;
  content: "";
  height: 22px;
  left: 4px;
  position: absolute;
  transition: .4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  width: 22px;
  border-radius: 50%;
  z-index: 2;
}

/* --- CHECKED STATE (Light Mode) --- */
input:checked + .slider {
  background-color: rgba(255, 255, 255, 0.1); /* Dark mode dark-glass */
  border-color: rgba(255, 255, 255, 0.2);
}

/* Move circle to the right and turn it purple/cyan */
input:checked + .slider:before {
  transform: translateX(30px);
  background-color: var(--primary); 
  box-shadow: 0 0 10px var(--primary);
}

/* Dark Mode Icon Visibility */
input:checked + .slider .sun { opacity: 0; transform: rotate(-90deg); }
input:checked + .slider .moon { opacity: 1; transform: rotate(0); color: #fff; }

.mobile-nav-toggle {
  color: var(--text-color); /* Match theme text color instead of white */
  font-size: 32px; /* Slightly larger for easier tapping */
  cursor: pointer;
  display: none;
  line-height: 0;
  transition: 0.5s;
  margin: 0; /* Reset margins to ensure perfect alignment with pill */
}

/*--------------------------------------------------------------
# General
--------------------------------------------------------------*/
body {
  font-family: "Open Sans", sans-serif;
  color: var(--text-color);
  transition: background 0.3s, color 0.3s;
}
canvas#neural-bg {
  position: fixed;
  top: 0;
  opacity: 0.6;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0; 
  pointer-events: none; /* Let clicks pass through to your buttons */
}

/* 2. Bring your website's content FORWARD to sit on top of the canvas */


/* Optional: Slight fade in Light Mode if it's too distracting */
body.light-mode canvas#neural-bg {
  opacity: 0.8;
}
a {
  color: #ffb727;
  text-decoration: none;
}

a:hover {
  color: #ffc85a;
  text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Raleway", sans-serif;
}

/*--------------------------------------------------------------
# Back to top button
--------------------------------------------------------------*/
.back-to-top {
  position: fixed;
  visibility: hidden;
  opacity: 0;
  right: 25px;
  bottom: 85px; /* ALWAYS 85px from the bottom so it never overlaps the chat */
  z-index: 996;
  background: var(--form-button);
  width: 42px;
  height: 42px;
  border-radius: 50%; /* Changed to a circle for a modern look */
  transition: all 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.back-to-top i {
  font-size: 24px;
  color: #fff !important;
  line-height: 0;
}

.back-to-top.active {
  visibility: visible;
  opacity: 1;
}
.back-to-top:hover {
  background: var(--form-button-hover);
  color: var(--a-text);
}

/*--------------------------------------------------------------
# Header
--------------------------------------------------------------*/
#header {
  z-index: 997;
  transition: all 0.5s;
  height: 80px;
  background: rgba(25, 28, 31, 0.8);
}
#header.header-transparent {
  background: transparent;
}
#header.header-scrolled {
  height: 60px;
  background: rgba(25, 28, 31, 0.8);
}

/*--------------------------------------------------------------
# Navigation Menu
--------------------------------------------------------------*/
/**
* Desktop Navigation 
*/
.navbar {
  padding: 0;
}
.navbar ul {
  margin: 0;
  padding: 0;
  display: flex;
  list-style: none;
  align-items: center;
}
.navbar li {
  position: relative;
}
.navbar a, .navbar a:focus {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  color: #fff;
  white-space: nowrap;
  transition: 0.3s;
  font-size: 12px;
  font-family: "Raleway", sans-serif;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 1px;
}
.navbar a i, .navbar a:focus i {
  font-size: 12px;
  line-height: 0;
  margin-left: 5px;
}
.navbar a:hover, .navbar .active, .navbar .active:focus, .navbar li:hover > a {
  color: #ffb727;
}
.navbar .dropdown ul {
  display: block;
  position: absolute;
  left: 14px;
  top: calc(100% + 30px);
  margin: 0;
  padding: 10px 0;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  background: #fff;
  box-shadow: 0px 0px 30px rgba(127, 137, 161, 0.25);
  transition: 0.3s;
  border-radius: 4px;
}
.navbar .dropdown ul li {
  min-width: 200px;
}
.navbar .dropdown ul a {
  padding: 10px 20px;
  font-size: 14px;
  text-transform: none;
  font-weight: 400;
  color: #3b434a;
  letter-spacing: 1px;
}
.navbar .dropdown ul a i {
  font-size: 12px;
}
.navbar .dropdown ul a:hover, .navbar .dropdown ul .active:hover, .navbar .dropdown ul li:hover > a {
  color: #ffb727;
}
.navbar .dropdown:hover > ul {
  opacity: 1;
  top: 100%;
  visibility: visible;
}
.navbar .dropdown .dropdown ul {
  top: 0;
  left: calc(100% - 30px);
  visibility: hidden;
}
.navbar .dropdown .dropdown:hover > ul {
  opacity: 1;
  top: 0;
  left: 100%;
  visibility: visible;
}
@media (max-width: 1366px) {
  .navbar .dropdown .dropdown ul {
    left: -90%;
  }
  .navbar .dropdown .dropdown:hover > ul {
    left: -100%;
  }
}

/**
* Mobile Navigation 
*/
.mobile-nav-toggle {
  color: white;
  mix-blend-mode: difference;
  font-size: 28px;
  cursor: pointer;
  display: none;
  line-height: 0;
  transition: 0.5s;
}

/* =======================================================
   FIXED MOBILE MENU & OVERLAY
   ======================================================= */
@media (max-width: 1040px) {
  
  /* Your working layout fix */
  #header {
    justify-content: flex-start !important;
    padding-left: 20px;
  }

  .mobile-nav-toggle {
    display: block;
    z-index: 9999; /* Keeps the Hamburger/X button on top of the glass overlay */
    position: relative;
  }
  
  /* Hide standard desktop menu */
  .navbar ul {
    display: none;
  }

  /* --- THE OPEN MOBILE MENU (GLASSMORPHISM) --- */
  .navbar.navbar-mobile {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background: rgba(15, 15, 20, 0.95); /* Deep dark glass */
    backdrop-filter: blur(15px);
    z-index: 9998; /* Sits just underneath the close button */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
  }

  /* Layout for the links inside the mobile menu */
  /* --- FIX: Force the list background to be transparent --- */
  .navbar.navbar-mobile ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 0;
    margin: 0;
    list-style: none;
    background: transparent !important; /* Overrides the template's white box */
    width: 100%;
  }

  /* --- FIX: Force the links to be white --- */
  .navbar.navbar-mobile a,
  .navbar.navbar-mobile ul li a {
    font-size: 1.5rem !important;
    color: #ffffff !important; /* Overrides the template's dark gray text */
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    text-decoration: none !important;
  }

  /* Highlight active/hovered links */
  .navbar.navbar-mobile a:hover,
  .navbar.navbar-mobile ul li a:hover,
  .navbar.navbar-mobile .active,
  .navbar.navbar-mobile li:hover > a {
    color: var(--cyan) !important;
  }
}
.navbar-mobile {
  position: fixed;
  overflow: hidden;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  background: rgba(36, 41, 46, 0.9);
  transition: 0.3s;
  z-index: 999;
}
.navbar-mobile .mobile-nav-toggle {
  position: absolute;
  top: 65px;
  right: 30px;
}
.navbar-mobile ul {
  display: block;
  position: absolute;
  top: 55px;
  right: 15px;
  bottom: 15px;
  left: 15px;
  padding: 10px 0;
  border-radius: 10px;
  background-color: var(--icon-box-background);
  overflow-y: auto;
  transition: 0.3s;
}
.navbar-mobile a, .navbar-mobile a:focus {
  padding: 10px 20px;
  font-size: 14px;
  color: var(--h3-title);
}
.navbar-mobile a:hover, .navbar-mobile .active, .navbar-mobile li:hover > a {
  color: #ffb727;
}
.navbar-mobile .getstarted, .navbar-mobile .getstarted:focus {
  margin: 15px;
}
.navbar-mobile .dropdown ul {
  position: static;
  display: none;
  margin: 10px 20px;
  padding: 10px 0;
  z-index: 99;
  opacity: 1;
  visibility: visible;
  background: #fff;
  box-shadow: 0px 0px 30px rgba(127, 137, 161, 0.25);
}
.navbar-mobile .dropdown ul li {
  min-width: 200px;
}
.navbar-mobile .dropdown ul a {
  padding: 10px 20px;
}
.navbar-mobile .dropdown ul a i {
  font-size: 12px;
}
.navbar-mobile .dropdown ul a:hover, .navbar-mobile .dropdown ul .active:hover, .navbar-mobile .dropdown ul li:hover > a {
  color: #ffb727;
}
.navbar-mobile .dropdown > .dropdown-active {
  display: block;
}
h1,h2,h3,h4,h5,span,p,a,img,.product-card,.cert-card,.repo-card,.icon-box,.card-body,footer,.row,button{z-index: 2;}
/*--------------------------------------------------------------
# Hero Section
--------------------------------------------------------------*/
#hero {
    z-index: 2;
  width: 100%;
  height: 100vh;
  background: url("../img/index.webp") top right;
  background-size: cover;
  position: relative;
  background-position: center;
}
#hero:before {
  content: "";
  background: rgba(0, 0, 0, 0.65);
  position: absolute;
  bottom: 0;
  top: 0;
  left: 0;
  right: 0;
}
#hero .hero-container {
  position: absolute;
  bottom: 0;
  top: 200px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 0 15px;
  transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#hero h1 {
  margin: 0 0 10px 0;
  font-size: 64px;
  font-family: "Satisfy", serif;
  color: #fff;
  mix-blend-mode: difference;
}
#hero h2 {
  color: #eee;
  margin-bottom: 50px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}
#hero .btn-scroll {
  transition: 0.4s;
  color: rgba(255, 255, 255, 0.6);
  animation: up-down 1s ease-in-out infinite alternate-reverse both;
}
#hero .btn-scroll i {
  font-size: 48px;
}
#hero .btn-scroll:hover {
  color: #ffb727;
}

#hero .btn {
  background-color: DodgerBlue;
  border: none;
  color: white;
  padding: 12px 30px;
  cursor: pointer;
  font-size: 20px;
}

/* Darker background on mouse-over */
#hero .btn:hover {
  background-color: RoyalBlue;
}

@media (min-width: 1024px) {
  #hero {
    background-attachment: fixed;
  }
}
@media (max-width: 575px) {
  #hero h1 {
    font-size: 40px;
  }
  #hero h2 {
    text-align: center;
    margin-bottom: 30px;
  }
}

@-webkit-keyframes up-down {
  0% {
    transform: translateY(5px);
  }
  100% {
    transform: translateY(-5px);
  }
}

@keyframes up-down {
  0% {
    transform: translateY(5px);
  }
  100% {
    transform: translateY(-5px);
  }
}

/*--------------------------------------------------------------
# Sections General
--------------------------------------------------------------*/
section {
  padding: 60px 0;
}

.section-bg {
  background-color: white;
}

.section-title {
  text-align: center;
  padding: 30px 0;
  position: relative;
}
.section-title h2 {
  font-size: 32px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 20px;
  padding-bottom: 0;
  color: var(--section-title);
  position: relative;
  z-index: 2;
}
.section-title span {
  position: absolute;
  top: 30px;
  color: var(--heading-bg);
  left: 0;
  right: 0;
  z-index: 1;
  font-weight: 700;
  font-size: 52px;
  text-transform: uppercase;
  line-height: 0;
}
.section-title p {
  margin-bottom: 0;
  position: relative;
  z-index: 2;
}
@media (max-width: 575px) {
  .section-title h2 {
    font-size: 28px;
    margin-bottom: 15px;
  }
  .section-title span {
    font-size: 38px;
  }
}

/*--------------------------------------------------------------
# About Me
--------------------------------------------------------------*/
.about{
  background-color: var(--bg-color);
  transition: .5s background-color;
}
.about .content h3 {
  font-weight: 700;z-index: 2;
  font-size: 26px;
  color: var(--h3-title);
  text-transform: uppercase;
}
.about .content ul {
  list-style: none;
  padding: 0;
}
.about .content ul li {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}
.about .content ul strong {
  margin-right: 10px;
}
.about .content ul i {
  font-size: 16px;
  margin-right: 5px;
  color: #ffb727;
  line-height: 0;
}
.about .content p:last-child {
  margin-bottom: 0;
}
.about .content .count-box {
  width: 100%;
}
.about .content .count-box i {
  display: block;
  font-size: 36px;
  color: #ffb727;z-index: 2;
  float: left;
  line-height: 0;
}
.about .content .count-box span {
  font-size: 36px;
  line-height: 30px;
  display: block;
  font-weight: 700;
  color: #3b434a;z-index: 2;
  margin-left: 50px;
}
.about .content .count-box p {
  padding: 15px 0 0 0;
  margin: 0 0 0 50px;z-index: 2;
  font-family: "Raleway", sans-serif;
  font-size: 14px;
  color: #5d6a75;
}
.about .content .count-box a {
  font-weight: 600;z-index: 2;
  display: block;
  margin-top: 20px;
  color: #5d6a75;
  font-size: 15px;
  font-family: "Satisfy", serif;
  transition: ease-in-out 0.3s;
}
.about .content .count-box a:hover {
  color: #82909c;
}
/* Base Image Style */
.about .image {
  background: url("../img/lucky.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  min-height: 500px;
  z-index: 2;
  /* Modern "Clean Card" Styling */
  border-radius: 16px; /* Smooth, modern corners */
  position: relative;
  
  /* Physics-based Transition (Smooth like iOS) */
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1); 
  
  /* Initial Depth */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  
  /* Subtle filter for a premium "editorial" look */
  filter: contrast(1.05) saturate(0.9);
}

/* Hover Effect: The "Lift" */
.about .image:hover {
  /* Scales up slightly and moves up */
  transform: scale(1.02) translateY(-10px);
  
  /* Shadow grows to create the illusion of floating higher */
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  
  /* Image becomes vibrant */
  filter: contrast(1.1) saturate(1.1);
}

/* Mobile Adjustment */
@media (max-width: 768px) {
  .about .image {
    min-height: 400px; /* Slightly smaller on phones */
  }
}
hr {
  border: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #7000ff, transparent);
  margin: 70px 0;
  box-shadow: 0 0 10px rgba(112, 0, 255, 0.4); /* Glow effect */
  opacity: 0.8;
}
.about .skills-content {
  margin-top: 30px;
}
.about .skills-content .progress {
  height: 60px;
  display: block;
  background: none;
  border-radius: 0;
}
.about .skills-content .progress .skill {
  padding: 10px 0;
  margin: 0 0 6px 0;
  text-transform: uppercase;
  display: block;
  font-weight: 700;
  font-family: "Raleway", sans-serif;
  color: #3b434a;
}
.about .skills-content .progress .skill .val {
  float: right;
  font-style: normal;
}
.about .skills-content .progress-bar-wrap {
  background: #e6e8eb;
}
.about .skills-content .progress-bar {
  width: 1px;
  height: 10px;
  transition: 0.9s;
  background-color: #ffb727;
}

/* =======================================================
   ABOUT SECTION MOBILE FIXES
   ======================================================= */
@media (max-width: 991px) {
  
  /* 1. Shrink and center the massive image */
  .about .image {
    min-height: 300px !important; /* Forces it to be much shorter on phones */
    height: 300px !important;
    width: 100% !important;
    max-width: 350px !important; /* Prevents it from stretching too wide */
    margin: 0 auto 30px auto !important; /* Centers it perfectly */
    background-position: center top !important; /* Keeps your face in frame */
    border-radius: 15px; /* Adds a nice modern curve */
  }

  /* 2. Fix the list spacing and alignment */
  .about .content ul {
    padding-left: 0;
    margin-bottom: 20px;
  }

  .about .content ul li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    font-size: 0.95rem;
  }

  /* 3. Align the bold labels so they look like a clean table */
  .about .content ul li strong {
    min-width: 90px; /* Ensures all the labels line up vertically */
    margin-right: 10px;
  }

  /* 4. Force long URLs and Emails to wrap instead of breaking the layout */
  .about .content ul li span {
    word-break: break-word; /* Wraps the email/website to the next line */
    overflow-wrap: break-word;
    flex: 1; /* Allows the text to fill the remaining space neatly */
  }

  /* Centers the Technical section title on mobile */
  .about .content .section-title {
    text-align: center;
    margin-top: 20px;
  }
}

/* Extra tweak for very small phones (like iPhone SE) */
@media (max-width: 400px) {
  .about .content ul li {
    flex-direction: column; /* Stacks the label and the answer */
    margin-bottom: 15px;
  }
  .about .content ul li strong {
    margin-bottom: 5px;
    color: var(--cyan); /* Highlights the label when stacked */
  }
}

/*--------------------------------------------------------------
# My Resume
--------------------------------------------------------------*/
.resume{
  background-color: var(--bg-color);
  transition: .5s background-color;
}
.resume .resume-title {
  font-size: 26px;
  font-weight: 700;
  margin-top: 20px;
  margin-bottom: 20px;
  color: var(--h3-title);
}
.resume .resume-item {
  padding: 0 0 20px 20px;
  margin-top: -2px;
  border-left: 2px solid #82909c;
  position: relative;
}
.resume .resume-item h4 {
  line-height: 18px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  color: #ffb727;
  margin-bottom: 10px;
}
.resume .resume-item h5 {
  font-size: 16px;
  background: var(--h5-background);
  padding: 5px 15px;
  display: inline-block;
  font-weight: 600;
  margin-bottom: 10px;
}
.resume .resume-item ul {
  padding-left: 20px;
}
.resume .resume-item ul li {
  padding-bottom: 10px;
}
.resume .resume-item:last-child {
  padding-bottom: 0;
}
.resume .resume-item::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50px;
  left: -9px;
  top: 0;
  background: #fff;
  border: 2px solid #82909c;
}

.internship-main{
  background-color: var(--bg-color);
  transition: .5s background-color;
}
.internship-main .internship-title {
  font-size: 26px;
  font-weight: 700;
  margin-top: 20px;
  margin-bottom: 20px;
  color: var(--h3-title);
}
#internship-logo {
  max-width: 150px;
  display: block;
  margin: 0 auto;
}

.internship-card{
  margin-bottom: 10px;
}

#main,#latest-blogs{
  background-color: var(--bg-color);
  transition: .5s background-color;
}

/*--------------------------------------------------------------
#shop
----------------------------------------------------------------*/
/* Grid Setup */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px; /* Increased gap for better spacing */
    margin-bottom: 40px;
}

/* Card Styling */
.product-card {
    border: 1px solid #eee;
    background: #fff;
    border-radius: 8px;
    overflow: hidden; /* Keeps content inside rounded corners */
    display: flex;
    flex-direction: column; /* Ensures footer aligns at bottom if needed */
    transition: box-shadow 0.3s ease;
}

.product-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Image Wrapper & Styling - MAKES IMAGES UNIFORM */
.product-image-wrapper {
    display: block;
    width: 100%;
    height: 350px; /* Taller height makes them look bigger */
    overflow: hidden;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* KEY: Crops image to fit the box without stretching */
    object-position: center;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image-wrapper img {
    transform: scale(1.05); /* Zoom effect on hover */
}

/* Details Section */
.product-details {
    padding: 20px;
    text-align: center;
}

.product-title {
    display: block;
    font-size: 18px; /* Larger Title */
    font-weight: 700;
    color: #333;
    text-decoration: none;
    margin-bottom: 10px;
    line-height: 1.3;
}

/* Short Description Styling */
.product-short-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
    
    /* Optional: Limit to 2 lines to keep grid even */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-short-desc p {
    margin: 0; /* Remove default paragraph margins from WP content */
    display: inline;
}

.product-price {
    display: inline-block;
    font-size: 18px;
    font-weight: 600;
    color: #28a745;
    background-color: #f3f4f6; /* Light gray background */
    padding: 6px 12px;
    border-radius: 6px;        /* Rounded corners */
    margin-bottom: 15px;
    margin-top: 10px;
}

.btn-add-to-cart {
    display: block;
    width: 100%;
    padding: 12px 0;
    background-color: #000;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-add-to-cart:hover {
    background-color: #333;
}

/* Responsive */
@media (max-width: 992px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 576px) {
    .product-grid { grid-template-columns: 1fr; }
}


/*--------------------------------------------------------------
# My Services
--------------------------------------------------------------*/
.services{
  background-color: var(--bg-color);
  transition: .5s background-color;
}
.services .icon-box {
  margin:20px 0;
  padding: 30px;
  position: relative;
  overflow: hidden;
  background: var(--icon-box-background);
  box-shadow: 0 10px 29px 0 rgba(68, 88, 144, 0.1);
  transition: all 0.3s ease-in-out;
  text-align: center;
  border: 1px solid var(--icon-box-background);
}
.services .icon {
  margin: 0 auto 20px auto;
  padding-top: 17px;
  display: inline-block;
  text-align: center;
  border-radius: 50%;
  width: 72px;
  height: 72px;
  background: #fff4df;
}
.services .icon i {
  font-size: 36px;
  line-height: 1;
  color: #ffb727;
}
.services .title {
  font-weight: 700;
  margin-bottom: 15px;
  font-size: 18px;
}
.services .title a {
  color: var(--a-text);
  transition: 0.3s;
}
.services .description {
  font-size: 15px;
  line-height: 28px;
  margin-bottom: 0;
}
.services .icon-box:hover {
  border-color: #ffb727;
}
.services .icon-box:hover .title a {
  color: #ffb727;
}



.game-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
  }
  .game-card {
    font-size: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .game-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.3s;
  }
  .game-card img:hover {
    transform: scale(1.05);
  }
  .game-card h2 {
    font-size: 14px;
  margin: 10px 0 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
  position: relative;
  }
.game-title:hover::after {
  content: attr(data-title);
  position: absolute;
  top: 110%;
  left: 0;
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 999;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  font-size: 12px;
  pointer-events: none;
}
.game-title {
  font-size: 14px;
  margin: 10px 0 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
  position: relative;
}
  .game-card p {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  @media screen and (max-width: 1024px) {
    .game-list {
      grid-template-columns: repeat(4, 1fr);
    }
  }
  @media screen and (max-width: 768px) {
    .game-list {
      grid-template-columns: repeat(2, 1fr);
    }
    .game-card img{
        height: 100px;
    }
  }


/*--------------------------------------------------------------
# Portfolio Details
--------------------------------------------------------------*/
.portfolio-details{
  background-color: var(--bg-color);
  transition: .5s background-color;
}
.portfolio-details {
  padding-top: 40px;
}
.portfolio-details .portfolio-details-slider img {
  width: 100%;
}
.portfolio-details .portfolio-details-slider .swiper-pagination {
  margin-top: 20px;
  position: relative;
}
.portfolio-details .portfolio-details-slider .swiper-pagination .swiper-pagination-bullet {
  width: 12px;
  height: 12px;
  background-color: #fff;
  opacity: 1;
  border: 1px solid #ffb727;
}
.portfolio-details .portfolio-details-slider .swiper-pagination .swiper-pagination-bullet-active {
  background-color: #ffb727;
}
.portfolio-details .portfolio-info {
  padding: 30px;
  box-shadow: 0px 0 30px rgba(59, 67, 74, 0.08);
}
.portfolio-details .portfolio-info h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}
.portfolio-details .portfolio-info ul {
  list-style: none;
  padding: 0;
  font-size: 15px;
}
.portfolio-details .portfolio-info ul li + li {
  margin-top: 10px;
}
.portfolio-details .portfolio-description {
  padding-top: 30px;
}
.portfolio-details .portfolio-description h2 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 20px;
}
.portfolio-details .portfolio-description p {
  padding: 0;
}

.card-body{
  background-color: var(--icon-box-background);
}
.card{
  border: 1px solid var(--box-shadow);
}
.page-link{
  background-color: var(--h5-background);
}
/*--------------------------------------------------------------
# Contact Me
--------------------------------------------------------------*/
.contact{
  background-color: var(--bg-color);
  transition: .5s background-color;
}
.contact .info-box {
  color: #444444;
  text-align: center;
  box-shadow: 0 0 30px var(--box-shadow);
  padding: 20px 0 30px 0;
}
.contact .info-box i.bx {
  font-size: 24px;
  color: #ffb727;
  border-radius: 50%;
  padding: 15px;
  background: var(--heading-bg);
}
.contact .info-box h3 {
  font-size: 20px;
  color: #777777;
  font-weight: 700;
  margin: 10px 0;
}
.contact .info-box p {
  padding: 0;
  line-height: 24px;
  font-size: 14px;
  margin-bottom: 0;
}
.contact .social-links {
  margin-top: 15px;
  display: flex;
  justify-content: center;
}
.contact .social-links a {
  font-size: 18px;
  display: inline-block;
  color: #687683;
  line-height: 1;
  margin: 0 8px;
  transition: 0.3s;
  padding: 14px;
  border-radius: 50px;
  border: 1px solid #dde1e4;
}
.contact .social-links a:hover {
  color: #fff;
  border-color: #ffb727;
  background: #ffb727;
}
.contact .php-email-form {
  box-shadow: 0 0 30px var(--box-shadow);
  padding: 27px;
}
.contact .php-email-form .validate {
  display: none;
  color: red;
  margin: 0 0 15px 0;
  font-weight: 400;
  font-size: 13px;
}
.contact .php-email-form .error-message {
  display: none;
  color: #fff;
  background: #ed3c0d;
  text-align: left;
  padding: 15px;
  font-weight: 600;
}
.contact .php-email-form .error-message br + br {
  margin-top: 25px;
}
.contact .php-email-form .sent-message {
  display: none;
  color: #fff;
  background: #18d26e;
  text-align: center;
  padding: 15px;
  font-weight: 600;
}
.contact .php-email-form .loading {
  display: none;
  background: #fff;
  text-align: center;
  padding: 15px;
}
.contact .php-email-form .loading:before {
  content: "";
  display: inline-block;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  margin: 0 10px -6px 0;
  border: 3px solid #18d26e;
  border-top-color: #eee;
  -webkit-animation: animate-loading 1s linear infinite;
  animation: animate-loading 1s linear infinite;
}
.contact .php-email-form input, .contact .php-email-form textarea {
  border-radius: 0;
  box-shadow: none;
  font-size: 14px;
}
.contact .php-email-form input::focus, .contact .php-email-form textarea::focus {
  background-color: #ffb727;
}
.contact .php-email-form input {
  padding: 10px 15px;
}
.contact .php-email-form textarea {
  padding: 12px 15px;
}
.contact .php-email-form button[type=submit] {
  background: var(--form-button);
  border: 0;
  padding: 10px 24px;
  margin-top: 20px;
  color: #fff;
  transition: 0.4s;
  border-radius: 5px;
}
.contact .php-email-form button[type=submit]:hover {
  background: var(--form-button-hover);
}
.contact .form-control{
  background-color: var(--form-color);
}
@-webkit-keyframes animate-loading {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
@keyframes animate-loading {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/*--------------------------------------------------------------
# Footer
--------------------------------------------------------------*/
/* ======= Footer ======= */
#footer {
  background: url("../img/footer-bg.webp") top center no-repeat;
  background-size: cover;
  position: relative;
  padding: 60px 0 30px 0;
  color: #cbd5e1;
  font-size: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  /* Dark overlay so the text remains readable over your background image */
  background: rgba(15, 23, 42, 0.85); 
}

#footer .container {
  position: relative;
  z-index: 1; /* Ensures text stays above the background overlay */
}

#footer .footer-top {
  padding-bottom: 30px;
}

#footer .footer-info h3 {
  font-size: 28px;
  margin: 0 0 20px 0;
  font-weight: 700;
  color: #fff;
  font-family: "Satisfy", sans-serif;
  letter-spacing: 1px;
}

#footer .footer-info p {
  font-size: 14px;
  line-height: 24px;
  margin-bottom: 0;
  color: #e2e8f0;
}

#footer .footer-links h4, 
#footer .footer-social h4 {
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  position: relative;
  padding-bottom: 12px;
  margin-bottom: 20px;
}

#footer .footer-links h4::after, 
#footer .footer-social h4::after {
  content: '';
  position: absolute;
  display: block;
  width: 40px;
  height: 2px;
  background: var(--form-button); /* Uses your existing CSS variable */
  bottom: 0;
  left: 0;
}

#footer .footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#footer .footer-links ul li {
  padding: 10px 0;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

#footer .footer-links ul li:first-child { padding-top: 0; }

#footer .footer-links ul a {
  color: #cbd5e1;
  transition: 0.3s;
  text-decoration: none;
}

#footer .footer-links ul a:hover {
  color: var(--form-button-hover);
  transform: translateX(5px);
}

#footer .footer-links ul i {
  padding-right: 5px;
  color: var(--form-button);
  font-size: 18px;
}

#footer .footer-social p {
    color: #e2e8f0;
}

#footer .social-links a {
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--form-button); /* Uses your existing CSS variable */
  color: #fff;
  line-height: 1;
  padding: 8px 0;
  margin-right: 8px;
  border-radius: 50%;
  text-align: center;
  width: 40px;
  height: 40px;
  transition: 0.3s;
  text-decoration: none;
}

#footer .social-links a:hover {
  background: var(--form-button-hover);
  color: #fff;
  transform: translateY(-3px);
}

#footer .copyright {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}

/* Centers the lines and text on mobile devices */
@media (max-width: 768px) {
  #footer .footer-links h4::after, 
  #footer .footer-social h4::after {
    left: 50%;
    transform: translateX(-50%);
  }
  #footer .footer-links ul li { justify-content: center; }
}


/* --- TERMINAL WINDOW --- */
.terminal-window {
  width: 100%;
  max-width: 600px;
  margin: 40px auto 0;
  background: rgba(10, 10, 15, 0.85);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  overflow: hidden;
  backdrop-filter: blur(10px);
  
  /* NEW: Forces GPU rendering to stop buttons from lagging */
  transform: translateZ(0); 
  will-change: transform, opacity, max-height;
  
  /* NEW: max-height added so it can collapse smoothly when closed */
  max-height: 500px; 
  transition: all 0.4s ease, transform 0.4s ease, max-height 0.4s ease 0.2s, margin 0.4s ease 0.2s, visibility 0.4s;
  transform-origin: center;
}

.terminal-window.closed {
  max-height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  opacity: 0;
  visibility: hidden;
  padding: 0 !important;
  border: none !important;
}

#hero.terminal-closed .hero-container {
  /* This moves the content naturally if you are using flexbox */
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh; /* Takes full screen height */
  padding-top: 0 !important; /* Forces content to move up */
  justify-content: center !important; /* Aligns content to middle */
}

/* Ensure these are ALWAYS visible */
#hero h1.name, 
#hero h2, 
#hero a.btn {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  transition: none;
}

.terminal-header {
  background: rgba(255,255,255,0.05);
  padding: 10px 15px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.terminal-buttons {
  display: flex;
  gap: 8px; /* Exact macOS spacing */
  align-items: center;
}

/* Base shape for all three buttons */
.terminal-buttons span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 8px; 
  font-weight: 800;
  color: rgba(0, 0, 0, 0.6); 
  /* NEW: Removed 'all' so they don't fight the parent shrinking animation */
  transition: background-color 0.2s ease, filter 0.2s ease;
}

.terminal-buttons .close { background-color: #ff5f56; border: 1px solid #e0443e; }
.terminal-buttons .minimize { background-color: #ffbd2e; border: 1px solid #dea123; }
.terminal-buttons .maximize { background-color: #27c93f; border: 1px solid #1aab29; }

.terminal-buttons span::before {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.terminal-buttons .close::before { content: "✕"; }
.terminal-buttons .minimize::before { content: "−"; font-size: 10px; }
.terminal-buttons .maximize::before { content: "＋"; }

/* 2. The Magic Hover: Show icons ONLY when hovering the group */
.terminal-buttons:hover span::before {
  opacity: 1;
}

/* Optional: Slight darken on active click for tactile feel */
.terminal-buttons span:active {
  filter: brightness(0.8);
}

.terminal-title {
  margin: 0 auto;
  color: #888;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  padding-right: 40px; /* Offset to center title */
}

.terminal-body {
  padding: 20px;
  text-align: left;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: #00f3ff;
  line-height: 1.5;
  height: 150px;
}

.terminal-body pre { margin: 0; }
.cursor { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* --- AI CHAT WIDGET --- */
.ai-chat-wrapper { 
  position: fixed; 
  bottom: 20px; 
  right: 20px; 
  z-index: 9999; 
}

/* Pushes chat up when back-to-top appears */
.ai-chat-wrapper.shifted {
  bottom: 70px; 
}
.ai-chat-btn { 
  background: linear-gradient(135deg, #7000ff, #00f3ff) !important; /* Hardcoded hex so light mode doesn't break it */
  color: #ffffff !important; /* Force white text */
  border: none !important; 
  border-radius: 30px !important; 
  padding: 12px 24px !important;  
  display: flex !important; 
  align-items: center !important; 
  gap: 8px !important; 
  font-weight: 700 !important;
  font-size: 15px !important;
  cursor: pointer; 
  box-shadow: 0 4px 15px rgba(112, 0, 255, 0.3) !important; /* Softer shadow for light mode */
  transition: all 0.3s ease !important;
}

.ai-chat-btn i {
  font-size: 1.3rem !important;
  color: #ffffff !important;
}

.ai-chat-btn:hover { 
  transform: translateY(-3px) scale(1.02) !important; 
  box-shadow: 0 6px 20px rgba(0, 243, 255, 0.5) !important;
}
.ai-chat-window { 
  position: absolute; 
  bottom: 60px; /* Snaps right above the pill */
  right: 0; 
  width: 360px;  
  height: 500px; 
  background: rgba(15, 15, 20, 0.95); 
  backdrop-filter: blur(15px); 
  border: 1px solid rgba(255, 255, 255, 0.15); 
  border-radius: 16px; 
  box-shadow: 0 10px 40px rgba(0,0,0,0.3); 
  display: flex; 
  flex-direction: column; 
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s; 
  transform-origin: bottom right; 
}

.ai-chat-window.hidden { 
  opacity: 0; 
  transform: scale(0.8) translateY(20px); /* ONLY moves down, never to the right! */
  visibility: hidden; 
  pointer-events: none;
}

@keyframes aiPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 243, 255, 0.6), 0 5px 20px rgba(112, 0, 255, 0.4);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(0, 243, 255, 0), 0 5px 20px rgba(112, 0, 255, 0.4);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 243, 255, 0), 0 5px 20px rgba(112, 0, 255, 0.4);
  }
}

.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(0, 243, 255, 0.5); /* Cyan glassy look */
  border-radius: 4px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--primary); 
}

.chat-header {
  padding: 15px 20px;
  background: rgba(20, 22, 26, 0.95); /* Deep dark background */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-profile {
  display: flex;
  align-items: center;
  gap: 12px; /* Perfect spacing between avatar and text */
}

/* The Circular Profile Picture */
.chat-avatar {
  position: relative;
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--primary), #00f3ff);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(0, 243, 255, 0.2);
}

/* The native "Online" overlay dot */
.status-dot {
  position: absolute;
  bottom: 2px;
  right: 0px;
  width: 12px;
  height: 12px;
  background-color: #00ff88;
  border: 2.5px solid rgba(20, 22, 26, 1); /* Matches header background to create a cutout effect */
  border-radius: 50%;
}

.chat-info {
  display: flex;
  flex-direction: column;
}

.chat-info h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.chat-info span {
  font-size: 0.75rem;
  color: #00ff88; /* Keeps the green online text */
  font-weight: 500;
  margin-top: 2px;
}

/* Circular Close Button with Hover Animation */
#close-chat-btn {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: #a0aab2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

#close-chat-btn:hover {
  background: rgba(255, 95, 86, 0.15); /* Soft red background on hover */
  color: #ff5f56; /* Red X */
  transform: rotate(90deg); /* Playful twist interaction */
}

.chat-messages { flex-grow: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.msg { 
  padding: 10px 14px; 
  border-radius: 12px; 
  font-size: 0.9rem; 
  line-height: 1.4; 
  max-width: 85%; 
  /* --- ADD THESE 3 LINES TO FIX OVERFLOW --- */
  word-break: break-word; 
  overflow-wrap: break-word;
  white-space: pre-wrap; /* Keeps the AI's line breaks intact! */
}

/* --- ADD THIS TO MAKE LINKS LOOK CLICKABLE --- */
.bot-msg a {
  color: #00f3ff; /* A nice bright cyan */
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color 0.3s;
}

.bot-msg a:hover {
  color: #ffffff;
}
.bot-msg { background: rgba(255,255,255,0.1); color: #e0e0e0; align-self: flex-start; border-bottom-left-radius: 2px; }
.user-msg { background: var(--form-button); color: #000; font-weight: 500; align-self: flex-end; border-bottom-right-radius: 2px; }
.chat-input-area { padding: 15px; background: rgba(0,0,0,0.3); display: flex; gap: 10px; border-top: 1px solid rgba(255, 255, 255, 0.05); }
#chat-input { flex-grow: 1; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #fff; padding: 10px 15px; border-radius: 20px; outline: none; transition: border-color 0.3s; }
#chat-input:focus { border-color: var(--form-button); }
#send-chat-btn { background: var(--primary); color: #fff; border: none; border-radius: 50%; width: 40px; height: 40px; cursor: pointer; transition: background 0.3s; }

/* --- MOBILE RESPONSIVENESS FIXES --- */
@media (max-width: 500px) {
  
  /* Lock the wrapper safely away from the edge */
  .ai-chat-wrapper {
    right: 15px !important;
    bottom: 15px !important;
  }

  /* Make the button slightly smaller for phones */
  .ai-chat-btn {
    padding: 10px 16px !important; 
    font-size: 0.9rem !important;
  }

  /* Lock the chat window to the screen width minus safety margins */
  .ai-chat-window {
    width: 320px !important; /* Fallback */
    max-width: calc(100vw - 30px) !important; /* Absolutely prevents horizontal bleeding */
    height: 60vh !important;
    max-height: 500px !important;
    right: 0 !important; 
    bottom: 60px !important; /* Snaps exactly above the mobile pill */
  }

  .terminal-window {
    width: 100% !important;
    max-width: calc(100vw - 30px) !important; /* Leaves a 15px gap on each side */
    margin: 40px auto 40px auto !important; /* Centers it and adds space below */
  }

  /* 2. Make the text smaller and force it to wrap */
  .terminal-body {
    padding: 15px !important; /* Slightly less padding to save space */
  }

  .terminal-body pre, 
  .terminal-body code {
    font-size: 11px !important; /* Smaller text for mobile */
    white-space: pre-wrap !important; /* CRITICAL: Forces text to wrap instead of scrolling right */
    word-break: break-word !important; 
    overflow-x: hidden !important; /* Hides any remaining horizontal overflow */
  }
}