:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --background-color: #f4f4f9;
    --text-color: #333;
    --card-bg-color: #fff;
    --shadow-color: rgba(0, 0, 0, 0.1);

    --bg-light: #f5f7ff;
    --bg-dark: #050816;
    --text-light: #111827;
    --text-dark: #e5e7eb;

    --track-light: linear-gradient(135deg, #ffffff, #e5f0ff);
    --track-dark: linear-gradient(135deg, #15192c, #0b1120);

    --circle-light: radial-gradient(circle at 30% 30%, #ffffff, #facc15);
    --circle-dark: radial-gradient(circle at 30% 30%, #f9fafb, #64748b);

    --glow-light: rgba(250, 204, 21, 0.65);
    --glow-dark: rgba(56, 189, 248, 0.65);

    --transition-fast: 0.25s ease-out;
    --transition-med: 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-theme="dark"] {
    --primary-color: #8A2BE2;
    --secondary-color: #4A90E2;
    --background-color: #121212;
    --text-color: #f4f4f9;
    --card-bg-color: #1e1e1e;
    --shadow-color: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

body.theme-light {
    background: radial-gradient(circle at top, #e0f2fe, #eef2ff 40%, #f9fafb 80%);
    color: var(--text-light);
}

body.theme-dark {
    background: radial-gradient(circle at top, #0f172a, #020617 50%, #000000 90%);
    color: var(--text-dark);
}

/* Preloader */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--background-color);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader {
    border: 8px solid var(--shadow-color);
    border-top: 8px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header */
.header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    transition: background-color 0.3s, box-shadow 0.3s;
}

[data-theme="dark"] .header {
    background-color: rgba(18, 18, 18, 0.8);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-item {
    margin-left: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary-color);
}

.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--text-color);
    transition: all 0.3s ease-in-out;
}


/* Hero Section */
.hero-section {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: transparent;
    z-index: -1;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.hero-links a {
    margin: 0 1rem;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: color 0.3s;
}

.hero-links a:hover {
    color: var(--primary-color);
}

.cta-button {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: #fff !important;
    padding: 1rem 2rem;
    border-radius: 50px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.cta-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--shadow-color);
}

/* custom day/night toggle from snippet */
.toggle-wrapper {
  display: flex;
  align-items: center;
}

.toggle{
  width:84px;
  height:36px;
  border-radius:50px;
  overflow:hidden;
  position:relative;
  cursor:pointer;
  border:4px solid #e6e6e6;
  box-shadow:
    inset 0 4px 8px rgba(0,0,0,0.2),
    0 2px 5px rgba(0,0,0,0.2);
}

input{display:none}

.sky{
  position:absolute;
  width:100%;
  height:100%;
  background:linear-gradient(135deg,#7a8fd8,#2d5bff);
  transition:0.8s ease;
}

.sky::before{
  content:"";
  position:absolute;
  width:200%;
  height:200%;
  background:
    radial-gradient(circle at left center, rgba(255,255,255,0.22) 0%, transparent 45%),
    radial-gradient(circle at left center, rgba(255,255,255,0.14) 0%, transparent 65%),
    radial-gradient(circle at left center, rgba(255,255,255,0.08) 0%, transparent 80%);
  z-index: 0;
}

input:checked + .toggle .sky{
  background:linear-gradient(135deg,#020617,#0f172a);
}

.track{
  position:absolute;
  top:2px;
  left:2px;
  width:24px;
  height:24px;
  z-index: 2;
  transition:0.8s cubic-bezier(.68,-0.55,.27,1.55);
}

input:checked + .toggle .track{
  transform:translateX(50px);
}

.sun{
  position:absolute;
  top:0;
  left:0;
  width:24px;
  height:24px;
  border-radius:50%;
  background:#ffd500;
  z-index:2;
  opacity:1;
  transition: opacity 0.45s ease 0.25s;
}

.sun-glow{
  position:absolute;
  width:40px;
  height:40px;
  top:-8px;
  left:-8px;
  z-index:1;
  opacity:1;
  transition: opacity 0.45s ease 0.25s;
}

input:checked + .toggle .sun-glow{
  opacity:0;
}

.moon{
  position:absolute;
  top:0;
  left:0;
  width:24px;
  height:24px;
  border-radius:50%;
  background:#cfcfcf;
  box-shadow: inset -4px -4px 6px rgba(0,0,0,0.35);
  opacity:0;
  z-index:3;
  transition: opacity 0.45s ease 0.25s;
}

.moon::before,
.moon::after{
  content:"";
  position:absolute;
  background:#6b7280;
  border-radius:50%;
}
.moon::before{ width:4px;height:4px;top:8px;left:6px;}
.moon::after{ width:6px;height:6px;top:13px;left:13px;}

input:checked + .toggle .sun{ opacity:0; }
input:checked + .toggle .moon{ opacity:1; }

.clouds-day{
  position:absolute;
  bottom:0;
  width:200%;
  height:100%;
  z-index:1;
  animation:cloudMove 25s linear infinite;
}

.clouds-day svg{
  position:absolute;
  bottom:0;
  width:100%;
  transform: scale(0.2); /* scale to fit smaller toggle */
  transform-origin: bottom left;
}

.clouds-day svg path {
  fill: rgba(255, 255, 255, 0.92);
  filter: blur(0.5px);
  opacity: 0.95;
}

.layer2{ opacity:0.7; animation-duration:35s; }
.layer3{ opacity:0.5; animation-duration:45s; }

@keyframes cloudMove{
  0%{transform:translateX(0);} 
  100%{transform:translateX(-50%);} 
}

input:checked + .toggle .clouds-day{
  opacity:0;
}

.clouds-night{
  position:absolute;
  width:100%;
  height:100%;
  top:0;
  left:0;
  z-index:1;
  opacity:0;
  transition:0.6s;
  background: radial-gradient(180deg, rgba(30, 34, 60, 0.38) 0%, rgba(10, 14, 28, 0.70) 70%), url("D:/Downloads/No result - clouds.gif");
  background-repeat: no-repeat;
  background-size: 150% 210%;
  background-position: center 20%;
  filter: brightness(1.0) opacity(0.85);
}

input:checked + .toggle .clouds-night{
  opacity:0.7;
}

.stars{
  position:absolute;
  width:45%;
  height:100%;
  left:0;
  z-index:0;
  opacity:0;
}

input:checked + .toggle .stars{
  opacity:1;
}

.stars dotlottie-wc{
  transform:scale(1.6);
}

/* Content Sections */
.content-section {
    padding: 6rem 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 0.5rem auto 0;
}

/* About Section */
.about-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    align-items: start;
}

.education-timeline h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.timeline-item {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    border-left: 2px solid var(--primary-color);
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--primary-color);
}

.education-timeline h4 a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.education-timeline h4 a:hover {
    color: var(--primary-color);
}

/* Project Section */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--card-bg-color);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%; /* The fix for card alignment */
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px var(--shadow-color);
}

.project-card h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.project-card .project-description {
    flex-grow: 1; /* Fix for aligning buttons */
}

.project-card .tech-stack {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.project-links {
    text-align: center;
    margin-top: 1.5rem;
}

.project-link {
    display: inline-block;
    border: 2px solid var(--primary-color);
    padding: 8px 24px;
    border-radius: 50px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.project-link:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.skill-category h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.skill-category ul {
    list-style: none;
}

.skill-category li {
    background: var(--card-bg-color);
    margin-bottom: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 5px;
    box-shadow: 0 2px 5px var(--shadow-color);
    transition: transform 0.2s;
}

.skill-category li:hover {
    transform: translateX(5px);
}

/* Certifications & Achievements */
.cert-achieve-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.card {
    background: var(--card-bg-color);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow-color);
}

.card h3 {
     color: var(--primary-color);
     margin-bottom: 1rem;
}

.card ul {
    padding-left: 20px;
    list-style-type: disc;
}

.card ul li {
    margin-bottom: 0.5rem;
}

.card ul li a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.card ul li a:hover {
    color: var(--primary-color);
}

/* Contact Section */
#contact {
    text-align: center;
}

.contact-info p {
    margin: 0.5rem 0;
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.social-links a {
    display: inline-block;
    margin: 1.5rem 1rem 0;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--primary-color);
}

/* Guru chatbot */
#chatbot-toggle {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9998;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: #fff;
    border-radius: 50px;
    padding: 0.8rem 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#chatbot-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(0,0,0,0.30);
}

