/* --- CSS VARIABLES & RESET --- */
:root {
    --primary-color: #2563eb;
    /* Professional Blue */
    --dark-bg: #111827;
    --light-bg: #f3f4f6;
    --text-dark: #1f2937;
    --text-light: #9ca3af;
    --white: #ffffff;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-bg);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* --- LAYOUT UTILITIES --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 80px 0;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
    color: var(--dark-bg);
    position: relative;
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

/* --- NAVIGATION --- */
/* Hide the hamburger menu on PC */
.menu-icon {
    display: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    margin-right: 15px;
    /* Space between icon and logo */
}

.navbar {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar .container {
    max-width: 100%;
    margin: 0;
    padding-left: 20px;
    padding-right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    position: relative;
    font-weight: 500;
    color: #000000;
    text-decoration: none;
    transition: color 0.3s ease;
    padding-bottom: 5px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a:hover::after {
    transform: scaleX(1);
}

/* --- HERO SECTION --- */
/* --- HERO SECTION WITH FLOATING ICONS --- */
.hero {
    height: 100vh;
    /* Dark gradient background */
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #2828ae 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    text-align: center;
    padding-top: 70px;

    /* IMPORTANT: This keeps the floating icons inside the hero box */
    position: relative;
    overflow: hidden;
}

/* Container for the background icons */
.floating-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Allows you to click text 'through' the icons */
    z-index: 0;
    /* Puts icons BEHIND the text */
}

/* Common style for all floating icons */
.floating-bg i {
    position: absolute;
    color: rgba(255, 255, 255, 0.5);
    /* Very faint white (ghostly effect) */
    font-size: 3rem;
    /* Size of the icons */
    opacity: 0;
    /* Start invisible */
    animation: floatRight linear infinite;
    /* The movement logic */
}

/* --- THE ANIMATION LOGIC --- */
@keyframes floatRight {
    0% {
        transform: translateX(-100px) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.1;
        /* Fade in */
    }

    90% {
        opacity: 0.1;
        /* Stay visible */
    }

    100% {
        /* Move to the right side of screen + spin */
        transform: translateX(100vw) rotate(360deg);
        opacity: 0;
        /* Fade out */
    }
}

/* --- RANDOMIZING THE ICONS --- */
/* We set different speeds and positions for each icon so it looks natural */

/* Icon 1: Code Symbol */
.floating-bg i:nth-child(1) {
    top: 15%;
    left: -100px;
    animation-duration: 15s;
    animation-delay: 0s;
}

/* Icon 2: Laptop */
.floating-bg i:nth-child(2) {
    top: 70%;
    left: -100px;
    font-size: 4rem;
    animation-duration: 25s;
    animation-delay: 5s;
}

/* Icon 3: Microchip */
.floating-bg i:nth-child(3) {
    top: 40%;
    left: -100px;
    animation-duration: 18s;
    animation-delay: 2s;
}

/* Icon 4: Network */
.floating-bg i:nth-child(4) {
    top: 85%;
    left: -100px;
    animation-duration: 22s;
    animation-delay: 8s;
}

/* Icon 5: Bug */
.floating-bg i:nth-child(5) {
    top: 10%;
    left: -100px;
    font-size: 2rem;
    animation-duration: 30s;
    animation-delay: 12s;
}

/* Icon 6: Python */
.floating-bg i:nth-child(6) {
    top: 60%;
    left: -100px;
    animation-duration: 20s;
    animation-delay: 15s;
}

/* Icon 7: Terminal */
.floating-bg i:nth-child(7) {
    top: 30%;
    left: -100px;
    animation-duration: 12s;
    animation-delay: 7s;
}

/* Icon 8: Database */
.floating-bg i:nth-child(8) {
    top: 50%;
    left: -100px;
    animation-duration: 28s;
    animation-delay: 1s;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: 600;
    transition: var(--transition);
}

.btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
    /* Add glow on hover */
}

/* Small Button Variant for Timeline */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
    margin-right: 10px;
    margin-top: 15px;
    border: 1px solid var(--primary-color);
    /* Add border */
}

