/* --- Variables & Reset --- */
:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --accent: #38bdf8;
    --accent-rgb: 56, 189, 248;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --gradient: linear-gradient(90deg, #38bdf8, #818cf8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden; /* This stops the right-side gap */
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Navigation --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 10%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.9rem;
    transition: 0.3s;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-cta {
    border: 1px solid var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

/* --- Desktop Nav (Add this to existing .nav-links) --- */
.nav-links {
    transition: 0.5s ease;
}

/* --- Mobile Menu Icon --- */
.menu-toggle {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    cursor: pointer;
    gap: 6px;
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-main);
    transition: 0.3s;
    border-radius: 2px;
}

/* --- Mobile Responsive Styles --- */


@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        z-index: 1002;
    }

    .nav-links {
        position: fixed;
        right: -100%; /* Move it back off-screen */
        top: 0;
        width: 70%;
        height: 100vh;
        
        /* Background & Blur */
        background: #0f172a; /* Force a dark color */
        background: var(--bg-dark, #0f172a); 
        backdrop-filter: blur(10px);
        
        /* Layout */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        
        /* Visibility Logic */
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1001;
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    }

    /* When the menu is OPEN */
    .nav-links.active {
        right: 0;
        opacity: 1;
        visibility: visible;
    }
    
    /* Ensure links inside are visible */
    .nav-links a {
        font-size: 1.2rem;
        width: 100%;
        text-align: center;
    }
}
    /* Fix: Ensure bars are visible and animate correctly */
    .menu-toggle.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    
    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
        transform: translateX(-20px);
    }

    .menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

/* --- Hero Section --- */
.hero {
    height: 90vh;
    display: flex;
    align-items: center;
}

.hero-wrapper {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
    align-items: center;
}

.intro {
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.description {
    color: var(--text-muted);
    max-width: 500px;
    margin-bottom: 2rem;
}

.hero-btns {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 1.8rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.btn.primary {
    background: var(--accent);
    color: var(--bg-dark);
}

.btn.secondary {
    border: 1px solid var(--text-muted);
    color: var(--text-main);
}

.btn:hover {
    transform: translateY(-3px);
    opacity: 0.9;
}

/* --- Image Styling --- */
.hero-image {
    position: relative;
    display: flex;
    justify-content: center;
}

.profile-img {
    width: 300px;
    height: 350px;
    object-fit: cover;
    border-radius: 20px;
    z-index: 2;
    background: var(--bg-card); /* Placeholder if no image */
}

.img-accent-square {
    position: absolute;
    width: 300px;
    height: 350px;
    border: 4px solid var(--accent);
    border-radius: 20px;
    top: 20px;
    left: 20px;
    z-index: 1;
}

/* --- Responsive Layout --- */
/* --- Updated Responsive Layout --- */
@media (max-width: 768px) {
    .hero {
        height: auto; /* Allow the section to grow with content */
        padding: 4rem 0;
    }

    .hero-wrapper {
        grid-template-columns: 1fr;
        text-align: center;
        display: flex; /* Switch to flex for better stacking control */
        flex-direction: column; /* Puts image on TOP, text below */
    }

    .description {
        margin: 0 auto 2rem;
    }

    .hero-btns {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.8rem;
    }

    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }

    .hero-image {
        margin-bottom: 3rem; /* Add space between image and text */
        display: flex;      /* REPLACED 'none' with 'flex' */
    }

    .profile-img, .img-accent-square {
        width: 250px;       /* Scale down slightly for mobile */
        height: 300px;
    }
    
    .img-accent-square {
        top: 15px;
        left: 15px;
    }
}
/* --- About & Skills Section (Refined) --- */
.about-section {
    padding: 100px 2rem;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 50px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

.about-text p strong {
    color: var(--text-main);
}

/* --- Refined Skill Cards --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
}

/* --- Skill Cards with Steady Animation --- */
/* --- 1. The Animations (Sitting outside all other braces) --- */

/* For standard cards: Subtle Pulse */
/* --- The Rainbow Animation --- */
@keyframes rainbowGlow {
    0% {
        border-color: #ff0000; /* Red */
        box-shadow: 0 0 10px rgba(255, 0, 0, 0.2);
    }
    20% {
        border-color: #ff8800; /* Orange */
    }
    40% {
        border-color: #ffff00; /* Yellow */
    }
    60% {
        border-color: #00ff00; /* Green */
        box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    }
    80% {
        border-color: #0088ff; /* Blue */
    }
    100% {
        border-color: #cc00ff; /* Purple */
        box-shadow: 0 0 10px rgba(204, 0, 255, 0.2);
    }
}

/* --- Base Skill Card Styling --- */
.skill-card {
    background: var(--bg-card);
    padding: 0.8rem;
    text-align: center;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff; /* White text looks better with rainbow borders */
    
    /* Apply the rainbow animation */
    animation: rainbowGlow 6s linear infinite;
    transition: transform 0.3s ease;
}

/* --- The Secret Sauce: Staggering the Colors --- */
/* We give each card a different delay so they aren't the same color at the same time */

.skill-card:nth-child(1) { animation-delay: 0s; }
.skill-card:nth-child(2) { animation-delay: -0.7s; }
.skill-card:nth-child(3) { animation-delay: -1.4s; }
.skill-card:nth-child(4) { animation-delay: -2.1s; }
.skill-card:nth-child(5) { animation-delay: -2.8s; }
.skill-card:nth-child(6) { animation-delay: -3.5s; }
.skill-card:nth-child(7) { animation-delay: -4.2s; }
.skill-card:nth-child(8) { animation-delay: -4.9s; }

/* Feature tags still stand out with a slight lift */
.skill-card.featured {
    transform: scale(1.05);
    font-weight: 700;
}

.skill-card:hover {
    transform: translateY(-5px) scale(1.1);
    animation-play-state: paused;
    background: #fff;
    color: #000;
}
/* --- Mobile Responsiveness --- */
@media (max-width: 850px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

/* --- Education Section --- */
.education-section {
    padding: 60px 2rem;
}

.education-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
}

/* Suble accent line for the education card */
.education-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--gradient);
}