#chatbot-panel {
    position: fixed;
    right: 20px;
    bottom: 75px;
    width: min(420px, calc(100vw - 40px));
    min-height: 350px;
    max-height: 760px;
    resize: both;
    overflow: auto;
    background: var(--card-bg-color);
    border-radius: 14px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.25);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

#chatbot-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chatbot-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    padding: 0.75rem 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

#chatbot-messages {
    padding: 0.9rem;
    overflow-y: auto;
    flex: 1;
    min-height: 240px;
    font-size: 0.95rem;
    background: var(--bg-light);
    white-space: pre-wrap;
}

.chatbot-message {
    margin-bottom: 0.75rem;
    line-height: 1.35;
    white-space: pre-wrap;
}

.chatbot-message.bot {
    background: #f1f5ff;
    color: #102a43;
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    align-self: flex-start;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.chatbot-message.bot.chatbot-avatar {
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.chatbot-message.bot.chatbot-avatar img {
    width: 90px;
    height: 90px;
    border-radius: 0;
    border: none;
    background: none;
}

.chatbot-message.user {
    background: #e6faff;
    color: #034a79;
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    align-self: flex-end;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.chatbot-form {
    display: flex;
    flex-direction: column;
    padding: 0.7rem;
    border-top: 1px solid #e2e8f0;
    gap: 0.5rem;
}

#chatbot-input {
    width: 100%;
    min-height: 48px;
    max-height: 140px;
    font-size: 0.95rem;
    line-height: 1.4;
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    resize: vertical;
}

#chatbot-form button {
    border: none;
    background: var(--primary-color);
    color: #fff;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
}

#chatbot-form button:hover {
    opacity: 0.95;
}

#chatbot-panel.fullscreen {
    width: min(95vw, 1100px) !important;
    height: min(80vh, 850px) !important;
    right: 2.5vw !important;
    bottom: 2.5vh !important;
    min-height: auto;
    max-height: none;
}

.chatbot-header-actions {
    display: inline-flex;
    gap: 0.4rem;
}

#chatbot-maximize,
#chatbot-close {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

#chatbot-maximize:hover,
#chatbot-close:hover {
    background: rgba(255,255,255,0.2);
}

#chatbot-close {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
}

@media(max-width: 480px) {
    #chatbot-panel {
        width: calc(100vw - 30px);
        right: 15px;
        bottom: 65px;
    }
}


/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--card-bg-color);
    margin-top: 4rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 5rem;
        flex-direction: column;
        background-color: var(--background-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding-bottom: 2rem;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 1.5rem 0;
    }

    .hamburger {
        display: block;
        z-index: 101;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1.2rem;
    }
    
    .content-section {
        padding: 4rem 1rem;
    }

    .cert-achieve-grid {
        grid-template-columns: 1fr;
    }
}
