/* --- Basic Setup & Variables --- */
:root {
    --bg-color: #121212;
    --primary-text-color: #FFFFFF;
    --secondary-text-color: #CCCCCC;
    --accent-color: #B155E8;
    --accent-color-dark: #8E44AD;
    --stats-bg-color: #1D1D1F;
    --glow-color: rgba(177, 85, 232, 0.4);
    --card-bg-color: #1e1e1e;
    --border-color: #333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    /* New Gradient Background */
    background: linear-gradient(300deg, #121212, #1d1220, #121212);
    background-size: 180% 180%;
    animation: gradient-animation 18s ease infinite;
    color: var(--primary-text-color);
    overflow-x: hidden;
}

/* New Keyframe Animation for Background */
@keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}


a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

/* --- Header / Navbar --- */
header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1.5rem 5%;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(10px);
    transition: top 0.3s;
}

nav ul {
    display: flex;
    gap: 2rem;
}

nav a {
    font-weight: 500;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--accent-color);
}


/* --- Hero Section --- */
.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3rem 5%;
    min-height: 100vh;
}

.hero-text {
    max-width: 50%;
}

.hero-text h1 {
    font-size: 2.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.wave {
    display: inline-block;
    animation: wave-animation 2.5s infinite;
    transform-origin: 70% 70%;
}

@keyframes wave-animation {
    0% { transform: rotate(0.0deg) }
    10% { transform: rotate(14.0deg) }
    20% { transform: rotate(-8.0deg) }
    30% { transform: rotate(14.0deg) }
    40% { transform: rotate(-4.0deg) }
    50% { transform: rotate(10.0deg) }
    60% { transform: rotate(0.0deg) }
    100% { transform: rotate(0.0deg) }
}

.accent-text {
    color: var(--accent-color);
    font-weight: 700;
}

/* Updated Name Style for Typing Animation */
.hero-text .name {
    font-family: 'Special Elite', monospace;
    font-size: 4.5rem;
    font-weight: 700;
    color: var(--primary-text-color);
    line-height: 1.2;
    margin-bottom: 1rem;
    /* Properties for typing animation */
    display: inline-block;
    overflow: hidden; 
    border-right: .15em solid var(--accent-color); 
    white-space: nowrap; 
    letter-spacing: .1em;
    width: 0; /* Start with no width */
    /* Only the cursor blinks initially */
    animation: blink-caret .75s step-end infinite;
}

/* This class is added via JS to start the typing animation */
.hero-text .name.animate {
    animation: 
        typing 3s steps(12, end) forwards,
        blink-caret .75s step-end infinite;
}

/* The typing effect */
@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

/* The typewriter cursor effect */
@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: var(--accent-color); }
}


.hero-text p {
    font-size: 1.1rem;
    color: var(--secondary-text-color);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn.resume-btn {
    /* Updated button with gradient */
    background: linear-gradient(45deg, var(--accent-color), var(--accent-color-dark));
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
    color: white;
}

.btn.resume-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(177, 85, 232, 0.3);
}

.social-icon {
    font-size: 1.2rem;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    background: transparent;
}

.social-icon:hover {
    /* Updated social icon with gradient */
    background: linear-gradient(45deg, var(--accent-color), var(--accent-color-dark));
    color: white;
    border-color: transparent;
}

.hero-image {
    max-width: 40%;
    position: relative; /* Needed for pseudo-element */
}

.hero-image img {
    width: 100%;
    max-width: 380px;
    border-radius: 50%;
    position: relative;
    z-index: 2;
}

/* Enhanced glow effect with radial gradient */
.hero-image::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(177, 85, 232, 0.4) 0%, rgba(177, 85, 232, 0) 70%);
    border-radius: 50%;
    z-index: 1;
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% {
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0.7;
    }
    70% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0.7;
    }
}


