/* --- Variables & Reset --- */
:root {
    --primary: #4CAF50; 
    --primary-dark: #388E3C;
    --dark: #2c3e50;
    --light: #f9f9f9;
    --white: #ffffff;
    --text-grey: #666;
    --card-shadow: 0 10px 40px rgba(0,0,0,0.08); 
    --hover-shadow: 0 20px 50px rgba(0,0,0,0.12);
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Poppins', sans-serif;
    --font-accent: 'Playfair Display', serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); background-color: var(--white); color: var(--dark); overflow-x: hidden; }

/* --- Loader --- */
#loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--white); z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.5s;
}
.loader-text { font-family: var(--font-heading); font-size: 2rem; color: var(--dark); margin-bottom: 10px; }
.loader-text .dot { color: var(--primary); }
.loader-line { width: 50px; height: 3px; background: var(--primary); animation: loadLine 1s infinite ease-in-out; }
@keyframes loadLine { 0% { width: 0; } 50% { width: 50px; } 100% { width: 0; transform: translateX(50px); } }

/* --- Navbar --- */
.navbar {
    position: fixed; top: 0; width: 100%; padding: 15px 5%;
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255,255,255,0.95); backdrop-filter: blur(10px);
    z-index: 1000; box-shadow: 0 2px 20px rgba(0,0,0,0.03);
}
.logo { font-family: var(--font-heading); font-size: 22px; font-weight: 700; color: var(--dark); }
.logo .highlight { color: var(--primary); }
.nav-links { list-style: none; display: flex; gap: 30px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text-grey); font-weight: 500; font-size: 14px; transition: 0.3s; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.btn-nav { padding: 8px 20px; border: 2px solid var(--primary); border-radius: 50px; color: var(--primary) !important; }
.btn-nav:hover { background: var(--primary); color: white !important; }
.menu-icon { display: none; font-size: 24px; cursor: pointer; color: var(--dark); }
.mobile-menu {
    position: fixed; top: 0; right: -100%; width: 80%; height: 100%; background: white;
    box-shadow: -5px 0 30px rgba(0,0,0,0.1); z-index: 1001; display: flex; flex-direction: column;
    justify-content: center; align-items: center; gap: 30px; transition: 0.4s;
}
.mobile-menu.active { right: 0; }
.mobile-menu a { text-decoration: none; color: var(--dark); font-size: 20px; font-weight: 600; }
.close-menu { position: absolute; top: 30px; right: 30px; font-size: 30px; cursor: pointer; }

