/* ===================================
   GLOBAL STYLES
   =================================== */

/* Reset default browser styles for consistent appearance across browsers */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Makes width/height include padding and border */
}

/* Base body styles - sets up the foundation for the entire page */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6; /* Comfortable reading spacing between lines */
    color: #2c3e50; /* Dark blue-gray text color */
    background: #f8fafc; /* Light gray background */
    min-height: 100vh; /* Ensures body is at least full viewport height */
}

/* Container class - centers content and adds horizontal padding */
.container {
    max-width: 1200px; /* Prevents content from getting too wide on large screens */
    margin: 0 auto; /* Centers the container horizontally */
    padding: 0 20px; /* Adds breathing room on the sides */
}

/* ===================================
   HEADER & NAVIGATION
   =================================== */

/* Fixed header that stays at the top when scrolling */
header {
    background: rgba(255, 255, 255, 0.98); /* Almost opaque white background */
    backdrop-filter: blur(10px); /* Blurs content behind the header (glassmorphism effect) */
    position: fixed; /* Stays fixed at the top when scrolling */
    top: 0;
    width: 100%;
    z-index: 1000; /* Ensures header stays on top of other content */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    border-bottom: 1px solid #e2e8f0; /* Light border at bottom */
}

/* Navigation container - holds logo and nav links */
nav {
    display: flex;
    justify-content: space-between; /* Logo on left, links on right */
    align-items: center; /* Vertically centers items */
    padding: 1rem 0;
}

/* Logo/Brand name styling */
.logo {
    font-size: 1.5rem;
    font-weight: 700; /* Bold */
    color: #1e40af; /* Blue color matching the theme */
    letter-spacing: -0.025em; /* Slightly tighter letter spacing for modern look */
}

/* Navigation links container */
.nav-links {
    display: flex;
    list-style: none; /* Removes bullet points */
    gap: 2rem; /* Space between navigation items */
}

/* Individual navigation link styling */
.nav-links a {
    text-decoration: none; /* Removes underline */
    color: #64748b; /* Gray color for links */
    font-weight: 500; /* Medium weight */
    font-size: 0.95rem;
    transition: color 0.3s ease; /* Smooth color change on hover */
    letter-spacing: -0.01em;
}

/* Hover and active state for navigation links */
.nav-links a:hover,
.nav-links a.active {
    color: #1e40af; /* Changes to blue on hover/active */
}

/* ===================================
   HERO SECTION (Landing Page)
   =================================== */

/* Main hero section with animated gradient background */
.hero {
    height: 100vh; /* Full viewport height */
    display: flex;
    align-items: center; /* Centers content vertically */
    justify-content: center; /* Centers content horizontally */
    text-align: center;
    position: relative; /* For absolutely positioned children */
    overflow: hidden; /* Hides overflow from animations */
    /* Vibrant gradient background from pink to purple to blue */
    background: linear-gradient(135deg, #d946ef 0%, #ec4899 25%, #8b5cf6 50%, #6366f1 75%, #3b82f6 100%);
    color: white;
}

/* Animated gradient overlay that shifts opacity for visual interest */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Semi-transparent gradient overlay */
    background: linear-gradient(45deg, 
        rgba(217, 70, 239, 0.3) 0%,
        rgba(236, 72, 153, 0.3) 25%,
        rgba(139, 92, 246, 0.3) 50%,
        rgba(99, 102, 241, 0.3) 75%,
        rgba(59, 130, 246, 0.3) 100%);
    animation: gradientShift 15s ease infinite; /* Smooth infinite animation */
    z-index: 1; /* Above background, below content */
}

/* Canvas element for binary code animation effect */
#binaryCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2; /* Above gradient overlay, below text content */
}

/* Container for hero text and image */
.hero-content {
    position: relative;
    z-index: 3; /* On top of all backgrounds */
    max-width: 800px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Profile image styling with animation */
.profile-image {
    width: 180px;
    height: 180px;
    border-radius: 50%; /* Makes image circular */
    border: 6px solid rgba(255, 255, 255, 0.4); /* Semi-transparent white border */
    margin-bottom: 2rem;
    object-fit: cover; /* Ensures image covers the area without distortion */
    box-shadow: 0 20px 40px rgba(217, 70, 239, 0.3); /* Pink shadow for depth */
    opacity: 0; /* Starts invisible */
    animation: fadeInUp 1s ease 0.2s forwards; /* Fades in from bottom with delay */
}

/* Main heading in hero section */
.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0; /* Starts invisible */
    animation: fadeInUp 1s ease 0.5s forwards; /* Fades in after profile image */
    font-weight: 700;
    letter-spacing: -0.02em; /* Tight letter spacing for modern look */
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); /* Subtle shadow for depth */
}

