/* --- Global Variables --- */
:root {
    --laravel-red: #FF2D20;
    --glass-bg: rgba(255, 255, 255, 0.07);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --white: #ffffff;
    --transition: all 0.3s ease;
}

/* --- Base Styles & Animated Background --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Ubuntu', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0f172a; /* Dark slate base */
    color: var(--text-main);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

/* --- Ambient Animated Background Blobs --- */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    z-index: -1;
    filter: blur(120px);
    opacity: 0.6;
}

body::before {
    background: #FF2D20; /* Laravel Red Glow */
    width: 400px; 
    height: 400px;
    top: -100px; 
    left: -100px;
    animation: roamBlobRed 25s infinite alternate ease-in-out;
}

body::after {
    background: #4f46e5; /* Indigo Glow */
    width: 500px; 
    height: 500px;
    bottom: -100px; 
    right: -100px;
    animation: roamBlobIndigo 30s infinite alternate ease-in-out;
}

/* Red Blob moves across the top/middle */
@keyframes roamBlobRed {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30vw, 20vh) scale(1.2); }
    66% { transform: translate(60vw, 40vh) scale(0.9); }
    100% { transform: translate(20vw, 60vh) scale(1.1); }
}

/* Indigo Blob moves across the bottom/middle */
@keyframes roamBlobIndigo {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-40vw, -20vh) scale(1.1); }
    66% { transform: translate(-20vw, -50vh) scale(0.8); }
    100% { transform: translate(-60vw, -10vh) scale(1.2); }
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}

h1 {
    font-weight: 400;
}

p {
    font-weight: 200;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

.section {
    padding: 6rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--white);
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--laravel-red);
    margin: 10px auto 0;
    box-shadow: 0 0 10px var(--laravel-red);
}

.text-laravel {
    color: var(--laravel-red);
    text-shadow: 0 0 15px rgba(255, 45, 32, 0.4);
}

/* --- The Dynamic Spotlight Glass Panel --- */
.glass-panel {
    position: relative;
    background: rgba(15, 23, 42, 0.2); 
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    overflow: hidden;

    /*Remove white thingy*/
    -webkit-mask-image: linear-gradient(#fff, #fff);
    mask-image: linear-gradient(#fff, #fff);
    --clr: rgba(255, 255, 255, 0.9); 
    transition: transform 0.3s ease;
}

/* The moving spotlight gradient */
.glass-panel::before {
    content: '';
    position: absolute;
    top: var(--y, -1000px); 
    left: var(--x, -1000px);
    transform: translate(-50%, -50%);
    width: 600px; 
    height: 600px;
    /* 2. Tighter gradient: Bright core that fades out quickly to create the sharp edge glow */
    background: radial-gradient(circle, var(--clr) 0%, rgba(255, 255, 255, 0.1) 30%, transparent 50%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 0;
    pointer-events: none;
}

/* 3. Reveal at full opacity so the border shines intensely */
.glass-panel:hover::before {
    opacity: 1; 
}

/* The inner frosted glass layer */
.glass-panel::after {
    content: '';
    position: absolute;
    inset: 1px; /* The 1px gap where the pure white light escapes */
    /* 4. Slightly darkened surface to create high contrast against the bright white border */
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 15px; 
    z-index: 1;
    pointer-events: none;
}

/* Elevate the actual content above the glass and the glow */
.glass-panel > * {
    position: relative;
    z-index: 2;
}

/* Make sure the image in projects sits above the glass effect properly */
.project-card .project-image {
    position: relative;
    z-index: 2;
    border-radius: 15px 15px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Keep the floating effect on hover */
.project-card:hover {
    transform: translateY(-10px);
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 20px; /* Distance from the top */
    left: 50%;
    transform: translateX(-50%); /* Centers the floating bar */
    width: 90%;
    max-width: 1100px;
    z-index: 1000;
    padding: 1rem 2rem;

    z-index: 10005; /* Ensure it stays above the animated blobs */
    
    /* Glass effect */
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    /* Rounded corners and border */
    border: 1px solid var(--glass-border);
    border-radius: 50px; 
    
    /* Smooth animation for when it snaps to the top */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Scrolled State (Triggered by JS) --- */
.navbar.scrolled {
    top: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    padding: 1rem 5%; /* Matches the container width */
    background: rgba(15, 23, 42, 0.75); /* Slightly darker when scrolling */
    border-top: none;
    border-left: none;
    border-right: none;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--laravel-red);
    text-shadow: 0 0 10px rgba(255, 45, 32, 0.5);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

/* --- Navigation Links --- */
.nav-links a {
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1.2rem; /* Adds space for the glass pill */
    border-radius: 50px; /* Makes it a pill shape */
    border: 1px solid transparent; /* Keeps layout stable */
    color: var(--text-muted);
}

.nav-links a:hover {
    color: var(--laravel-red);
    text-shadow: 0 0 8px rgba(255, 45, 32, 0.4);
    background: rgba(255, 255, 255, 0.05); /* Slight glass on hover */
}

/* --- The Active Glass State --- */
.nav-links a.active {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.nav-links a:hover {
    color: var(--laravel-red);
    text-shadow: 0 0 8px rgba(255, 45, 32, 0.6);
}

/* --- Hamburger Menu (Hidden on Desktop) --- */
.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.8rem;
    color: var(--white);
    transition: var(--transition);
}

.hamburger:hover {
    color: var(--laravel-red);
}

/* --- Hero Section --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
    padding-top: 60px;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.8rem 2.5rem;
    border-radius: 50px; /* Rounded buttons fit glassmorphism well */
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--laravel-red);
    color: var(--white);
    border: none;
    box-shadow: 0 4px 15px rgba(255, 45, 32, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 45, 32, 0.6);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-block {
    display: block;
    width: 100%;
}

/* --- Typewriter Cursor --- */
.cursor {
    font-weight: bold;
    color: var(--laravel-red);
    animation: blink 0.8s step-end infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* --- About Section --- */
.about-grid {
    display: grid;
    /* 40% width for the image, 1fr (the rest of the space) for the text */
    grid-template-columns: 40% 1fr; 
    gap: 3rem;
    align-items: center;
}

/* Image Container */
.about-image {
    padding: 1rem; /* Creates a nice glass frame around your photo */
}

.profile-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
    object-fit: cover;
    /* Keeps the image above the spotlight effect */
    position: relative;
    z-index: 2; 
}

/* Text Container */
.about-text {
    padding: 3rem;
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.8;
}

/* --- Social Media Links --- */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
}

/* Specific spacing for the Hero section */
.hero-socials {
    margin-top: 2.5rem;
}

/* Specific styling for the Footer */
.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    
    /* Subtle Glassmorphism Base */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: var(--transition);
    
    /* Ensure it sits above the background animations */
    position: relative;
    z-index: 10;
}

.social-icon:hover {
    background: var(--laravel-red);
    border-color: var(--laravel-red);
    color: var(--white);
    transform: translateY(-4px);
    box-shadow: 0 6px 15px rgba(255, 45, 32, 0.4);
}

/* --- Skills Section --- */
.skills-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* This is the magic that centers incomplete rows! */
    margin-bottom: 3rem;
}

.skill-card {
    /* 1. Add these two lines to lock the width */
    width: 100%;       /* Keeps it responsive on tiny mobile screens */
    max-width: 250px;  /* Locks it to the exact 4-col desktop size */

    /* Keep your existing properties below: */
    padding: 1.5rem 1.5rem;
    text-align: center;
    transition: var(--transition);
}

.skill-card:hover {
    transform: translateY(-10px);
}

.skill-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: var(--white);
}

