/* ===================================================================
   Enhanced Neumorphic Portfolio Stylesheet
   Author: Mujtaba Alam (Enhanced by AI)
   Version: 4.1.0
   Description: A cleaner, more dynamic, and stylish neumorphic theme with enhanced animations and improved mobile responsiveness.
   =================================================================== */

/* --- 1. ROOT & VARIABLES --- */
:root {
    --bg-color: #e0e5ec;
    --bg-color-darker: #d1d9e6;
    --primary-color: #007BFF;
    --primary-color-dark: #0056b3;
    --accent-color: #ff4757; /* NEW: Accent color for highlights */
    --text-color: #5b6271;
    --heading-color: #313742;
    --white-color: #ffffff;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --border-color: rgba(163, 177, 198, 0.5);

    /* NEW: Refined Neumorphic Shadows for a softer look */
    --light-shadow: -12px -12px 24px rgba(255, 255, 255, 0.8);
    --dark-shadow: 12px 12px 24px #a3b1c6;
    --light-shadow-soft: -6px -6px 12px rgba(255, 255, 255, 0.7);
    --dark-shadow-soft: 6px 6px 12px rgba(163, 177, 198, 0.6);
    --inset-light-shadow: inset -6px -6px 10px rgba(255, 255, 255, 0.7);
    --inset-dark-shadow: inset 6px 6px 10px #a3b1c6;

    /* Other Variables */
    --font-primary: 'Poppins', sans-serif;
    --transition-speed: 0.4s; /* NEW: Slightly slower for smoother effects */
    --border-radius: 25px; /* NEW: Slightly more rounded */
}

/* NEW: Scrollbar Styling */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color-darker); }
::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-color-dark); }

/* --- 2. GLOBAL RESET & BASE STYLES --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-primary);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.8;
    font-size: 16px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.container { width: 90%; max-width: 1200px; margin: 0 auto; }
h1, h2, h3, h4 { color: var(--heading-color); font-weight: 700; text-rendering: optimizeLegibility; }
h1 { font-size: clamp(2.8rem, 6vw, 4rem); line-height: 1.1; }
h2 { font-size: clamp(2.2rem, 5vw, 3rem); text-align: center; margin-bottom: 25px; }
h3 { font-size: 1.6rem; }
p { margin-bottom: 1.5rem; max-width: 65ch; }
a { text-decoration: none; color: var(--primary-color); font-weight: 600; transition: color var(--transition-speed) ease; }
a:hover { color: var(--primary-color-dark); }
section { padding: 120px 0; }

.section-subtitle { text-align: center; max-width: 700px; margin: -20px auto 60px auto; color: var(--text-color); font-size: 1.1rem; }

/* NEW: Fade-in animation for sections */
.fade-in-section {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- 3. NEUMORPHIC COMPONENTS --- */
.neumorphic-outset {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    box-shadow: var(--light-shadow), var(--dark-shadow);
    transition: all var(--transition-speed) ease-in-out;
}
.neumorphic-inset {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    box-shadow: var(--inset-light-shadow), var(--inset-dark-shadow);
}
.neumorphic-btn {
    display: inline-block;
    padding: 15px 35px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
    text-align: center;
    border-radius: 50px;
    background: var(--bg-color);
    box-shadow: var(--light-shadow-soft), var(--dark-shadow-soft);
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.neumorphic-btn::before { /* NEW: Hover fill effect */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--primary-color);
    transition: width var(--transition-speed) ease;
    z-index: -1;
    border-radius: 50px;
}
.neumorphic-btn:hover {
    color: white;
    transform: translateY(-3px);
}
.neumorphic-btn:hover::before {
    width: 100%;
}
.neumorphic-btn:active {
    transform: scale(0.96) translateY(-1px);
    box-shadow: var(--inset-light-shadow), var(--inset-dark-shadow);
}
.neumorphic-btn.primary {
    color: var(--white-color);
    background: linear-gradient(145deg, var(--primary-color), var(--primary-color-dark));
    box-shadow: 0 10px 25px rgba(0, 123, 255, 0.3);
}
.neumorphic-btn.primary:hover {
    background: linear-gradient(145deg, var(--primary-color-dark), var(--primary-color));
    color: white;
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
    transform: translateY(-5px);
}

/* --- 4. HEADER & NAVIGATION --- */
header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    padding: 20px 0;
    backdrop-filter: blur(15px);
    border: 3px solid rgba(255, 255, 255, 0.267);
    border-radius: 20px;
    transition: all var(--transition-speed) ease;
}
header.scrolled { /* NEW: More pronounced scrolled effect */
    background: rgba(224, 229, 236, 0.8);
    backdrop-filter: blur(15px);
    padding: 15px 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.8rem; font-weight: 800; color: var(--heading-color); letter-spacing: -1px; }