/* Subtitle text in hero section */
.hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0; /* Starts invisible */
    animation: fadeInUp 1s ease 0.8s forwards; /* Fades in after heading */
    color: rgba(255, 255, 255, 0.95);
    font-weight: 400;
}

/* Call-to-action button styling */
.cta-button {
    display: inline-block;
    padding: 14px 32px;
    background: rgba(255, 255, 255, 0.2); /* Semi-transparent white background */
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.025em;
    border: 2px solid rgba(255, 255, 255, 0.4); /* Semi-transparent border */
    transition: all 0.3s ease; /* Smooth transition for all properties */
    opacity: 0; /* Starts invisible */
    animation: fadeInUp 1s ease 1.1s forwards; /* Fades in last */
    backdrop-filter: blur(10px); /* Glassmorphism effect */
}

/* CTA button hover state */
.cta-button:hover {
    background: rgba(255, 255, 255, 0.3); /* Slightly more opaque on hover */
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px); /* Lifts button slightly */
    box-shadow: 0 10px 30px rgba(217, 70, 239, 0.3); /* Enhanced shadow on hover */
}

/* ===================================
   SECTION STYLES
   =================================== */

/* General padding for all sections */
section {
    padding: 6rem 0;
}

/* Alternating background color for sections */
.section-bg {
    background: white;
}

/* Section heading style */
h2 {
    text-align: center;
    font-size: 2.75rem;
    margin-bottom: 4rem;
    color: #1e293b; /* Dark blue-gray */
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* ===================================
   ABOUT SECTION
   =================================== */

/* About section layout - sidebar with stats and main content */
.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr; /* Sidebar takes 1/3, content takes 2/3 */
    gap: 3rem; /* Space between columns */
    align-items: center;
}

/* Grid layout for stat cards */
.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns of equal width */
    gap: 2rem;
}

/* Individual stat card styling */
.stat-card {
    background: linear-gradient(135deg, #1e40af, #3b82f6); /* Blue gradient */
    color: white;
    padding: 2.5rem 2rem;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth hover effect */
    box-shadow: 0 4px 20px rgba(30, 64, 175, 0.15); /* Blue shadow */
}

/* Stat card hover effect */
.stat-card:hover {
    transform: translateY(-8px); /* Lifts card on hover */
    box-shadow: 0 8px 30px rgba(30, 64, 175, 0.25); /* Enhanced shadow */
}

/* Large number in stat card */
.stat-card h3 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

/* Label text in stat card */
.stat-card p {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.9; /* Slightly transparent */
}

/* ===================================
   SKILLS SECTION - FIXED TO STAY IN ONE ROW
   =================================== */

/* 
   Skills grid layout - FIXED VERSION
   Instead of using auto-fit (which wraps cards), we use a fixed 4-column layout
   This ensures all 4 skill cards stay in one row on larger screens
*/
.skills-grid {
    display: grid;
    /* CHANGED: From repeat(auto-fit, minmax(300px, 1fr)) to repeat(4, 1fr) */
    /* This creates exactly 4 equal-width columns that stay in one row */
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem; /* Space between cards */
    margin-top: 3rem;
    width: 100%; /* Ensures grid takes full container width */
}

/* Individual skill category card */
.skill-category {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08); /* Soft shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth hover effect */
    border: 1px solid #f1f5f9; /* Very light border */
}

/* Skill category card hover effect */
.skill-category:hover {
    transform: translateY(-5px); /* Lifts card on hover */
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.12); /* Enhanced shadow on hover */
}

/* Skill category heading */
.skill-category h3 {
    color: #1e40af; /* Blue color */
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 600;
}

/* Container for skill tags */
.skill-tags {
    display: flex;
    flex-wrap: wrap; /* Allows tags to wrap to next line if needed */
    gap: 0.5rem; /* Space between tags */
}

/* Individual skill tag (badge style) */
.skill-tag {
    background: #eff6ff; /* Light blue background */
    color: #1e40af; /* Blue text */
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid #dbeafe; /* Light blue border */
}

/* ===================================
   PROJECTS SECTION
   =================================== */