/* --- Stats Section --- */
.stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: var(--stats-bg-color);
    padding: 2rem 5%;
    border-radius: 12px;
    margin: 0 5% 5rem 5%;
    border: 1px solid #2a2a2a;
}

.stat-item {
    text-align: center;
}

.stat-item h3 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-item p {
    font-size: 1rem;
    color: var(--secondary-text-color);
}

/* --- General Content Section Styling --- */
.content-section {
    padding: 5rem 5%;
    max-width: 1000px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    color: var(--primary-text-color);
}

.section-title::after {
    content: '';
    display: block;
    width: 70px;
    height: 4px;
    background: var(--accent-color);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

.section-subtitle {
    text-align: center;
    color: var(--secondary-text-color);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

/* --- About Section --- */
.about-content p {
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--secondary-text-color);
}

/* --- Tech Stack Section --- */
.tech-icons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.tech-card {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    width: 130px;
    height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tech-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px var(--glow-color);
}

.tech-card i {
    font-size: 3.5rem;
    color: var(--accent-color);
}

.tech-card p {
    color: var(--secondary-text-color);
    font-weight: 500;
}


/* --- Experience & Education Timeline --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 2rem;
    border-left: 3px solid var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
}

.timeline-dot {
    position: absolute;
    left: -43px;
    top: 5px;
    width: 15px;
    height: 15px;
    background-color: var(--accent-color);
    border-radius: 50%;
    border: 3px solid var(--bg-color);
}

.timeline-content h3 {
    font-size: 1.5rem;
    color: var(--primary-text-color);
    margin-bottom: 0.25rem;
}

.timeline-date {
    color: var(--accent-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.timeline-subtitle {
    color: var(--secondary-text-color);
    font-style: italic;
    margin-bottom: 1rem;
}

.timeline-content ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    color: var(--secondary-text-color);
}

.timeline-content ul li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* --- Certifications Section --- */
.subsection-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 600;
    margin-top: 4rem;
    margin-bottom: 2rem;
    color: var(--primary-text-color);
}

.cert-scroller {
    width: 100%;
    overflow: hidden;
    -webkit-mask: linear-gradient(90deg, transparent, white 20%, white 80%, transparent);
    mask: linear-gradient(90deg, transparent, white 20%, white 80%, transparent);
}

.cert-track {
    display: flex;
    gap: 1.5rem;
    padding-block: 1rem;
    width: max-content;
    animation: scroll 40s linear infinite;
}

.cert-scroller:hover .cert-track {
    animation-play-state: paused;
}

@keyframes scroll {
    to {
        transform: translateX(calc(-50% - 0.75rem * 8));
    }
}

.cert-card {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.3s ease;
}

.cert-card:hover {
    transform: translateY(-5px);
}

.cert-card h4 {
    color: var(--primary-text-color);
    font-size: 1.1rem;
}

.cert-card p {
    color: var(--accent-color);
    font-weight: 500;
}

.cert-card span {
    color: var(--secondary-text-color);
    font-size: 0.9rem;
}


/* --- Contact Section --- */
.contact-subtitle {
    text-align: center;
    color: var(--secondary-text-color);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 700px;
    margin: 0 auto;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg-color);
    color: var(--primary-text-color);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px var(--glow-color);
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem 5%;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
    color: var(--secondary-text-color);
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .hero {
        flex-direction: column-reverse;
        text-align: center;
        padding-top: 120px;
    }

    .hero-text {
        max-width: 100%;
        margin-top: 3rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-image img {
        max-width: 300px;
    }

    .hero-text .name {
        font-size: 3rem; /* Adjust font size for smaller screens */
    }
}

@media (max-width: 768px) {
    .stats {
        flex-direction: column;
        gap: 2rem;
    }
    
    .hero-text h1 {
        font-size: 2rem;
    }

    .hero-text .name {
        font-size: 2.5rem; /* Further adjust font size */
    }
    
    header {
        padding: 1rem 5%;
    }

    nav ul {
        gap: 1.5rem;
    }
}