/* --- Hero Section --- */
.hero {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; padding: 120px 5% 50px;
    background: linear-gradient(135deg, #fff 0%, #f4f9f4 100%);
}
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.6; z-index: 0; }
.blob-1 { top: -10%; right: -10%; width: 500px; height: 500px; background: #e0f2f1; }
.blob-2 { bottom: -10%; left: -10%; width: 400px; height: 400px; background: #e8f5e9; }
.hero-container { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 1200px; z-index: 1; gap: 50px; }
.hero-text { flex: 1.2; }
.greeting { font-family: var(--font-accent); color: var(--primary); font-size: 18px; display: block; margin-bottom: 10px; font-style: italic; }
.full-name { font-family: var(--font-heading); font-size: 3.5rem; line-height: 1.2; margin-bottom: 15px; color: var(--dark); white-space: nowrap; }
.typewriter-container { font-size: 1.2rem; color: var(--text-grey); margin-bottom: 25px; font-weight: 400; }
.typing { color: var(--primary); font-weight: 600; }
.bio { font-size: 1rem; color: var(--text-grey); line-height: 1.8; margin-bottom: 35px; max-width: 90%; }
.cta-group { display: flex; gap: 15px; }
.btn { padding: 12px 30px; border-radius: 50px; text-decoration: none; font-weight: 600; transition: 0.3s; cursor: pointer; display: inline-block; }
.primary-btn { background: var(--primary); color: white; box-shadow: 0 10px 20px rgba(76, 175, 80, 0.3); }
.primary-btn:hover { transform: translateY(-3px); box-shadow: 0 15px 25px rgba(76, 175, 80, 0.4); }
.outline-btn { border: 2px solid var(--dark); color: var(--dark); }
.outline-btn:hover { background: var(--dark); color: white; }
.socials { margin-top: 30px; }
.socials a { color: var(--text-grey); font-size: 20px; margin-right: 20px; transition: 0.3s; }
.socials a:hover { color: var(--primary); transform: translateY(-3px); display: inline-block; }
.hero-image { flex: 1; display: flex; justify-content: flex-end; position: relative; }
.img-box { width: 480px; height: 480px; position: relative; }
.img-box img {
    width: 100%; height: 100%; object-fit: cover;
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    box-shadow: 20px 20px 60px rgba(0,0,0,0.1);
    animation: float 6s ease-in-out infinite; background: white; border: 5px solid white;
}
@keyframes float { 0%, 100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; transform: translateY(0); } 50% { border-radius: 50% 50% 30% 70% / 50% 50% 70% 30%; transform: translateY(-15px); } }

/* --- Sections Common --- */
.section { padding: 100px 5%; }
.bg-light { background: #f8fcf8; }
.container { max-width: 1100px; margin: auto; }
.section-header { text-align: center; margin-bottom: 60px; }
.tag { color: var(--primary); font-family: var(--font-accent); font-size: 16px; font-weight: 600; display: block; margin-bottom: 5px; }
.section-header h2 { font-size: 2.2rem; color: var(--dark); }

/* --- 🔥 NEW COMPACT PROJECT CARD CSS --- */
.projects-list { display: flex; flex-direction: column; gap: 50px; }

.compact-card {
    display: flex; align-items: center; background: white; border-radius: 25px; overflow: hidden;
    box-shadow: var(--card-shadow); transition: 0.4s; min-height: 350px;
}
.compact-card:hover { transform: translateY(-5px); box-shadow: var(--hover-shadow); }

/* Left side (Image) */
.compact-visual {
    flex: 1; height: 400px; /* Fixed height for consistency */
    background: #e8f5e9; /* Soft green background */
    display: flex; align-items: center; justify-content: center; position: relative;
    overflow: hidden;
}
.visual-orange { background: #fff3e0; } /* Orange bg for second project */

.phone-mockup {
    width: auto; height: 85%; /* Fits nicely inside */
    object-fit: contain; filter: drop-shadow(0 20px 30px rgba(0,0,0,0.15));
    transition: 0.5s;
}
.compact-card:hover .phone-mockup { transform: scale(1.05) rotate(-2deg); }

/* Right side (Content) */
.compact-content { flex: 1.2; padding: 40px 50px; }
.p-tag { font-size: 12px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 1px; display: block; margin-bottom: 10px; }
.private-tag { color: #ff9800; }
.compact-content h3 { font-size: 2rem; margin-bottom: 15px; color: var(--dark); }
.compact-content p { color: var(--text-grey); line-height: 1.7; margin-bottom: 25px; font-size: 15px; }

/* Tech Tags */
.tech-row { display: flex; gap: 15px; margin-bottom: 30px; flex-wrap: wrap; }
.tech-row span {
    background: var(--light); padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--dark); display: flex; align-items: center; gap: 6px;
}
.tech-row span i { color: var(--primary); }

/* Buttons */
.compact-actions { display: flex; gap: 15px; }
.btn-compact {
    padding: 12px 25px; border-radius: 50px; text-decoration: none; font-weight: 600; font-size: 14px; cursor: pointer; transition: 0.3s; display: flex; align-items: center; gap: 8px; border: none;
}
.btn-compact.primary { background: var(--primary); color: white; box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3); }
.btn-compact.primary:hover { transform: translateY(-3px); }
.btn-compact.outline { background: transparent; border: 2px solid var(--dark); color: var(--dark); }
.btn-compact.outline:hover { background: var(--dark); color: white; }
.btn-compact.full { width: 100%; justify-content: center; }

/* Reverse Layout for 2nd Card */
.reverse { flex-direction: row-reverse; }


/* --- About --- */
.about-content { display: flex; gap: 50px; align-items: flex-start; }
.about-img { flex: 1; }
.about-img img { width: 100%; border-radius: 15px; box-shadow: var(--card-shadow); }
.about-text { flex: 1.5; }
.about-text p { color: var(--text-grey); margin-bottom: 15px; line-height: 1.7; font-size: 15px; text-align: justify; }

/* --- Gallery --- */
.gallery-grid { column-count: 3; column-gap: 20px; }
.g-item { margin-bottom: 20px; break-inside: avoid; border-radius: 10px; overflow: hidden; }
.g-item img { width: 100%; display: block; transition: 0.5s; }
.g-item:hover img { transform: scale(1.05); }

/* --- Contact / Footer --- */
.footer-section { padding-bottom: 20px; }
.contact-box { background: #e8f5e9; padding: 60px 30px; border-radius: 20px; text-align: center; }
.contact-box h2 { font-size: 2rem; margin-bottom: 15px; }
.contact-box p { color: var(--text-grey); margin-bottom: 25px; }
.contact-links { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-bottom: 40px; }
.contact-pill { background: rgba(64, 224, 208, 0.15); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, 0.4); padding: 10px 25px; border-radius: 50px; color: blach; text-decoration: none; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); box-shadow: inset 0 4px 8px rgba(255, 255, 255, 0.7), inset 0 -4px 8px rgba(0, 128, 100, 0.3), 0 8px 15px rgba(0, 50, 30, 0.15); transition: all 0.3s ease; }
.contact-pill:hover { background: rgba(64, 224, 208, 0.25); box-shadow: inset 0 5px 10px rgba(255, 255, 255, 0.9), inset 0 -5px 10px rgba(0, 128, 100, 0.4), 0 12px 20px rgba(0, 50, 30, 0.25); transform: translateY(-3px); }
.footer-bottom { border-top: 1px solid rgba(0,0,0,0.05); padding-top: 20px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: #888; }
.footer-socials a { color: var(--dark); margin-left: 15px; font-size: 16px; transition: 0.3s; }
.footer-socials a:hover { color: var(--primary); }

/* --- Modal --- */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); justify-content: center; align-items: center; }
.modal-content { width: 90%; max-width: 800px; position: relative; }
.video-container { position: relative; padding-bottom: 56.25%; height: 0; }
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.close-btn { position: absolute; top: -40px; right: 0; color: white; font-size: 35px; cursor: pointer; }