/* Projects grid - allows flexible number of columns based on screen size */
.projects-grid {
    display: grid;
    /* Creates as many columns as will fit, minimum 350px wide each */
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

/* Individual project card */
.project-card {
    background: white;
    border-radius: 12px;
    overflow: hidden; /* Ensures rounded corners work with child elements */
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f1f5f9;
}

/* Project card hover effect */
.project-card:hover {
    transform: translateY(-8px); /* Lifts card on hover */
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.15);
}

/* Project header with gradient background */
.project-header {
    background: linear-gradient(135deg, #1e40af, #3b82f6); /* Blue gradient */
    color: white;
    padding: 2rem;
}

/* Project title */
.project-header h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Project subtitle/description */
.project-header p {
    opacity: 0.9;
    font-size: 0.95rem;
}

/* Project content area (below header) */
.project-content {
    padding: 2rem;
}

/* Project description text */
.project-content p {
    color: #64748b; /* Gray text */
    line-height: 1.7; /* Comfortable reading spacing */
    margin-bottom: 1.5rem;
}

/* Container for technology tags */
.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Individual technology tag */
.tech-tag {
    background: #f8fafc; /* Very light gray */
    color: #475569; /* Dark gray text */
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #e2e8f0;
}

/* ===================================
   EXPERIENCE SECTION (Timeline)
   =================================== */

/* Container for timeline */
.experience-timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto; /* Centers timeline */
}

/* Individual timeline item */
.timeline-item {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    margin-left: 2rem; /* Space for timeline dot */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f1f5f9;
}

/* Timeline item hover effect */
.timeline-item:hover {
    transform: translateX(8px); /* Slides right on hover */
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.12);
}

/* Timeline dot (blue circle on the left) */
.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem; /* Positioned to the left of the card */
    top: 2.5rem;
    width: 14px;
    height: 14px;
    background: #1e40af; /* Blue dot */
    border-radius: 50%; /* Makes it circular */
    border: 3px solid white; /* White border around dot */
    box-shadow: 0 0 0 3px #1e40af; /* Blue outer ring */
}

/* Job title in timeline */
.timeline-item h3 {
    color: #1e40af;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Company name */
.timeline-item .company {
    color: #64748b;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

/* Date range */
.timeline-item .date {
    color: #94a3b8; /* Light gray */
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* Job description text */
.timeline-item p {
    color: #64748b;
    line-height: 1.7;
}

/* ===================================
   CONTACT SECTION
   =================================== */

/* Contact content container */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

/* Contact info grid */
.contact-info {
    display: grid;
    /* Creates flexible columns, minimum 200px each */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

/* Individual contact info card */
.contact-item {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f1f5f9;
}

/* Contact item hover effect */
.contact-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.12);
}

/* Contact item heading */
.contact-item h3 {
    color: #1e40af;
    margin-bottom: 1rem;
    font-weight: 600;
}

/* Contact info text */
.contact-item p {
    color: #64748b;
    font-weight: 500;
}

/* ===================================
   FOOTER
   =================================== */

footer {
    background: #1e293b; /* Dark blue-gray */
    color: #94a3b8; /* Light gray text */
    text-align: center;
    padding: 3rem 0;
    font-size: 0.95rem;
}

/* ===================================
   ANIMATIONS
   =================================== */

/* Fade in from bottom animation - used throughout the site */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px); /* Starts 30px below final position */
    }
    to {
        opacity: 1;
        transform: translateY(0); /* Ends at normal position */
    }
}

/* Gradient shift animation for hero section overlay */
@keyframes gradientShift {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8; /* Slightly fades out in the middle */
    }
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

/* Tablet-sized screens (1200px and below) */
@media (max-width: 1200px) {
    /* Skills grid: Switch to 2 columns on medium screens */
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile-sized screens (768px and below) */
@media (max-width: 768px) {
    /* Hide navigation links on mobile (would need hamburger menu) */
    .nav-links {
        display: none;
    }

    /* Reduce hero heading size on mobile */
    .hero h1 {
        font-size: 2.5rem;
    }

    /* Reduce hero subtitle size on mobile */
    .hero p {
        font-size: 1.1rem;
    }

    /* About section: Stack vertically on mobile */
    .about-content {
        grid-template-columns: 1fr; /* Single column */
        text-align: center;
    }

    /* About stats: Single column on mobile */
    .about-stats {
        grid-template-columns: 1fr;
    }

    /* Skills and projects: Single column on mobile */
    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    /* Timeline: Reduce left margin on mobile */
    .timeline-item {
        margin-left: 1rem;
    }
}

/* ===================================
   SCROLL ANIMATIONS
   =================================== */

/* Initial state for elements that fade in on scroll */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Visible state (triggered by JavaScript when element is in view) */
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}