.edu-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.edu-title h3 {
    font-size: 1.4rem;
    color: var(--text-main);
}

.university {
    color: var(--accent);
    font-weight: 600;
    font-size: 1rem;
    margin-top: 0.3rem;
}

.edu-date {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid var(--accent);
}

.edu-details p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.edu-highlights {
    list-style: none;
    padding-left: 0;
}

.edu-highlights li {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.edu-highlights li::before {
    content: '▹'; /* Engineering/Code style bullet */
    color: var(--accent);
    font-weight: bold;
}

/* Responsive adjustment */
@media (max-width: 600px) {
    .edu-header {
        flex-direction: column;
    }
}

/* --- Projects Section --- */
.projects-section {
    padding: 80px 2rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.project-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.4s ease;
}

.project-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Image Container & Overlay */
.project-img-container {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.project-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s ease;
}

/* --- Live Demo Button Styling --- */
.btn-demo {
    background-color: var(--accent);
    color: var(--bg-dark) !important; /* Ensure high contrast */
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
    border: 2px solid var(--accent);
}

.btn-demo:hover {
    background-color: transparent;
    color: var(--accent) !important;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.6);
}

/* Ensure the overlay is dark enough to make the button pop */
.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85); /* Slightly darker */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: 0.3s ease;
    backdrop-filter: blur(3px); /* Adds a professional glass touch */
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-card:hover .project-img-container img {
    transform: scale(1.1);
}

/* Project Details */
.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
    color: var(--text-main);
}

.project-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    height: 100%; /* Keeps cards uniform height */
}

/* Tech Tags */
.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.project-tech span {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.project-links a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom: 2px solid var(--accent);
    transition: 0.3s;
}

.project-links a:hover {
    color: var(--accent);
    padding-left: 5px;
}

.contact {
    padding: 100px 10%;
    background: var(--bg-dark);
}

.contact-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    align-items: center;
}

.contact-card {
    background: rgba(30, 41, 59, 0.5);
    padding: 2.5rem 0.8rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    min-width: 0; /* allows flex children to actually shrink instead of overflowing */
}

