/* Basic Reset & Global Styles */
:root {
    --primary-color: #00bcd4; /* Teal/Cyan */
    --secondary-color: #81d4fa; /* Lighter Blue */
    --text-color: #e0e0e0; /* Light Grey for body text */
    --heading-color: #ffffff; /* White for headings */
    --background-dark: #1a202c; /* Dark Blue-Grey */
    --background-light: #2d3748; /* Slightly lighter Dark Blue-Grey */
    --card-background: #2a3340; /* Even lighter for cards */
    --border-color: #4a5568; /* Grey for borders */
    --accent-glow: rgba(0, 188, 212, 0.4); /* Glow effect color */
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-dark);
    overflow-x: hidden; /* Prevent horizontal scroll due to animations */
    position: relative; /* For particle.js positioning */
}

/* Particle.js Background */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0; /* Ensure it's behind other content */
    opacity: 0.5; /* Make it subtle */
}

/* Layout Containers */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative; /* For z-index of content */
    z-index: 1; /* Content above particles */
}

.section-padding {
    padding: 80px 0;
    position: relative;
    overflow: hidden; /* For reveal animations */
}

.bg-light {
    background-color: var(--background-light);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    color: var(--heading-color);
    margin-bottom: 20px;
    font-weight: 700;
}

h1 {
    font-size: 3.5em;
    text-shadow: 0 0 15px var(--accent-glow);
}

h2 {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    padding-bottom: 10px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

h3 {
    font-size: 1.8em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

p {
    margin-bottom: 15px;
    font-size: 1.1em;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

ul {
    list-style: none;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--background-dark);
    box-shadow: 0 5px 15px var(--accent-glow);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px var(--accent-glow);
}

/* Navbar */
.navbar {
    background-color: rgba(26, 32, 44, 0.9); /* Semi-transparent dark */
    padding: 15px 0;
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px); /* Frosty glass effect */
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .brand {
    color: var(--heading-color);
    font-size: 1.8em;
    font-weight: 700;
}

.navbar .nav-links {
    display: flex;
    gap: 30px;
}

.navbar .nav-links li a {
    color: var(--heading-color);
    font-size: 1.1em;
    font-weight: 600;
    position: relative;
    padding-bottom: 5px;
}

.navbar .nav-links li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    background-color: var(--primary-color);
    bottom: 0;
    left: 0;
    transition: width 0.3s ease;
}

.navbar .nav-links li a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none; /* Hidden on desktop */
    color: var(--heading-color);
    font-size: 1.8em;
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 80px; /* Account for fixed navbar */
}

.hero-content {
    animation: fadeIn 2s ease-out;
}

.profile-pic {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--primary-color);
    box-shadow: 0 0 20px var(--accent-glow);
    margin-bottom: 30px;
    transition: transform 0.3s ease;
}

.profile-pic:hover {
    transform: scale(1.05);
}

.tagline {
    font-size: 1.8em;
    margin-top: 10px;
    font-family: 'Roboto Mono', monospace; /* Monospace for code-like feel */
    color: var(--secondary-color);
    height: 1.2em; /* Ensure consistent height for typing effect */
    overflow: hidden;
}

.typing-text {
    border-right: 2px solid var(--primary-color); /* Blinking cursor */
    white-space: nowrap;
    overflow: hidden;
    display: inline-block;
    vertical-align: bottom; /* Align with cursor */
    animation: blink-caret 0.75s step-end infinite;
}

/* Typing animation */
@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

/* Blinking cursor animation */
@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--primary-color); }
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.about-text p {
    text-align: justify;
}

.about-attributes ul {
    margin-top: 10px;
}

.about-attributes li {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    font-size: 1.05em;
}

.about-attributes li i {
    color: var(--primary-color);
    margin-right: 10px;
    font-size: 1.2em;
    margin-top: 3px;
}