.btn-sm:hover {
    background: transparent;
    color: var(--primary-color);
    box-shadow: none;
    /* Reset shadow for outline style */
    transform: translateY(-2px);
}

/* --- ABOUT ME --- */
.about-content {
    display: flex;
    gap: 50px;
    align-items: center;
    flex-wrap: wrap;
}

.about-text {
    flex: 1;
}

.about-text p {
    margin-bottom: 15px;
    color: #4b5563;
}

/* --- SKILLS --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.skill-card {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.skill-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.skill-card h3 {
    font-size: 1.1rem;
}

/* --- EXPERIENCE --- */
.experience {
    background: var(--white);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline-item {
    padding: 20px 30px;
    background: var(--light-bg);
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
    position: relative;
    transition: var(--transition);
    /* Smooth transition */
}

/* Hover effect for timeline items */
.timeline-item:hover {
    background: var(--white);
    transform: translateX(5px);
    /* Gentle slide right */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.timeline-date {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 5px;
}

.timeline-title {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.timeline-company {
    font-style: italic;
    color: #6b7280;
    margin-bottom: 10px;
}

/* --- FOOTER / CONTACT / PROFILES --- */
.footer {
    background: var(--dark-bg);
    color: var(--white);
    text-align: center;
    padding: 60px 0;
}

.footer h2 {
    color: var(--white);
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 30px;
}

.social-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--white);
    transition: var(--transition);
}

/* 1. For Computers (Mouse Hover) */
@media (hover: hover) {
    .social-icon:hover {
        background: var(--primary-color);
        transform: scale(1.1);
    }
}

/* 2. For Mobiles (Touch Click) */
/* This makes it flash blue only while your finger is pressing it */
.social-icon:active {
    background: var(--primary-color);
    transform: scale(0.95);
    /* Adds a nice little 'click' press effect */
}

.footer-text {
    margin-top: 40px;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Responsive Design */
/* =========================================
   MOBILE RESPONSIVENESS (Max-Width: 768px)
   ========================================= */
@media (max-width: 768px) {

    /* 1. Navbar Layout */
    .navbar .container {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        padding: 15px 20px;
        height: 70px;
    }

    /* 2. The Hamburger Icon */
    .menu-icon {
        display: block;
        z-index: 1001;
        /* Ensure it stays on top */
        transition: transform 0.4s ease;
        /* Smooth rotation */
    }

    /* ROTATE ANIMATION: When active, rotate 90 degrees */
    .menu-icon.active i {
        transform: rotate(90deg);
        color: var(--primary-color);
    }

    /* 3. The Menu (Hidden State) */
    .nav-links {
        /* We use max-height instead of display:none to allow animation */
        display: flex;
        flex-direction: column;
        align-items: center;

        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: rgba(17, 24, 39, 0.98);
        backdrop-filter: blur(10px);
        padding: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);

        /* HIDE IT SMOOTHLY */
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        /* Cut off content when closed */
        transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
        /* Professional easing */
    }

    /* 4. The Menu (Active/Open State) */
    .nav-links.active {
        max-height: 500px;
        /* Expand down */
        opacity: 1;
        /* Fade in */
        padding: 20px 0;
        /* Add internal spacing */
    }

    .nav-links a {
        color: var(--white);
        font-size: 1.1rem;
        margin: 15px 0;
        width: 100%;
        text-align: center;
        display: block;

        /* Optional: Links slide in slightly later */
        transform: translateY(-20px);
        opacity: 0;
        transition: all 0.3s ease;
    }

    /* Cascade effect: Links appear one by one when menu opens */
    .nav-links.active a {
        transform: translateY(0);
        opacity: 1;
        transition-delay: 0.2s;
        /* Wait for menu to drop first */
    }

    /* 5. Fix other sections */
    .hero {
        padding-top: 100px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .floating-bg i {
        display: none;
    }

    .about-content {
        flex-direction: column;
    }

    .about-content img {
        max-width: 250px;
        margin-bottom: 30px;
    }

    section {
        padding: 50px 0;
        scroll-margin-top: 100px;
    }
}