.nav-menu-desktop { list-style: none; display: flex; gap: 40px; }
.nav-menu-desktop a {
    color: var(--text-color);
    font-weight: 600;
    position: relative;
    padding: 5px 0;
    transition: color var(--transition-speed) ease;
}
.nav-menu-desktop a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.nav-menu-desktop a:hover, .nav-menu-desktop a.active { color: var(--primary-color); }
.nav-menu-desktop a:hover::after, .nav-menu-desktop a.active::after { width: 100%; }
.hamburger { display: none; font-size: 1.8rem; cursor: pointer; color: var(--heading-color); }

/* --- 5. MOBILE SIDEBAR --- */
.mobile-sidebar {
    position: fixed; top: 0; right: -100%; width: 300px; height: 100vh;
    background-color: transparent;
    backdrop-filter: blur(20px);
    border: 3px solid rgba(255, 255, 255, 0.267);
    border-radius: 20px;
    z-index: 2000; transition: right 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    padding: 100px 30px 30px 30px; display: flex; flex-direction: column;
}
.mobile-sidebar.active { right: 0; }
.close-icon {
    position: absolute; top: 30px; right: 30px; font-size: 2.2rem;
    cursor: pointer; color: var(--heading-color); transition: transform 0.3s ease;
}
.close-icon:hover { transform: rotate(90deg) scale(1.1); color: var(--danger-color); }
.nav-menu-mobile { display: flex; flex-direction: column; gap: 20px; text-align: center; list-style: none; margin-top: 30px; }
.nav-menu-mobile a {
    font-size: 1.3rem; color: var(--text-color); padding: 15px;
    border-radius: 15px; transition: all 0.3s ease;
}
.nav-menu-mobile a:hover { background-color: var(--bg-color-darker); color: var(--primary-color); }
.nav-menu-mobile a.cta-link {
    background: var(--primary-color); color: white; margin-top: 25px;
}
.nav-menu-mobile a.cta-link:hover { background: var(--primary-color-dark); color: white; }

/* --- 6. PAGE-SPECIFIC SECTIONS --- */

/* Hero Section */
.hero {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; text-align: center;
    background: radial-gradient(circle, var(--bg-color) 60%, var(--bg-color-darker) 110%);
    overflow: hidden;
}
.hero-content {
    animation: fadeInDown 1s ease-out forwards;
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}
.hero-content .neumorphic-btn { margin: 15px; }
.hero-subtitle { font-size: 1.3rem; margin: 25px auto 40px auto; max-width: 650px; font-weight: 500; }

/* Services Section */
.services-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 35px;
}
.service-card {
    padding: 45px 35px; text-align: center; transition: all var(--transition-speed) ease;
    border: 1px solid transparent; /* NEW: for hover effect */
}
.service-card:hover {
    transform: translateY(-12px);
    border-color: var(--border-color);
    box-shadow: 0 20px 40px rgba(163, 177, 198, 0.4);
}
.service-card i {
    font-size: 3.5rem; color: var(--primary-color); margin-bottom: 25px;
    transition: transform var(--transition-speed) ease;
}
.service-card:hover i { transform: scale(1.2); }