/* --- Animations --- */
.reveal-up, .reveal-left, .reveal-right { opacity: 0; transition: 0.8s ease-out; }
.reveal-up { transform: translateY(30px); }
.reveal-left { transform: translateX(-30px); }
.reveal-right { transform: translateX(30px); }
.active { opacity: 1; transform: translate(0, 0); }

/* --- Responsive --- */
@media (max-width: 900px) {
    .hero-container { flex-direction: column-reverse; text-align: center; }
    .hero-text { margin-top: 30px; }
    .hero-image { justify-content: center; }
    .img-box { width: 300px; height: 300px; }
    .full-name { font-size: 2.2rem; white-space: normal; }
    .cta-group, .socials { justify-content: center; }
    
    /* Project Card Responsive */
    .compact-card, .compact-card.reverse { flex-direction: column; height: auto; }
    .compact-visual { width: 100%; height: 300px; }
    .compact-content { padding: 30px; width: 100%; }
    
    .about-content { flex-direction: column; }
    .gallery-grid { column-count: 1; }
    .nav-links, .menu-icon { display: none; }
    .menu-icon { display: block; }
    .footer-bottom { flex-direction: column; gap: 15px; }
}

/* --- Responsive Mobile Fix --- */
@media (max-width: 900px) {
    
    /* Hero Section Fixes */
    .hero-container { 
        flex-direction: column-reverse; 
        text-align: center; 
        gap: 30px;
    }
    .hero-text { margin-top: 20px; }
    .hero-image { justify-content: center; }
    .img-box { width: 280px; height: 280px; }
    
    .full-name { 
        font-size: 2rem; 
        white-space: normal; /* নাম ভেঙে ২ লাইনে হলে সমস্যা নেই */
        line-height: 1.2;
    } 
    
    .cta-group, .socials { justify-content: center; }
    
    /* 🔥 PROJECT CARD FIX (Most Important) */
    .projects-list { gap: 40px; }

    .compact-card, .compact-card.reverse { 
        flex-direction: column !important; /* ছবি ও লেখা নিচে নিচে */
        height: auto !important; 
        min-height: auto !important;
    }

    /* ছবির সেকশন */
    .compact-visual { 
        width: 100% !important; 
        height: 250px !important; /* মোবাইলে ছবির হাইট ফিক্সড */
        flex: none;
    }

    .phone-mockup {
        height: 90% !important; /* ছবির সাইজ ঠিক রাখা */
        width: auto !important;
        transform: none !important; /* হোভার ইফেক্ট বন্ধ */
    }

    /* কন্টেন্ট সেকশন */
    .compact-content { 
        padding: 30px 25px !important; 
        width: 100% !important;
        text-align: center; /* টেক্সট সেন্টারে */
    }

    .compact-content h3 { font-size: 1.8rem; }
    .tech-row { justify-content: center; } /* টেকনোলজি ট্যাগ সেন্টারে */
    .compact-actions { justify-content: center; } /* বাটন সেন্টারে */

    /* Other Sections */
    .about-content { flex-direction: column; }
    .gallery-grid { column-count: 1; } /* গ্যালারি এক লাইনে */
    
    /* Menu & Footer */
    .nav-links, .menu-icon { display: none; }
    .menu-icon { display: block; }
    .footer-bottom { flex-direction: column; gap: 15px; }
}