.skill-card h3 {
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}

.skill-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- Skill Categories --- */
.skill-category {
    margin-bottom: 4.5rem;
}

.skill-category:first-of-type {
    margin-top: 6rem;
}

.skill-category:last-child {
    margin-bottom: 0;
}

.category-title {
    text-align: center;
    font-size: 1.8rem;
    color: var(--white);
    margin-bottom: 2.5rem;
    font-weight: 500;
    letter-spacing: 1px;
    opacity: 0.9;
}

/* Add a subtle glow under the category title to match the theme */
.category-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    margin: 8px auto 0;
    border-radius: 2px;
}

/* --- Projects Section --- */
.projects-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* This centers the card if there is only 1 */
    align-items: stretch; /* Ensures cards in the same row are equal height */
    gap: 2.5rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: var(--transition);
    
    /* 1. Add these lines to lock the 2-column width (from our previous step) */
    width: 100%;
    max-width: calc(50% - 1.25rem); 
    
    /* 2. Add a transparent border to prepare for the hover effect */
    border: 1px solid transparent; 
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.3);
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* Match the border radius of the parent container to keep it seamless */
    border-radius: 15px 15px 0 0; 
}

/* Update the parent container to ensure it handles the image correctly */
.project-image {
    width: 100%;
    height: 220px;
    position: relative;
    z-index: 2;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden; /* Keeps the image from breaking out of the rounded corners */
}

.project-info {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Forces this section to take up all remaining space */
}

.project-info h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.project-info p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.project-tags span {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--white);
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* --- More Projects Indicator --- */
.more-projects {
    text-align: center;
    margin-top: 4rem;
    font-size: 2.1rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 1px;
}

/* Subtle pulsing animation for the dots */
.loading-dots {
    display: inline-block;
    color: var(--laravel-red);
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; text-shadow: 0 0 10px rgba(255, 45, 32, 0.5); }
}

/* --- Project Actions / Live Demo Button --- */
.project-actions {
    margin-top: auto; /* This is the magic rule! It pushes the button to the absolute bottom of the card */
    padding-top: 1.5rem; /* Replaced margin-top with padding to ensure spacing above the button */
}

.btn-project {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.05); /* Very subtle glass base */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    /* Set z-index to 10 so it's clickable above the spotlight layer */
    position: relative;
    z-index: 10; 
}

.btn-project:hover {
    background: var(--laravel-red);
    border-color: var(--laravel-red);
    box-shadow: 0 4px 15px rgba(255, 45, 32, 0.4);
    transform: translateY(-2px);
    color: var(--white);
}