.weakness-box {
    background-color: var(--card-background);
    border-left: 5px solid #ef4444; /* Red border for weakness */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.weakness-box h3 {
    color: #ef4444; /* Red heading */
    margin-bottom: 10px;
}
.weakness-box p i {
    color: #ef4444;
    margin-right: 10px;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.skill-category {
    background-color: var(--card-background);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.skill-category h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.skill-category h3 i {
    font-size: 1.5em;
    color: var(--secondary-color);
}

.skill-category ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-category li {
    background-color: rgba(0, 188, 212, 0.15); /* Light primary tint */
    color: var(--primary-color);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.95em;
    font-weight: 600;
    border: 1px solid var(--primary-color);
}

/* Timeline (Experience & Education) */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--border-color);
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.timeline-item {
    padding: 10px 0;
    position: relative;
    width: 50%;
    margin-bottom: 40px;
}

.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 60px;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 60px;
}

.timeline-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 50%;
    top: 25px; /* Adjust to vertically align with content */
    z-index: 1;
    border: 3px solid var(--background-dark);
    box-shadow: 0 0 10px var(--accent-glow);
}

.timeline-item:nth-child(odd) .timeline-dot {
    right: -10px; /* Position on the right side of the odd item */
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -10px; /* Position on the left side of the even item */
}

.timeline-date {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.timeline-content {
    background-color: var(--card-background);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.timeline-content h3 {
    margin-bottom: 5px;
    font-size: 1.5em;
}

.timeline-content p {
    font-size: 1em;
    margin-bottom: 0;
}


/* Contact Section */
.contact-info {
    text-align: center;
    margin-bottom: 50px;
}

.contact-info p {
    font-size: 1.2em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.contact-info p i {
    color: var(--primary-color);
    font-size: 1.3em;
}

.contact-form-container {
    background-color: var(--card-background);
    padding: 40px;
    border-radius: 10px;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.contact-form-container h3 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--secondary-color);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--background-dark);
    color: var(--text-color);
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.contact-form .btn {
    width: 100%;
    margin-top: 20px;
}

.form-note {
    font-size: 0.9em;
    color: var(--border-color);
    text-align: center;
    margin-top: 20px;
}

/* Footer */
.footer {
    background-color: var(--background-dark);
    color: var(--border-color);
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.95em;
}

/* Animation Classes (JS controlled) */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Specific delays for staggered animation */
.hero-content .reveal:nth-child(1) { transition-delay: 0.1s; }
.hero-content .reveal:nth-child(2) { transition-delay: 0.2s; }
.hero-content .reveal:nth-child(3) { transition-delay: 0.3s; }
.hero-content .reveal:nth-child(4) { transition-delay: 0.4s; }

/* Responsive Design */
@media (max-width: 900px) {
    .timeline::before {
        left: 20px;
        transform: translateX(0);
    }
    .timeline-item {
        width: 100%;
        padding-left: 60px;
        text-align: left;
    }
    .timeline-item:nth-child(odd) {
        padding-right: 0;
    }
    .timeline-item:nth-child(even) {
        left: 0;
    }
    .timeline-item .timeline-dot {
        left: 10px;
        transform: translateX(-50%);
    }
    .timeline-item:nth-child(odd) .timeline-dot {
        right: auto;
    }
    .contact-info p {
        flex-direction: column;
        gap: 5px;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .navbar .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: rgba(26, 32, 44, 0.95);
        position: absolute;
        top: 60px; /* Adjust based on navbar height */
        left: 0;
        padding: 20px 0;
        border-top: 1px solid var(--border-color);
    }
    .navbar .nav-links.active {
        display: flex;
    }
    .navbar .nav-links li {
        text-align: center;
        margin: 10px 0;
    }
    .menu-toggle {
        display: block;
    }

    h1 {
        font-size: 2.8em;
    }
    h2 {
        font-size: 2em;
    }
    .tagline {
        font-size: 1.5em;
    }

    .about-content, .skills-grid {
        grid-template-columns: 1fr;
    }

    .profile-pic {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2.2em;
    }
    h2 {
        font-size: 1.8em;
    }
    .tagline {
        font-size: 1.2em;
    }
    .section-padding {
        padding: 60px 0;
    }
    .contact-form-container {
        padding: 25px;
    }
}