.info-item:last-child { margin-bottom: 0; }

.info-item > div:last-child {
    min-width: 0; /* lets the text column shrink below its content's natural width */
    flex: 1;
}

.info-item .icon {
    flex-shrink: 0; /* keep the icon a fixed size, never let it get squeezed */
    font-size: 1.5rem;
    background: rgba(var(--accent-rgb), 0.1);
    padding: 12px;
    border-radius: 12px;
}

.info-item h3 {
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 4px;
}

.info-item p, .info-item a {
    display: block;
    font-size: 1.1rem;
    color: var(--text-main);
    text-decoration: none;
    white-space: nowrap; /* keep the phone number / email as one readable unit */
}

/* Email addresses are the long, break-prone case — allow a graceful break there only */
.info-item a[href^="mailto:"] {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

/* Mobile Tweak */
@media (max-width: 768px) {
    .contact { padding: 60px 5%; }
    .contact-wrapper { grid-template-columns: 1fr; }
}

/* Phone number: shrink to fit before ever breaking mid-digit */
@media (max-width: 420px) {
    .info-item a[href^="tel:"] {
        font-size: 0.95rem;
    }
}

@media (max-width: 360px) {
    .info-item {
        gap: 1rem;
    }
    .info-item a[href^="tel:"] {
        font-size: 0.85rem;
    }
}

.testimonials {
    padding: 100px 10%;
    background: var(--bg-dark);
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

.section-title span {
    color: var(--accent);
}

.testimonials-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(5px);
}

.empty-state {
    text-align: center;
    color: var(--text-main);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.empty-state small {
    opacity: 0.6;
    font-style: italic;
}

/* Mobile Adjustment */
@media (max-width: 768px) {
    .testimonials {
        padding: 60px 5%;
    }
}

.footer {
    background: #0b1120; /* Slightly darker than bg-dark for depth */
    padding: 60px 10% 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.footer-logo span {
    color: var(--accent);
}

.footer-description {
    max-width: 500px;
    margin: 0 auto 2rem;
    opacity: 0.7;
    line-height: 1.6;
}

.footer-socials {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.footer-socials a {
    color: var(--text-main);
    font-size: 1.4rem;
    transition: 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
}

.footer-socials a:hover {
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
    transform: translateY(-5px);
}

.footer-links {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.9rem;
    opacity: 0.8;
    transition: 0.3s;
}

.footer-links a:hover {
    color: var(--accent);
    opacity: 1;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-bottom p {
    font-size: 0.85rem;
    opacity: 0.5;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .footer {
        padding: 40px 5% 20px;
    }
    .footer-links {
        gap: 1rem;
    }
}

.whatsapp-fab {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    background-color: #25d366; /* Official WhatsApp Green */
    color: #fff;
    border-radius: 50%;
    text-align: center;
    font-size: 35px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 1000;
    transition: all 0.3s ease-in-out;
}

.whatsapp-fab:hover {
    transform: scale(1.1);
    background-color: #128c7e; /* Darker WhatsApp Green */
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Ensure it doesn't overlap important UI on very small screens */
@media (max-width: 480px) {
    .whatsapp-fab {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 30px;
    }
}

/* Limit the text height initially */
.description-wrapper {
    position: relative;
    max-height: 100px; /* Adjust this to show 3-4 lines */
    overflow: hidden;
    transition: max-height 0.5s ease;
    margin-bottom: 10px;
}

/* The fade effect at the bottom of the cut text */
.description-wrapper::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background: linear-gradient(transparent, var(--bg-card-color, #1e293b)); 
    transition: opacity 0.3s;
}

/* When expanded, show everything and remove fade */
.description-wrapper.expanded {
    max-height: 1000px; /* Large enough to fit all text */
}

.description-wrapper.expanded::after {
    opacity: 0;
}

/* Style the button */
.read-more-btn {
    background: none;
    border: none;
    color: var(--accent); /* Your brand color */
    cursor: pointer;
    font-weight: 600;
    padding: 0;
    margin-bottom: 15px;
    font-size: 0.9rem;
    text-decoration: underline;
}