/* =========================================
   1. ROOT VARIABLES & RESET
   ========================================= */
:root {
    /* Modern Palette (Nord-inspired but punchier) */
    --primary-color: #5e81ac;       /* Deep Blue */
    --secondary-color: #88c0d0;     /* Ice Blue */
    --accent-color: #bf616a;        /* Soft Red (for hearts/alerts) */
    --bg-color: #f0f4f8;            /* Light Grey-Blue Background */
    --text-main: #2e3440;           /* Dark Grey Text */
    --text-muted: #4c566a;          /* Muted Text */
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --shadow-soft: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: var(--secondary-color); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }

/* =========================================
   2. ANIMATIONS
   ========================================= */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.animate-zoom-in { animation: fadeInUp 0.8s ease-out forwards; }

/* =========================================
   3. NAVBAR (Glassmorphism)
   ========================================= */
.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding: 15px 0;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
}

.navbar.hidden { transform: translateY(-100%); }

.navbar-brand {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-color) !important;
    letter-spacing: -0.5px;
}

.nav-link {
    font-weight: 600;
    color: var(--text-main) !important;
    margin: 0 15px;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0; height: 3px;
    background: var(--secondary-color);
    bottom: -5px; left: 0;
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: 2px;
}

.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link:hover { color: var(--primary-color) !important; }

/* =========================================
   4. HERO SECTION (Modern Gradient)
   ========================================= */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #81a1c1 100%);
    color: var(--white);
    padding: 180px 0 120px;
    position: relative;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
}

.profile-img {
    width: 170px; height: 170px;
    border-radius: 50%;
    border: 6px solid rgba(255, 255, 255, 0.3);
    margin-bottom: 30px;
    object-fit: cover;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: float 6s ease-in-out infinite;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.hero .lead {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 30px;
}

/* =========================================
   5. SECTIONS GENERAL (Fixed Centering)
   ========================================= */
.section { padding: 100px 0; }

.section h2 {
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 50px;
    text-align: center;
    position: relative;
    display: block;      /* Changed from inline-block */
    width: 100%;        /* Ensures it takes full width for text-align to work */
}

.section h2::after {
    content: '';
    display: block;
    width: 60px; 
    height: 4px;
    background: var(--secondary-color);
    margin: 15px auto 0; /* 'auto' handles the centering of the underline */
    border-radius: 2px;
}

/* =========================================
   6. SKILLS (Floating Cards)
   ========================================= */
.skill-item {
    background: var(--white);
    padding: 30px 20px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(0,0,0,0.03);
    box-shadow: var(--shadow-soft);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy effect */
    height: 100%;
    margin-bottom: 25px;
}

.skill-item:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-hover);
    border-color: var(--secondary-color);
}

.skill-item h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.skill-item p { color: var(--text-muted); font-size: 0.95rem; }

/* =========================================
   7. PROJECTS (Image Zoom & Clean Layout)
   ========================================= */
.project-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden; /* Keeps zoomed image inside */
    box-shadow: var(--shadow-soft);
    transition: all 0.4s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.02);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.project-card .img-wrapper {
    overflow: hidden; /* Critical for zoom effect */
    height: 220px;
}

.project-card img {
    height: 100%; width: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-card:hover img {
    transform: scale(1.1); /* Zoom effect */
}

.project-card .card-body {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-card h5 {
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-main);
}

.description {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Push buttons to bottom */
.project-card .mt-3 { margin-top: auto !important; }

/* Buttons */
.btn {
    padding: 10px 24px;
    border-radius: 50px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    box-shadow: 0 4px 15px rgba(94, 129, 172, 0.3);
}

.btn-primary:hover {
    background: #4c6a8f;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(94, 129, 172, 0.4);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* =========================================
   8. EXPERIENCE TIMELINE (Refined)
   ========================================= */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 50px auto;
}

.timeline::before {
    content: '';
    position: absolute;
    width: 3px;
    background: #e0e6ed;
    top: 0; bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.timeline-item {
    background: var(--white);
    padding: 30px;
    border-radius: 16px;
    width: 44%;
    box-shadow: var(--shadow-soft);
    position: relative;
    margin-bottom: 40px;
    transition: transform 0.3s ease;
}

.timeline-item:hover { transform: translateY(-5px); }

/* Left/Right Logic */
.timeline-item:nth-child(odd) { left: 0; }
.timeline-item:nth-child(even) { left: 56%; }

/* Dots */
.timeline-item::after {
    content: '';
    position: absolute;
    width: 18px; height: 18px;
    background: var(--secondary-color);
    border: 4px solid #fff;
    box-shadow: 0 0 0 3px rgba(136, 192, 208, 0.3);
    border-radius: 50%;
    top: 30px;
}

.timeline-item:nth-child(odd)::after { right: -6.2%; } /* Perfect alignment math */
.timeline-item:nth-child(even)::after { left: -6.2%; }

/* =========================================
   9. CONTACT FORM (Centered & Balanced)
   ========================================= */
.contact-form {
    max-width: 700px;   /* Prevents the form from being too wide on big screens */
    margin: 0 auto;     /* Centers the form itself */
    text-align: left;   /* Keeps labels/text inside the form looking tidy */
}

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 15px 20px;
    margin-bottom: 20px;
    border: 2px solid #eef2f7;
    border-radius: 12px;
    background: #fdfdfd;
    transition: all 0.3s ease;
}

.contact-form input:focus, .contact-form textarea:focus {
    border-color: var(--secondary-color);
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(136, 192, 208, 0.15);
}

/* =========================================
   10. LIVE OVERLAY
   ========================================= */
#projectOverlay {
    background: rgba(15, 23, 42, 0.9); /* Darker, richer overlay */
    backdrop-filter: blur(5px);
}

/* =========================================
   11. RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 768px) {
    .hero { padding: 120px 0 80px; clip-path: polygon(0 0, 100% 0, 100% 95%, 0 100%); }
    .hero h1 { font-size: 2.5rem; }
    
    /* Timeline collapses to single column */
    .timeline::before { left: 30px; }
    .timeline-item { width: 100%; left: 0 !important; padding-left: 80px; margin-bottom: 30px; }
    
    /* Move dot to the left side */
    .timeline-item::after {
        left: 21px !important;
        right: auto !important;
    }
}

/* --- Filter Navigation --- */
.filter-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 25px;
    border-radius: 50px;
    border: 2px solid var(--secondary-color);
    background: transparent;
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.filter-btn:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-3px);
}

.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(94, 129, 172, 0.4);
}

/* --- Refined Project Card States --- */
.project-card {
    /* ... existing styles ... */
    display: flex;
    flex-direction: column;
    height: 100%;
    opacity: 0; /* Starts hidden for the animation */
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-color);
    z-index: 2;
}
.project-video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This makes sure the animation fills the card area */
    display: block;
}

.img-wrapper {
    position: relative;
    overflow: hidden;
    height: 200px; /* Adjust based on your card design */
    background: #000;
}
