body {
    font-family: 'Poppins', sans-serif;
    scroll-behavior: smooth;
    transition: background-color 0.3s, color 0.3s;
    position: relative;
    overflow-x: hidden;
}

/* Dark Theme (Default) */
body {
    background-color: #0d0d1a;
    color: #e0e0e0;
}

body.dark-theme .navbar {
    background: linear-gradient(90deg, #1a1a2e, #2c2c44) !important;
}

body.dark-theme .bg-light {
    background: linear-gradient(90deg, #1a1a2e, #2c2c44) !important;
}

body.dark-theme .skill-item, body.dark-theme .project-item, body.dark-theme .education-item, body.dark-theme .experience-item {
    background: #2a2a4a;
    border: 1px solid rgba(0, 123, 255, 0.3);
}

body.dark-theme .skill-item:hover, body.dark-theme .project-item:hover, body.dark-theme .education-item:hover, body.dark-theme .experience-item:hover {
    background: #3a3a6a;
}

body.dark-theme #hero {
    background: linear-gradient(135deg, #1a1a2e, #2c2c44);
}

/* Light Theme */
body:not(.dark-theme) {
    background-color: #f0f4f8;
    color: #333;
}

body:not(.dark-theme) .navbar {
    background: linear-gradient(90deg, #343a40, #495057) !important;
}

body:not(.dark-theme) .bg-light {
    background: linear-gradient(90deg, #e9ecef, #f8f9fa) !important;
}

body:not(.dark-theme) .skill-item, body:not(.dark-theme) .project-item, body:not(.dark-theme) .education-item, body:not(.dark-theme) .experience-item {
    background: #ffffff;
    border: 1px solid rgba(0, 123, 255, 0.1);
}

body:not(.dark-theme) #hero {
    background: linear-gradient(135deg, #e9ecef, #f8f9fa);
}

/* Background Visual Effects */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.tech-particle {
    position: absolute;
    animation: float 10s infinite ease-in-out;
}

.tech-particle.circuit {
    width: 25px;
    height: 25px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="rgba(0, 123, 255, 0.7)" stroke-width="2"><path d="M12 2v4M12 18v4M2 12h4M18 12h4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83"/></svg>') no-repeat center;
    background-size: contain;
}

.tech-particle.code {
    width: 30px;
    height: 30px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="rgba(0, 255, 127, 0.7)" stroke-width="2"><path d="M16 18l6-6-6-6M8 6l-6 6 6 6"/></svg>') no-repeat center;
    background-size: contain;
}

.tech-particle.binary {
    width: 20px;
    height: 20px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="rgba(0, 255, 127, 0.7)" stroke="none"><text x="50%" y="50%" font-size="12" text-anchor="middle" dominant-baseline="middle">01</text></svg>') no-repeat center;
    background-size: contain;
}

.tech-particle.node {
    width: 15px;
    height: 15px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="rgba(255, 215, 0, 0.7)" stroke="none"><circle cx="12" cy="12" r="8"/></svg>') no-repeat center;
    background-size: contain;
}

.tech-particle.data-flow {
    width: 2px;
    height: 50px;
    background: linear-gradient(180deg, rgba(0, 255, 127, 0.7), transparent);
    animation: dataFlow 5s infinite ease-in-out;
}

.tech-particle.matrix {
    width: 10px;
    height: 20px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="rgba(0, 255, 127, 0.7)" stroke="none"><text x="50%" y="50%" font-size="12" text-anchor="middle" dominant-baseline="middle">1</text></svg>') no-repeat center;
    background-size: contain;
    animation: matrixRain 8s infinite linear;
}

.tech-particle.glow {
    filter: drop-shadow(0 0 5px rgba(0, 123, 255, 0.5));
}

.tech-particle:nth-child(1) { top: 10%; left: 20%; animation-delay: 0s; }
.tech-particle:nth-child(2) { top: 30%; left: 50%; animation-delay: 2s; }
.tech-particle:nth-child(3) { top: 50%; left: 70%; animation-delay: 4s; }
.tech-particle:nth-child(4) { top: 70%; left: 30%; animation-delay: 6s; }
.tech-particle:nth-child(5) { top: 90%; left: 80%; animation-delay: 8s; }
.tech-particle:nth-child(6) { top: 20%; left: 40%; animation-delay: 1s; }
.tech-particle:nth-child(7) { top: 60%; left: 10%; animation-delay: 3s; }
.tech-particle:nth-child(8) { top: 40%; left: 90%; animation-delay: 5s; }
.tech-particle:nth-child(9) { top: 15%; left: 60%; animation-delay: 7s; }
.tech-particle:nth-child(10) { top: 80%; left: 20%; animation-delay: 9s; }
.tech-particle:nth-child(11) { top: 25%; left: 85%; animation-delay: 0s; }
.tech-particle:nth-child(12) { top: 65%; left: 45%; animation-delay: 3s; }
.tech-particle:nth-child(13) { top: 5%; left: 15%; animation-delay: 2s; }
.tech-particle:nth-child(14) { top: 35%; left: 95%; animation-delay: 4s; }
.tech-particle:nth-child(15) { top: 75%; left: 55%; animation-delay: 6s; }

@keyframes float {
    0% { transform: translateY(0) translateX(0); opacity: 0.5; }
    50% { transform: translateY(-100px) translateX(50px); opacity: 1; }
    100% { transform: translateY(0) translateX(0); opacity: 0.5; }
}

@keyframes dataFlow {
    0% { transform: translateY(-100%); opacity: 0; }
    50% { transform: translateY(100vh); opacity: 1; }
    100% { transform: translateY(100vh); opacity: 0; }
}

@keyframes matrixRain {
    0% { transform: translateY(-100%); opacity: 1; }
    100% { transform: translateY(100vh); opacity: 0; }
}

/* Glow Effect */
.glow {
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.3), 0 0 20px rgba(0, 123, 255, 0.1);
}

.glow-text {
    text-shadow: 0 0 5px rgba(0, 123, 255, 0.3), 0 0 10px rgba(0, 123, 255, 0.1);
}

/* Enhanced Typography */
h1, h2, h5 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
}

p, ul {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 3px;
    background: linear-gradient(90deg, #007bff, #00ddeb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: glowPulse 2s infinite;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 4px;
    background: linear-gradient(90deg, #007bff, #00ddeb);
    border-radius: 2px;
    animation: underlineExpand 1s ease-in-out forwards;
}

@keyframes glowPulse {
    0% { text-shadow: 0 0 5px rgba(0, 123, 255, 0.3); }
    50% { text-shadow: 0 0 15px rgba(0, 123, 255, 0.5); }
    100% { text-shadow: 0 0 5px rgba(0, 123, 255, 0.3); }
}

@keyframes underlineExpand {
    0% { width: 0; }
    100% { width: 60%; }
}

.highlight-heading {
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    color: #00ddeb;
    text-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.highlight-heading:hover {
    color: #ff007a;
    text-shadow: 0 0 10px rgba(255, 0, 122, 0.5);
}

.highlight-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #b0b0d0;
    transition: color 0.3s ease;
}

body:not(.dark-theme) .highlight-text {
    color: #555;
}

.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    font-size: 1.2rem;
    margin-left: 20px;
    transition: transform 0.3s ease;
}

.nav-link:hover {
    transform: scale(1.1);
}

section {
    padding: 80px 0;
    position: relative;
}

h5 {
    font-size: 1.5rem;
    margin-top: 20px;
}

/* Profile Picture (Simplified, No Shiny Border) */
.profile-pic-container {
    position: relative;
    display: inline-block;
}

#profile-pic {
    border: 3px solid #4a4a6a;
    width: 200px;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

#profile-pic:hover {
    transform: scale(1.05);
    border-color: #00ddeb;
}

.upload-btn {
    display: block;
    margin: 10px auto;
    padding: 8px 15px;
    background: #007bff;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.upload-btn:hover {
    background: #00ddeb;
    transform: scale(1.05);
}

/* Centering Content */
.container {
    text-align: center;
}

.education-item, .experience-item, .project-item, .skill-item {
    max-width: 900px;
    margin: 0 auto 30px auto;
    padding: 20px;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Card Effect for Items */
.card-effect {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(147, 112, 219, 0.2), transparent);
    transition: 0.5s;
}

.card-effect:hover::before {
    left: 100%;
}

.card-effect:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Animations */
.animate-hero {
    opacity: 0;
    animation: zoomIn 1s ease-in forwards;
}

@keyframes zoomIn {
    0% { opacity: 0; transform: scale(0.5); }
    100% { opacity: 1; transform: scale(1); }
}

.animate-heading {
    opacity: 0;
    animation: fadeIn 1s ease-in forwards;
}

.animate-content {
    opacity: 0;
    animation: fadeIn 1s ease-in forwards;
    animation-delay: 0.3s;
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Skill Animation */
.skill-item {
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.skill-item:hover {
    transform: scale(1.05);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(0, 123, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 123, 255, 0); }
}

.skill-item p {
    margin: 0;
}

/* Theme Toggle Dropdown (Redesigned) */
.theme-toggle {
    z-index: 1001;
    width: 150px;
    top: 10px;
    right: 10px;
}

.custom-theme-select {
    background: #1a1a2e; /* Solid dark background to match the theme */
    color: #00ddeb; /* Neon cyan text */
    border: 2px solid #ff007a; /* Neon magenta border for contrast */
    border-radius: 8px; /* Slightly more rounded corners */
    padding: 6px 25px 6px 10px; /* Adjusted padding for better spacing */
    font-size: 1rem;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1.5px;
    text-transform: uppercase; /* Matches the futuristic style */
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="rgba(255, 0, 122, 0.7)" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>'); /* Magenta dropdown arrow */
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    box-shadow: 0 0 8px rgba(255, 0, 122, 0.3); /* Subtle magenta glow */
    cursor: pointer;
}

.custom-theme-select:hover {
    background: #2a2a4a; /* Slightly lighter background on hover */
    border-color: #00ddeb; /* Cyan border on hover */
    box-shadow: 0 0 12px rgba(0, 221, 235, 0.5); /* Cyan glow on hover */
    transform: scale(1.05); /* Subtle scale effect */
}

.custom-theme-select:focus {
    background: #2a2a4a;
    border-color: #00ddeb;
    box-shadow: 0 0 12px rgba(0, 221, 235, 0.5);
    outline: none;
}

.custom-theme-select option {
    background: #1a1a2e;
    color: #00ddeb;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.4rem;
    }

    .nav-link {
        font-size: 1rem;
        margin-left: 10px;
    }

    .section-title {
        font-size: 2.2rem;
    }

    h5 {
        font-size: 1.3rem;
    }

    p, ul {
        font-size: 1rem;
    }

    .skill-item, .project-item, .education-item, .experience-item {
        padding: 15px;
    }

    #profile-pic {
        width: 150px;
        height: 150px;
    }

    .theme-toggle {
        width: 120px;
        top: 5px;
        right: 5px;
    }

    .custom-theme-select {
        font-size: 0.9rem;
        padding: 5px 20px 5px 8px;
        background-size: 10px;
    }
}