/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px; /* Set a base font size for responsive typography */
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #0a0a0a;
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden; /* Prevents horizontal scrolling */
}
.project-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem; /* Use rem for scalable padding */
}

/* Typography */
h1, h2, h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
}

h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(10, 10, 10, 0.98);
    box-shadow: 0 2px 20px rgba(138, 43, 226, 0.1);
}

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

.nav-logo {
    font-size: 1.5rem;
    font-weight: 900;
}

.logo-text {
    background: linear-gradient(135deg, #8a2be2, #dda0dd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #8a2be2;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #8a2be2, #dda0dd);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001; /* Ensure it's above other elements */
}

.hamburger .bar {
    width: 25px;
    height: 3px;
    background: #ffffff;
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding: 0 1rem; /* Add padding for smaller screens */
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.hero-content {
    z-index: 1;
    max-width: 800px;
    padding: 0 1rem; /* Consistent padding */
}

.hero-title {
    font-size: 4rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff, #dda0dd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.typewriter {
    display: inline-block;
    border-right: 3px solid #8a2be2;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { border-color: #8a2be2; }
    51%, 100% { border-color: transparent; }
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #e0e0e0;
    margin-bottom: 1rem;
    font-weight: 300;
}

.hero-description {
    font-size: 1.1rem;
    color: #b0b0b0;
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, #8a2be2, #dda0dd);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(138, 43, 226, 0.4);
}

.btn-secondary {
    background: transparent;
    color: #ffffff;
    border: 2px solid #8a2be2;
}

.btn-secondary:hover {
    background: #8a2be2;
    transform: translateY(-2px);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid #8a2be2;
    border-bottom: 2px solid #8a2be2;
    transform: rotate(45deg);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* Section Styles */
section {
    padding: 100px 0;
    position: relative;
}

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

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #8a2be2, #dda0dd);
}

.section-subtitle {
    text-align: center;
    color: #b0b0b0;
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

/* About Section */
.about {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-intro {
    font-size: 1.2rem;
    color: #8a2be2;
    margin-bottom: 1.5rem;
}

.about-description {
    color: #e0e0e0;
    margin-bottom: 2rem;
    line-height: 1.8;
}

.about-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #2d2d2d;
}

.detail-label {
    color: #8a2be2;
    font-weight: 600;
}

.detail-value {
    color: #e0e0e0;
}

.about-image {
    position: relative;
}

.image-container {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(138, 43, 226, 0.2);
}

/* FIX: Make workspace image responsive */
.workspace-img {
    width: 100%;
    height: auto; /* Let the height adjust automatically */
    object-fit: contain; /* Ensure the whole image is visible */
    display: block; /* Remove any extra space below the image */
    transition: transform 0.3s ease;
}

.image-container:hover .workspace-img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.1), rgba(221, 160, 221, 0.1));
    transition: opacity 0.3s ease;
}

/* Skills Section */
.skills {
    background: #0a0a0a;
}

.skills-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.skill-category {
    background: rgba(26, 26, 26, 0.5);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid #2d2d2d;
}

.category-title {
    color: #8a2be2;
    margin-bottom: 2rem;
    text-align: center;
}

.skill-item {
    margin-bottom: 1.5rem;
}

.skill-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.skill-name {
    font-weight: 600;
    color: #ffffff;
}

.skill-percentage {
    color: #8a2be2;
    font-weight: 600;
}

.skill-bar {
    height: 8px;
    background: #2d2d2d;
    border-radius: 4px;
    overflow: hidden;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, #8a2be2, #dda0dd);
    border-radius: 4px;
    width: 0;
    transition: width 1s ease;
}

.tech-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.tech-item {
    text-align: center;
    padding: 1.5rem;
    background: rgba(45, 45, 45, 0.3);
    border-radius: 10px;
    border: 1px solid #2d2d2d;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tech-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(138, 43, 226, 0.2);
    border-color: #8a2be2;
}

.tech-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #8a2be2, #dda0dd);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.icon-text {
    color: #ffffff;
}

.tech-name {
    display: block;
    color: #e0e0e0;
    font-size: 0.9rem;
}

/* Projects Section */
.projects {
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
}

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

.project-card {
    background: rgba(26, 26, 26, 0.8);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid #2d2d2d;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(138, 43, 226, 0.2);
    border-color: #8a2be2;
}

.project-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-img {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(138, 43, 226, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.9);
    color: #8a2be2;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.project-link:hover {
    background: #ffffff;
    transform: translateY(-2px);
}

.project-content {
    padding: 1.5rem;
    flex-grow: 1; /* Allows content to fill available space */
    display: flex;
    flex-direction: column;
}

.project-title {
    color: #ffffff;
    margin-bottom: 1rem;
}

.project-description {
    color: #b0b0b0;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex-grow: 1;
}

.project-tech {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: auto; /* Pushes tags to the bottom */
}

.tech-tag {
    padding: 4px 12px;
    background: rgba(138, 43, 226, 0.2);
    color: #8a2be2;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Contact Section */
.contact {
    background: #0a0a0a;
}

.contact-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    max-width: 600px;
}

.contact-item-link {
    text-decoration: none;
    color: inherit;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(26, 26, 26, 0.5);
    border-radius: 10px;
    border: 1px solid #2d2d2d;
    transition: all 0.3s ease;
}

.contact-item:hover {
    border-color: #8a2be2;
    transform: translateY(-2px);
}

.contact-icon {
    font-size: 2rem;
    min-width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #8a2be2, #dda0dd);
    border-radius: 50%;
}

.contact-details h3 {
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.contact-details p {
    color: #b0b0b0;
    word-break: break-word;
}

/* Footer */
.footer {
    background: #1a1a1a;
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid #2d2d2d;
}

.footer-text {
    color: #e0e0e0;
    margin-bottom: 0.5rem;
}

.footer-subtext {
    color: #8a2be2;
    font-size: 0.9rem;
}

/* Particles Canvas */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}


/* ---------------------------------- */
/* -- RESPONSIVE DESIGN STARTS HERE -- */
/* ---------------------------------- */

/* Medium devices (tablets, less than 992px) */
@media (max-width: 992px) {
    .container {
        padding: 0 1.5rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }
}

/* Small devices (landscape phones, less than 768px) */
@media (max-width: 768px) {
    html {
        font-size: 15px; /* Adjust base font size */
    }

    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%; /* Start off-screen */
        top: 0;
        height: 100vh;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        background-color: rgba(10, 10, 10, 0.98);
        width: 100%;
        text-align: center;
        transition: left 0.3s ease-in-out;
        padding: 2rem 0;
        backdrop-filter: blur(10px);
    }
    
    .nav-menu.active {
        left: 0; /* Slide in */
    }
    
    .nav-item {
        margin: 1.5rem 0;
    }

    .hero-title {
        font-size: 3rem;
    }
    
    .hero-subtitle {
        font-size: 1.3rem;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }

    .about-image {
        grid-row: 1; /* Move image to the top on mobile */
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .tech-grid {
        grid-template-columns: 1fr 1fr; /* Two columns for tech items */
    }

    .contact-item {
        flex-direction: column;
        text-align: center;
    }
}

/* Extra small devices (portrait phones, less than 576px) */
@media (max-width: 576px) {
    html {
        font-size: 14px;
    }

    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 2rem;
    }
    
    .container {
        padding: 0 1rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .tech-grid {
        grid-template-columns: 1fr; /* Single column for smallest screens */
    }

    .skill-category {
        padding: 1.5rem;
    }
}


/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}