@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400&display=swap");

/* ========================================== */
/* 1. CSS VARIABLES & THEME SETUP             */
/* ========================================== */
:root {
  /* Light Mode Colors (Default) */
  --bg-body: #cbdcf7;
  --bg-header: #fff;
  --bg-section: #ffffff;
  --bg-section-alt: #e5ecfb;
  --bg-skills: linear-gradient(to bottom, #57059e, #4a00e0);
  --bg-work: linear-gradient(to bottom, #000031, #00002c);
  --bg-footer: rgb(0, 1, 43);
  
  --text-primary: #0e2431;
  --text-secondary: #333;
  --text-heading: rgb(32, 32, 32);
  --text-heading-light: #fff;
  
  --accent-primary: #da0416;
  --accent-secondary: #ffae00;
  --accent-gradient: linear-gradient(90deg, #00dbde, #fc00ff);

  --shadow-light: 0 1px 4px rgba(146, 161, 176, 0.3);
  --shadow-medium: 0 5px 10px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
  /* Dark Mode Colors */
  --bg-body: #0a0a0a;
  --bg-header: #0a0a0a;
  --bg-section: #111111;
  --bg-section-alt: #0a0a0a;
  --bg-skills: linear-gradient(to bottom, #1a1a1a, #0a0a0a);
  --bg-work: linear-gradient(to bottom, #0a0a0a, #000000);
  
  --text-primary: #e6e6e6;
  --text-secondary: #b3b3b3;
  --text-heading: #ffffff;
  
  --shadow-light: 0 1px 4px rgba(0, 0, 0, 0.5);
  --shadow-medium: 0 5px 15px rgba(0, 0, 0, 0.5);
}

/* ========================================== */
/* 2. BASE STYLES                             */
/* ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  outline: none;
  border: none;
  text-transform: capitalize;
  transition: all 0.2s linear;
}

html {
  font-size: 62.5%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-body);
  font-family: "Poppins", sans-serif;
  color: var(--text-primary);
  transition: background 0.3s ease, color 0.3s ease;
}

*::selection {
  background: var(--accent-primary);
  color: #fff;
}

html::-webkit-scrollbar { width: 0.8rem; }
html::-webkit-scrollbar-track { background: var(--bg-section-alt); }
html::-webkit-scrollbar-thumb { background: var(--accent-primary); }

/* ========================================== */
/* 3. HEADER & NAVBAR                         */
/* ========================================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.7rem 10%;
  height: 6.5rem;
  background-color: var(--bg-header);
  box-shadow: var(--shadow-light);
  transition: background 0.3s ease;
}

/* Logo Styling */
header .logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  transition: 0.3s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

header .logo:hover {
  background: linear-gradient(90deg, #00dbde, #fc00ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

header .logo .code-icon {
  color: #00dbde;
  font-size: 1.5rem;
  transition: 0.5s ease;
  display: inline-block;
}

header .logo:hover .code-icon {
  transform: rotate(360deg) scale(1.2);
  color: #fc00ff;
  text-shadow: 0 0 10px #fc00ff;
}

/* Dark Mode Toggle */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 2.2rem;
  color: var(--text-primary);
  margin-left: 1rem; /* Reduced margin slightly */
  transition: transform 0.3s ease;
  flex-shrink: 0; /* Prevents squishing */
}
.theme-toggle:hover { transform: rotate(20deg); }

/* Navbar Links */
header .navbar ul {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
}
header .navbar li { margin-left: 2.5rem; }
header .navbar ul li a {
  font-size: 1.57rem;
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: 0.04rem;
  transition: 0.2s;
}
header .navbar ul li a.active,
header .navbar ul li a:hover {
  color: var(--accent-primary);
  border-bottom: 0.2rem solid var(--accent-primary);
  padding: 0.5rem 0;
}

#menu {
  font-size: 3rem;
  cursor: pointer;
  color: var(--text-primary);
  display: none;
  margin-left: 1rem; /* Add space between toggle and menu icon */
  flex-shrink: 0;
}

/* ========================================== */
/* 4. SECTIONS GENERAL                        */
/* ========================================== */
section {
  min-height: 100vh;
  padding: 2rem 9%;
}
.heading {
  font-size: 3.5rem;
  color: var(--text-heading);
  font-weight: 800;
  text-align: center;
}
.heading span { color: var(--accent-primary); }

/* ========================================== */
/* 5. HERO SECTION                            */
/* ========================================== */
.home {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  min-height: 100vh;
  align-items: center;
  background: var(--bg-section);
  z-index: 0;
}

.home #particles-js {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1;
}

.home .content { flex: 1 1 40rem; padding-top: 1rem; z-index: 2; }
.home .image { flex: 1 1 40rem; z-index: 2; text-align: center; }

/* FIX: Responsive Hero Image */
.home .image img {
  width: 100%;
  max-width: 400px; /* Limits size on desktop */
  height: auto; /* Keeps aspect ratio */
  margin-top: 5rem;
  margin-left: 0; /* Removed left margin to allow centering */
  border-radius: 2%;
  box-shadow: var(--shadow-medium);
  cursor: pointer;
  object-fit: cover;
}

.home .content h2 { font-size: 5rem; font-weight: 800; color: var(--text-heading); }
.home .content h2 span { color: #ff7b00; }
.home .content p { font-size: 2.5rem; color: var(--text-secondary); font-weight: 600; padding: 1rem 0; }
.home .content p span { color: rgb(204, 9, 9); }

/* Social Icons */
.socials { position: relative; margin-top: 9rem; z-index: 2; }
.socials .social-icons { padding-left: 0; margin-bottom: 0; list-style: none; }
.socials .social-icons li { display: inline-block; margin-bottom: 14px; }
.social-icons a {
  font-size: 2rem; line-height: 44px; color: #fff;
  background-color: var(--text-primary); width: 44px; height: 44px;
  text-align: center; margin-right: 8px; border-radius: 100%; display: inline-block;
}
.social-icons a:hover { background-color: var(--accent-primary); }

/* ========================================== */
/* 6. ABOUT SECTION                           */
/* ========================================== */
.about { background: var(--bg-section); }
.about .row { display: flex; flex-direction: row; gap: 2rem; flex-wrap: wrap; padding: 4rem; align-items: center; }
.about .row .image { text-align: center; flex: 1 1 35rem; }

/* FIX: Responsive About Image */
.about .row .image img {
  margin: 1rem;
  width: 100%;
  max-width: 350px; /* Limits size */
  height: auto; /* Auto height */
  border-radius: 5%;
  box-shadow: var(--shadow-medium);
  cursor: pointer;
  object-fit: cover;
}

.about .row .content { flex: 1 1 45rem; padding: 3rem; }
.about .row .content h3 { color: var(--text-heading); font-size: 2.5rem; }
.about .row .content .tag { font-size: 1.4rem; color: var(--text-secondary); font-weight: 600; margin-top: 1rem; }
.about .row .content p { font-size: 1.5rem; margin-top: 1.5rem; font-family: "Nunito"; font-weight: 600; text-transform: none; color: var(--text-secondary); }
.about .row .content .box-container { display: flex; flex-wrap: wrap; gap: 1.5rem; font-family: "Nunito"; font-weight: 600; }
.about .row .content .box-container .box p { text-transform: none; color: var(--text-secondary); }
.about .row .content .box-container .box p span { color: var(--accent-primary); }

.resumebtn { margin-top: 6rem; }
.resumebtn .btn {
  padding: 1.9rem 3rem; border-radius: 0.5em; color: #fff;
  background: var(--accent-primary); box-shadow: 0px 5px 10px rgba(247, 48, 48, 0.6);
  font-family: "Nunito", sans-serif; display: inline-block;
}
.resumebtn .btn span { font-weight: 600; font-size: 1.8rem; letter-spacing: 0.1rem; }
.resumebtn .btn i { margin-left: 0.3rem; font-size: 1.2rem; transition: 0.3s; }
.resumebtn .btn:hover { background: #8d0707; }
.resumebtn .btn:hover i { transform: translateX(5px); }

/* ========================================== */
/* 7. SKILLS SECTION                          */
/* ========================================== */
.skills { min-height: 90vh; background: var(--bg-skills); }
.skills h2 { color: #fff; }
.skills .heading span { color: rgb(212, 192, 6); }
.skills .container { background: rgba(0, 0, 22, 0.4); color: #fff; border-radius: 1rem; padding: 2rem; width: 90%; margin: auto; margin-top: 2rem; }
.skills .container .row { display: grid; grid-template-columns: repeat(6, 1fr); flex-wrap: wrap; gap: 1.8rem; }
.skills .container .bar { margin-bottom: 15px; padding: 10px; border-radius: 1rem; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); background: rgba(0, 0, 22, 0.9); transition: 0.2s; }
.skills .container .bar:hover { box-shadow: 0 8px 10px rgba(0, 2, 68, 0.8) !important; background-color: rgba(0, 0, 0, 0.9) !important; }
.skills .container .bar .info { display: flex; flex-direction: column; align-items: center; gap: 1rem; margin-top: 1rem; }
.skills .container .bar .info i { font-size: 4rem; }
.skills .container .bar .info span { font-size: 2rem; font-weight: 500; font-family: "Poppins"; margin-left: 0.5rem; }

/* ========================================== */
/* 8. EDUCATION SECTION                       */
/* ========================================== */
.education {
  background: var(--bg-section-alt);
  min-height: 80vh;
}
.education .qoute {
  font-size: 1.5rem;
  text-align: center;
  font-family: "Nunito", sans-serif;
  font-weight: 600;
  margin-top: 0.5rem;
  color: var(--text-secondary);
}
.education .box-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
.education .box-container .box {
  display: flex;
  flex-direction: row;
  width: 80%;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-medium);
  text-align: center;
  position: relative;
  margin-top: 2rem;
  overflow: hidden;
  transition: 0.3s;
  background: var(--bg-section);
  
  /* FIX: Allow box to shrink to content */
  height: auto; 
  align-items: stretch; /* Ensure image and text match height */
}
.education .box-container .box:hover {
  transform: scale(1.03);
}
.education .box-container .box .image {
  flex: 0 0 25rem; /* Fixed width for image area */
  width: 100%;
}
.education .box-container .box img {
  object-fit: cover;
  position: relative;
  width: 100%;
  height: 100%;
}
.education .box-container .box .content {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 2rem; /* Added padding */
  flex-wrap: wrap;
  flex: 1; /* Takes remaining space */
  justify-content: center; /* Centers text vertically if image is taller */
}
.education .box-container .box .content h3 {
  font-size: 2.5rem;
  color: var(--text-heading);
  padding: 0.5rem 0;
  font-weight: 600;
  text-align: left;
  margin-left: 0; /* Removed margin, using padding on container */
}
.education .box-container .box .content p {
  font-size: 1.5rem;
  margin-left: 0;
  text-align: left;
  color: var(--text-secondary);
}
.education h4 {
  font-size: 2rem;
  color: rgb(34, 109, 0);
  text-align: left;
  margin: 1rem 0;
  font-family: "Nunito", sans-serif;
  font-weight: 700;
}
/* ========================================== */
/* 9. WORK / PROJECTS SECTION                 */
/* ========================================== */
.work { background: var(--bg-work); }
.work h2 { color: #fff; padding: 1rem; }
.work .heading span { color: rgb(194, 175, 7); }
.work .box-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(30rem, 1fr)); gap: 1.5rem; margin: 2rem; }
.work .box-container .box { border-radius: 0.5rem; box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1); position: relative; overflow: hidden; height: 35rem; }
.work .box-container .box img { height: 100%; width: 100%; object-fit: cover; }
.work .box-container .box .content { height: 100%; width: 100%; position: absolute; top: 85%; left: 0; background: rgba(255, 255, 255, 0.95); display: flex; flex-direction: column; transition: top 0.4s ease; }
[data-theme="dark"] .work .box-container .box .content { background: rgba(20, 20, 20, 0.95); color: #fff; }
.work .box-container .box .content .tag { display: flex; flex-direction: row; justify-content: space-between; align-items: center; height: 4.5rem; width: 100%; padding-left: 1rem; background: #010124; color: #FFF; }
.work .box-container .box .content .tag h3 { font-size: 2rem; }
.work .box-container .box:hover .content { top: 20%; }
.work .desc { margin: 2rem; display: flex; flex-direction: column; justify-content: center; }
.work .desc p { font-size: 1.5rem; color: var(--text-secondary); }
.work .desc .btns { display: flex; justify-content: space-between; width: 100%; margin-top: 2rem; }
.work .desc .btns .btn { line-height: 0; display: inline; padding: 1.5rem 2.5rem; border-radius: 0.5rem; font-size: 1.5rem; color: #fff; background: rgb(12, 12, 12); margin-right: 2rem; }
.work .desc .btns .btn:hover { background: #010124; }

/* ========================================== */
/* 10. EXPERIENCE TIMELINE                    */
/* ========================================== */
.experience .timeline { position: relative; max-width: 1500px; margin: 0 auto; }
.experience .timeline::after { content: ""; position: absolute; width: 6px; background: var(--text-primary); top: 0; bottom: 0; left: 50%; margin-left: -3px; z-index: -2; }
.experience .container { padding: 10px 40px; position: relative; background-color: inherit; width: 50%; }
.experience .container::after { content: "\f0b1"; position: absolute; width: 25px; height: 25px; right: -17px; background-color: var(--bg-section); border: 4px solid #ff9f55; top: 15px; border-radius: 50%; z-index: 100; font-size: 1.89rem; text-align: center; font-weight: 600; color: var(--text-primary); font-family: "Font Awesome\ 5 Free"; }
.experience .left { left: 0; }
.experience .right { left: 50%; }
.experience .left::before { content: " "; height: 0; position: absolute; top: 22px; width: 0; z-index: 1; right: 30px; border: medium solid #f68c09; border-width: 10px 0 10px 10px; border-color: transparent transparent transparent #f68c09; }
.experience .right::before { content: " "; height: 0; position: absolute; top: 22px; width: 0; z-index: 1; left: 30px; border: medium solid #f68c09; border-width: 10px 10px 10px 0; border-color: transparent #f68c09 transparent transparent; }
.experience .right::after { left: -16px; }
.experience .content { background-color: #f68c09; position: relative; border-radius: 6px; color: #000; }
.experience .content .tag { font-size: 1.3rem; padding-top: 1.5rem; padding-left: 1.5rem; }
.experience .content .desc { margin-left: 1.5rem; padding-bottom: 1rem; }
.experience .content .desc h3 { font-size: 1.5rem; font-weight: 600; }
.experience .content .desc p { font-size: 1.2rem; }

/* ========================================== */
/* 11. CERTIFICATIONS SECTION                 */
/* ========================================== */
.certifications {
  background: var(--bg-skills);
  min-height: 80vh;
}
.certifications .heading { color: #ffffff; }
.certifications .heading span { color: #ffcc00; }
.certifications .qoute {
  font-size: 1.5rem;
  text-align: center;
  font-family: "Nunito", sans-serif;
  font-weight: 600;
  margin-top: 0.5rem;
  color: #ffffff;
}
.certifications .box-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
.certifications .box-container .box {
  display: flex;
  flex-direction: row;
  width: 80%;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-medium);
  text-align: center;
  position: relative;
  margin-top: 2rem;
  overflow: hidden;
  transition: 0.3s;
  background: rgba(255, 255, 255, 0.9);

  /* FIX: Allow box to shrink to content */
  height: auto; 
  align-items: stretch;
}
[data-theme="dark"] .certifications .box-container .box {
  background: rgba(20, 20, 20, 0.9);
  color: #fff;
}
.certifications .box-container .box:hover {
  transform: scale(1.03);
}
.certifications .box-container .box .content {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 2rem; /* Good padding */
  flex-wrap: wrap;
  width: 100%; /* Full width since there is no image */
}
.certifications .box-container .box .content h3 {
  font-size: 2.5rem;
  color: var(--text-heading);
  padding: 0.5rem 0;
  font-weight: 600;
  text-align: left;
}
[data-theme="dark"] .certifications .box-container .box .content h3 {
  color: #fff;
}
.certifications .box-container .box .content p {
  font-size: 1.5rem;
  text-align: left;
  color: var(--text-secondary);
}
.certifications .box-container .box .content .credential-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 1.5rem;
  color: #57059e;
  text-decoration: none;
  font-weight: 600;
}
.certifications .box-container .box .content .credential-link:hover {
  text-decoration: underline;
  color: #4a00e0;
}
/* ========================================== */
/* 12. FOOTER SECTION                         */
/* ========================================== */
.footer { min-height: auto; padding-top: 0; background: var(--bg-footer); }
.footer .box-container { display: flex; justify-content: center; flex-wrap: wrap; }
.footer .box-container .box { flex: 1 1 25rem; margin: 2.5rem; }
.footer .box-container .box h3 { font-size: 2.5rem; color: #fff; padding-bottom: 1rem; font-weight: normal; }
.footer .box-container .box p { font-size: 1.5rem; color: #ccc; padding: 0.7rem 0; text-transform: none; }
.footer .box-container .box a { font-size: 1.5rem; color: rgb(238, 238, 238); padding: 0.3rem 0; display: block; }
.footer .box-container .box a:hover { color: var(--accent-secondary); }
.footer .credit { padding: 1rem 0 0 0; text-align: center; font-size: 1.5rem; font-family: "Nunito"; font-weight: 600; color: #fff; border-top: 0.1rem solid #fff3; }
.footer .credit a { color: var(--accent-secondary); }

/* Footer Social Icons Horizontal */
.footer .share { list-style: none; padding: 1rem 0; margin-top: 1rem; display: flex; align-items: center; gap: 1rem; }
.footer .share li { margin: 0; }
.footer .share li a { height: 4rem; width: 4rem; line-height: 4rem; text-align: center; border-radius: 50%; font-size: 1.7rem; background: rgb(230, 230, 230); color: #02094b; display: inline-block; transition: 0.2s; }
.footer .share li a:hover { background: transparent; border: 0.1rem solid rgb(180, 178, 178); color: #ffae00; transform: scale(0.98); }

/* ========================================== */
/* 13. SCROLL TO TOP                          */
/* ========================================== */
#scroll-top { position: fixed; top: -140%; right: 2rem; padding: 1.3rem 1.5rem; font-size: 2rem; background: var(--accent-secondary); color: rgb(13, 0, 44); border-radius: 50%; transition: 1s linear; z-index: 1000; }
#scroll-top.active { top: calc(100% - 12rem); }

/* ========================================== */
/* 14. MEDIA QUERIES (MOBILE RESPONSIVENESS)  */
/* ========================================== */

/* Mobile Menu Logic */
@media (max-width: 768px) {
  #menu { display: block; } /* Show Hamburger */
  
  /* Fix Header Squeeze */
  header { padding: 1.5rem 3%; }
  header .logo { font-size: 1.5rem; } /* Smaller logo */
  header .logo .code-icon { font-size: 1.2rem; }
  
  header .navbar {
    position: fixed; top: 6.5rem; right: -120%; width: 75%; height: 100%;
    text-align: left; align-items: flex-start;
    background-color: var(--bg-header);
    box-shadow: 0 5px 10px rgba(0,0,0,0.3);
    transition: right 0.3s ease;
  }
  header .navbar.active { right: 0; } /* Slide In */
  header .navbar ul { flex-flow: column; padding: 1rem; width: 100%; }
  header .navbar ul li { width: 100%; margin: 1rem 0; }
  header .navbar ul li a { display: block; padding: 1rem; color: var(--text-primary); font-size: 2rem; }
  header .navbar ul li a:hover { color: #fff; background: var(--accent-primary); border-bottom: none; }
}

/* Hero & General Mobile Fixes */
@media (max-width: 450px) {
  .home { flex-flow: column-reverse; padding: 2rem; gap: 2rem; }
  .home .image img { width: 90vw; max-width: 300px; margin-left: 0; margin-top: 1rem; }
  .home .content { text-align: center; }
  .home .content h2 { font-size: 3rem; }
  .socials { margin-top: 4rem; text-align: center; }
  .heading { font-size: 2.5rem; }
}

/* About Section Mobile */
@media screen and (max-width: 600px) {
  .about .row { flex-direction: column-reverse; padding: 2rem; }
  .about .row .image img { width: 100%; max-width: 300px; }
}

/* Skills Mobile Fix */
@media screen and (max-width: 600px) {
  .skills .container .row { 
    grid-template-columns: repeat(2, 1fr); 
    gap: 1.5rem; /* Increased gap to prevent overlap */
  }
  .skills .container .bar .info span { font-size: 1.5rem; }
}

/* Education & Certifications Mobile */
@media screen and (max-width: 768px) {
  .education .box-container .box, 
  .certifications .box-container .box {
    width: 95%;
    flex-direction: column; /* Stack image on top of text */
  }
  /* Hide image on mobile for education if it creates too much empty space, or keep it small */
  .education .box-container .box .image { 
     height: 20rem; 
     flex: none; 
  } 
  .education .box-container .box .content { padding: 1.5rem; }
}

/* Projects Mobile */
@media screen and (max-width: 600px) {
  .work .box-container { grid-template-columns: 1fr; margin: 1rem; }
  .work .desc .btns { flex-direction: column; gap: 1rem; }
  .work .desc .btns .btn { width: 100%; text-align: center; margin-right: 0; }
}

/* Experience Timeline Mobile */
@media screen and (max-width: 600px) {
  .experience .timeline::after { left: 31px; }
  .experience .container { width: 100%; padding-left: 7rem; padding-right: 2rem; }
  .experience .container::after { left: 11px; }
  .experience .container::before { left: 61px; border-width: 10px 10px 10px 0; border-color: transparent #f68c09 transparent transparent; }
  .experience .left::after, .experience .right::after { left: 15px; }
  .experience .right { left: 0%; }
}

/* Footer Mobile */
@media (max-width: 768px) {
  .footer .box-container { flex-direction: column; align-items: center; text-align: center; }
  .footer .box-container .box { text-align: center; margin: 1.5rem 0; }
  .footer .share { justify-content: center; }
}