/* Projects Section */
.projects-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 40px;
}
.project-card {
    display: flex; flex-direction: column; overflow: hidden;
    transition: all var(--transition-speed) ease;
}
.project-card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 25px 50px rgba(0,0,0,0.1);
}
.project-image {
    height: 250px; background-size: cover; background-position: center;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}
.project-card:hover .project-image {
    transform: scale(1.15);
}
.project-info {
    padding: 30px; background: var(--bg-color); flex-grow: 1;
    display: flex; flex-direction: column;
}


/* FAQ Section */
.faq-container { max-width: 800px; margin: 0 auto; }
.faq-item { margin-bottom: 20px; }
.faq-question {
    width: 100%; text-align: left; padding: 20px 30px; font-size: 1.15rem; border: none;
    cursor: pointer; display: flex; justify-content: space-between; align-items: center;
    font-weight: 600; color: var(--heading-color);
}
.faq-question i {
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* NEW: Bouncy effect */
    color: var(--primary-color); font-size: 1.3rem;
}
.faq-question.active i { transform: rotate(135deg); }
.faq-answer {
    padding: 0 30px; max-height: 0; overflow: hidden;
    transition: max-height 0.5s ease-in-out, padding 0.5s ease-in-out;
    border-top: 1px solid var(--border-color);
}
.faq-answer p { padding: 25px 0; margin: 0; }

/* CTA Section */
#cta {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color)); /* NEW: Gradient */
    color: var(--white-color); text-align: center;
    border-radius: var(--border-radius);
    padding: 80px 40px;
    margin: 0 5%; /* NEW: Margin to make it stand out */
    position: relative;
    overflow: hidden;
}
/* NEW: Animated background elements */
#cta::before, #cta::after {
    content: '';
    position: absolute;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transition: transform 2s ease;
    animation: pulse 5s infinite ease-in-out;
}
#cta::before { width: 200px; height: 200px; top: -50px; left: -50px; }
#cta::after { width: 300px; height: 300px; bottom: -100px; right: -100px; animation-delay: 1.5s; }
@keyframes pulse {
    50% { transform: scale(1.2); }
}
#cta h2, #cta p { color: var(--white-color); position: relative; z-index: 1; }
#cta .neumorphic-btn {
    background: var(--white-color); color: black;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}
#cta .neumorphic-btn:hover {
    background: black; color: var(--primary-color-dark);
}


/* --- 7. FOOTER --- */
footer { padding: 80px 0 40px 0; background-color: var(--bg-color-darker); }
.footer-grid {
    display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
    padding-bottom: 50px; border-bottom: 1px solid var(--border-color);
}
.footer-column h4 { margin-bottom: 25px; color: var(--heading-color); }
.footer-column ul { list-style: none; }
.footer-column li { margin-bottom: 15px; }
.footer-column a { color: var(--text-color); font-weight: 500; position: relative; }
.footer-column a::after { /* NEW: Underline hover effect */
    content: ''; position: absolute; width: 0; height: 2px;
    bottom: -4px; left: 0; background-color: var(--primary-color);
    transition: width 0.3s ease;
}
.footer-column a:hover::after { width: 50%; }
.footer-social-links { display: flex; justify-content: center; gap: 15px; margin: 40px 0; }
.footer-social-links a {
    width: 50px; height: 50px; display: flex; align-items: center; justify-content: center;
    color: var(--text-color); font-size: 1.3rem; border-radius: 50%;
}
.footer-social-links a:hover {
    color: var(--primary-color);
    box-shadow: var(--inset-light-shadow), var(--inset-dark-shadow);
}
.footer-text { font-size: 0.95rem; opacity: 0.9; text-align: center; }