.btn-project i {
    font-size: 0.85rem;
}

/* --- Contact Section --- */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 3rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

/* Glass inputs */
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1.2rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--white);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--laravel-red);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 10px rgba(255, 45, 32, 0.2);
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    border-top: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
}

/* --- 3D Card Mechanics --- */
.skill-card {
    position: relative;
    perspective: 900px; /* Gives the 3D depth */
    height: 100%;
}

.skill-card-inner {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    
    transform-style: preserve-3d;
    transform: rotateX(0deg) rotateY(0deg) translateZ(0px);
    will-change: transform;
    backface-visibility: hidden;
    
    /* Smooth transition when the mouse leaves */
    transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 220ms ease;
}

/* Ensure the contents of the inner card pop out in 3D */
.skill-card-inner > * {
    transform: translateZ(20px); /* Pushes the icons/text forward */
    position: relative;
    z-index: 2;
}

/* --- Morphing Cursor Styles --- */
/* Hide default cursor on desktop */
@media (hover: hover) and (pointer: fine) {
    body {
        cursor: none;
    }
    /* Let links be clickable but hide the pointer finger */
    a, button {
        cursor: none; 
    }
}

.cursorDot {
    position: fixed;
    left: 0;
    top: 0;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #fff;
    transform: translate(-999px, -999px);
    pointer-events: none;
    z-index: 10010;
    will-change: transform;
    mix-blend-mode: difference;
}

.cursorSvg {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 10000;
    overflow: visible;
}

.cursorGlow {
    fill: none;
    stroke: rgba(255, 45, 32, 0.2); /* Laravel Red glow */
    stroke-width: 10;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cursorStroke {
    fill: none;
    stroke: rgba(255, 255, 255, 0.6);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Disable on Mobile / Touch Devices */
@media (hover: none), (pointer: coarse), (max-width: 768px) {
    body, a, button { cursor: auto !important; }
    .cursorDot, .cursorSvg { display: none !important; }
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    /* Show the hamburger menu */
    .hamburger {
        display: block;
    }

    /* Transform the nav links into a glass dropdown */
    .nav-links {
        position: absolute;
        top: 100%; /* Positions it right below the navbar */
        left: 0;
        width: 100%;
        background: rgba(15, 23, 42, 0.95); /* Slightly less transparent for readability */
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 2rem 0;
        gap: 1.5rem;
        border-bottom: 1px solid var(--glass-border);
        border-radius: 0 0 20px 20px;
        
        /* Hide it using opacity and transform for a smooth sliding animation */
        opacity: 0;
        transform: translateY(-20px);
        pointer-events: none; /* Prevents clicking when hidden */
        transition: all 0.3s ease;
    }

    /* The class triggered by JavaScript to open the menu */
    .nav-links.nav-active {
        opacity: 1;
        transform: translateY(0) scale(1);
        pointer-events: all;
    }

    /* Adjust the links for mobile spacing */
    .nav-links {
        position: absolute;
        top: calc(100% + 15px); /* Detaches it slightly from the navbar to create a floating card look */
        left: 0;
        width: 100%;
        
        /* Enhanced Glassmorphism */
        background: rgba(15, 23, 42, 0.5); /* Dropped opacity to let background colors shine through */
        backdrop-filter: blur(25px); /* Increased blur to make the text readable */
        -webkit-backdrop-filter: blur(25px);
        border: 1px solid rgba(255, 255, 255, 0.15); /* Slightly brighter border to catch the light */
        border-radius: 20px; 
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); /* Deeper shadow to lift it off the background */
        
        /* Centering the links */
        display: flex;
        flex-direction: column;
        align-items: center; /* This is the magic rule that centers the items */
        padding: 2.5rem 0;
        gap: 1.5rem;
        
        /* Smooth Animation */
        opacity: 0;
        transform: translateY(-20px) scale(0.98); /* Added a slight scale effect for a "pop" feeling */
        pointer-events: none; 
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); /* Snappier animation */
    }

    .nav-links a {
        font-size: 1.25rem;
        display: inline-block;
        padding: 0.8rem 2rem; /* Gives them a wider tap target for thumbs */
        border-radius: 50px;
    }

    /* --- Menu Overlay Backdrop --- */
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(15, 23, 42, 0.4); /* Darkens the rest of the site slightly */
        backdrop-filter: blur(8px); /* Blurs the rest of the site */
        -webkit-backdrop-filter: blur(8px);
        z-index: 999; 
        opacity: 0;
        pointer-events: none;
        transition: all 0.4s ease;
    }

    .menu-overlay.active {
        opacity: 1;
        pointer-events: all;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .about-content, .contact-form {
        padding: 2rem 1.5rem;
    }

    .about-grid {
        grid-template-columns: 1fr; /* Stacks the columns on mobile */
        gap: 2rem;
    }
    
    .about-image {
        max-width: 400px;
        margin: 0 auto; /* Centers the image on mobile */
    }

    .project-card {
        max-width: 100%; 
    }
}