/* Process Timeline Section */
.process-timeline { max-width: 900px; margin: 0 auto; list-style: none; padding: 20px 0; position: relative; }
.process-timeline::before { content: ''; position: absolute; top: 0; left: 50%; width: 4px; height: 100%; background: var(--bg-color-darker); border-radius: 2px; transform: translateX(-50%); }
.timeline-item { padding: 20px 40px; position: relative; width: 50%; margin-bottom: 30px; }
.timeline-item .timeline-content { padding: 30px; border-radius: var(--border-radius); }
.timeline-item:nth-child(odd) { left: 0; }
.timeline-item:nth-child(even) { left: 50%; }
.timeline-item::after { content: ''; position: absolute; width: 25px; height: 25px; right: -14.5px; background-color: var(--white-color); border: 4px solid var(--primary-color); top: 32px; border-radius: 50%; z-index: 1; }
.timeline-item:nth-child(even)::after { left: -14.5px; }
.timeline-content h3 { color: var(--primary-color); margin-bottom: 10px; }
.timeline-content p { color: var(--text-color); }


/* Skills Section */
#tech-stack { background-color: var(--bg-color-darker); }
.skills-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.skills-category { padding: 30px; }
.skills-category h3 { text-align: center; margin-bottom: 25px; }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 20px; }
.skill-card { text-align: center; transition: transform var(--transition-speed) ease; }
.skill-card:hover { transform: scale(1.1); }
.skill-card i { font-size: 3rem; margin-bottom: 5px; }
.skill-card p { font-size: 0.9rem; font-weight: 600; }

/* --- 8. RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 992px) {
    .nav-menu-desktop { display: none; }
    .hamburger { display: block; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }

    /* Reponsive timeline */
    .process-timeline::before { left: 12px; }
    .timeline-item { width: 100%; padding-left: 50px; padding-right: 15px; }
    .timeline-item:nth-child(even) { left: 0%; }
    .timeline-item::after { left: -1.5px; }
}

@media (max-width: 768px) {
    body { font-size: 15px; }
    section { padding: 70px 0; }
    h1 { font-size: 2.0rem; } 
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.4rem; }
    .logo { font-size: 1.6rem; }
    .hamburger { font-size: 1.6rem; }

    .service-card i { font-size: 3.0rem; }
    .project-image { height: 220px; }

    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .footer-column a::after { left: 50%; transform: translateX(-50%); }
    .footer-column a:hover::after { width: 30%; }
    .footer-social-links a { width: 45px; height: 45px; font-size: 1.2rem; }
}

@media (max-width: 576px) {
    body { line-height: 1.7; }
    .container { width: 92%; }
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.3rem; }
    .section-subtitle { font-size: 1.0rem; margin-bottom: 40px; }

    .hero-subtitle { font-size: 1.0rem; }
    .neumorphic-btn { padding: 12px 28px; font-size: 0.9rem; }
    .project-image { height: 200px; }

    .testimonial-card, .testimonial-slider-track { gap: 20px; }
    .testimonial-card { min-width: 280px; padding: 25px; }
    #cta { margin: 0; border-radius: 0; padding: 60px 25px; }

    .faq-question { font-size: 1.0rem; padding: 18px 20px; }
    .faq-question i { font-size: 1.1rem; }
    .faq-answer p { padding: 20px 0; }

    .skill-card i { font-size: 2.5rem; }
    .skill-card p { font-size: 0.85rem; }
}

/* NEW: Added for extra-small phones */
@media (max-width: 480px) {
    body { font-size: 14px; }
    section { padding: 60px 0; }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.2rem; }
    p { margin-bottom: 1.2rem; }

    .mobile-sidebar { width: 100%; }
    .close-icon { top: 20px; right: 25px; }

    .hero-content .neumorphic-btn { margin: 10px; }
    .hero-subtitle { font-size: 0.95rem; }

    .service-card { padding: 30px 25px; }
    .service-card i { font-size: 2.8rem; }
    
    .projects-grid { gap: 30px; }
    .project-image { height: 180px; }
    .project-info { padding: 25px; }

    .testimonial-card { min-width: 260px; }

    .skills-grid { gap: 15px; }
    .skill-card i { font-size: 2.2rem; }
    .skill-card p { font-size: 0.8rem; }
    
    .footer-social-links a { width: 40px; height: 40px; font-size: 1.1rem; }
    .footer-text { font-size: 0.85rem; }
}