/* --- Global Styles --- */
:root {
    --bg-black-900: #151515;
    --bg-black-100: #222222;
    --bg-black-50: #2b2b2b;
    --text-black-900: #f0f0f0;
    --text-black-700: #a0a0a0;
    --skin-color: #34d399; 
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    list-style: none;
    outline: none;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--bg-black-900);
    color: var(--text-black-900);
    line-height: 1.5;
    overflow: hidden; 
}

/* --- Particle Background --- */
#tsparticles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; 
}

.main-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
    z-index: 1;
}

/* --- Sparkle Effect (Cursor) --- */
.sparkle {
    position: absolute;
    pointer-events: none;
    animation: sparkle-anim 1s linear forwards;
    user-select: none;
    z-index: 9999;
    font-weight: bold;
}

@keyframes sparkle-anim {
    0% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
    100% { transform: translate(-50%, 100px) scale(0) rotate(180deg); opacity: 0; }
}

/* --- Sidebar --- */
.sidebar {
    width: 270px;
    height: 100vh;
    background: rgba(34, 34, 34, 0.6); 
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.3s ease;
}

.sidebar .logo {
    position: absolute;
    top: 50px;
    font-size: 30px;
    font-weight: 700;
}
.sidebar .logo a { color: var(--text-black-900); }
.sidebar .logo span { font-family: cursive; font-size: 40px; }

/* Hamburger */
.nav-toggler {
    display: none;
    height: 30px;
    width: 30px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    z-index: 101;
}
.nav-toggler span {
    height: 2px;
    width: 100%;
    background-color: var(--skin-color);
    display: block;
    transition: 0.3s;
}
.nav-toggler.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggler.open span:nth-child(2) { opacity: 0; }
.nav-toggler.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.sidebar .nav { margin-top: 50px; }
.sidebar .nav li { margin-bottom: 20px; display: block; }
.sidebar .nav li a {
    font-size: 16px; font-weight: 600;
    color: var(--text-black-900);
    padding: 5px 15px;
    border-bottom: 1px solid transparent;
    display: flex; align-items: center;
    transition: all 0.3s ease;
    cursor: pointer !important; 
}
.sidebar .nav li a i { margin-right: 15px; font-size: 20px; }
.sidebar .nav li a.active, .sidebar .nav li a:hover { color: var(--skin-color); }
.sidebar .nav li a.active i, .sidebar .nav li a:hover i { color: var(--skin-color); }

/* --- Main Content --- */
.main-content {
    margin-left: 270px; 
    width: calc(100% - 270px);
    height: 100vh;
    overflow: hidden;
}

.section {
    background: rgba(21, 21, 21, 0.7); 
    backdrop-filter: blur(5px);
    height: 100%;
    padding: 0 30px;
    overflow-y: auto; 
}

.container {
    max-width: 1100px;
    width: 100%;
    margin:auto;
    padding-bottom: 80px;
}

/* --- Home --- */
.home-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100vh;
    padding: 0 60px;
}
.home-text { flex: 0 0 60%; max-width: 60%; }
.home-text h1 { font-size: 30px; font-weight: 700; margin: 15px 0; }
.home-text h1 .name { color: var(--skin-color); font-size: 40px; }
.home-text h2 { font-size: 30px; margin-bottom: 20px; }
.home-text p { margin-bottom: 30px; font-size: 16px; color: var(--text-black-700); }
.btn {
    display: inline-block; padding: 12px 35px;
    background: var(--skin-color); color: #fff;
    border-radius: 30px; margin-right: 20px;
    font-weight: 500; transition: all 0.3s;
    border: none;
    cursor: pointer !important;
}
.btn:hover { background: #2cb581; }
.home-img { flex: 0 0 40%; max-width: 40%; text-align: center; }
.home-img img {
    width: 300px; height: 300px;
    border-radius: 5px; object-fit: cover;
    border: 5px solid var(--bg-black-50);
}

/* --- General Content --- */
.title { width: 100%; text-align: left; margin-bottom: 40px; padding-top: 60px; }
.title h2 { font-size: 30px; font-weight: 700; color: var(--skin-color); }
.about-content h3 { font-size: 24px; margin-bottom: 15px; }
.about-content p { color: var(--text-black-700); margin-bottom: 20px; }
.about-details { display: flex; justify-content: space-between; margin-bottom: 30px; flex-wrap: wrap;}
.info-column ul li { margin-bottom: 10px; font-weight: 500; }
.skill-box { margin-bottom: 20px; }
.progress-bar { height: 8px; background: var(--bg-black-50); border-radius: 10px; }
.progress { height: 100%; background: var(--skin-color); border-radius: 10px; }


/* --- FIXED PROJECTS & ACHIEVEMENTS GRID --- */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    width: 100%;
}

.gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer !important;
    transition: transform 0.3s ease;
    background: var(--bg-black-50);
    aspect-ratio: 16/9;
    display: flex;
    flex-direction: column;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Style for PROJECT images */
.project-item img {
    width: 100%;  
    height: 100%; 
    object-fit: cover; 
    display: block;
}

/* Style for CERTIFICATE images */
.certificate-item img {
    width: 100%;
    height: 100%; 
    object-fit: cover; 
    display: block;
}

.project-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%; 
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    pointer-events: none;
}

.project-item:hover .project-overlay {
    transform: translateY(0);
}

.project-overlay h3 { margin: 0 0 5px 0; font-size: 18px; color: var(--skin-color); }
.project-overlay p { margin: 0; font-size: 14px; }
.btn-sm {
    background: var(--skin-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    margin-top: 10px;
    display: inline-block;
}

/* --- END OF GRID FIX --- */

/* --- MODAL STYLES --- */
.modal {
    display: none;
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.9); 
}
.modal-content {
    margin: 5% auto;
    padding: 20px;
    max-width: 800px;
    width: 90%; 
    background-color: var(--bg-black-100);
    border-radius: 10px;
    text-align: center;
    position: relative;
}
#modalImage {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 20px;
}
.close-btn {
    color: var(--skin-color);
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer !important;
    transition: 0.3s;
}
.close-btn:hover { color: #fff; }
.modal-btn { display: inline-block; margin-top: 10px; }

/* --- THANK YOU POPUP STYLES --- */
.popup-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
}
.popup-content {
    background: var(--bg-black-100);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid var(--skin-color);
    animation: popupScale 0.4s ease;
}
@keyframes popupScale {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
.popup-content h2 { color: var(--skin-color); margin: 10px 0; font-size: 28px; }
.popup-content p { color: var(--text-black-700); margin-bottom: 20px; }
.heart-icon { font-size: 50px; margin-bottom: 10px; }

/* --- HEART BURST ANIMATION --- */
.heart-particle {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    pointer-events: none;
    z-index: 3000;
    animation: heartBurst 1.5s ease-out forwards;
}
@keyframes heartBurst {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(1.5); opacity: 0; }
}

/* --- Contact Form --- */
.contact-container { display: flex; flex-wrap: wrap; gap: 30px; }
.contact-info { flex: 1; text-align: center; min-width: 250px; }
.contact-info i { font-size: 25px; color: var(--skin-color); margin-bottom: 10px; }
.contact-form { flex: 2; min-width: 300px; }
.form-group { display: flex; gap: 15px; }
.form-control {
    width: 100%; height: 50px; border-radius: 25px;
    background: var(--bg-black-50); border: 1px solid transparent;
    padding: 0 25px; font-size: 16px; color: var(--text-black-900);
    margin-bottom: 20px;
    cursor: text !important;
}
.form-control:focus { border-color: var(--skin-color); }
textarea.form-control { height: 140px; padding-top: 15px; resize: none; }

/* --- Mobile Responsive --- */
@media (max-width: 991px) {
    .sidebar {
        width: 100%; height: 60px;
        padding: 0 20px; flex-direction: row;
        justify-content: space-between; align-items: center;
        border-right: none; border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    .sidebar .logo { position: static; font-size: 24px; }
    .sidebar .logo span { font-size: 30px; }
    .nav-toggler { display: flex; }
    .sidebar .nav {
        position: absolute; top: 60px; left: 0; width: 100%; 
        background: rgba(34, 34, 34, 0.9); 
        padding: 10px 0; border-top: 1px solid #333;
        transform: scaleY(0); transform-origin: top;
        transition: transform 0.3s ease;
        opacity: 0; visibility: hidden; z-index: 100;
    }
    .sidebar .nav.open { transform: scaleY(1); opacity: 1; visibility: visible; }
    .sidebar .nav li { margin: 0; }
    .sidebar .nav li a { padding: 15px 30px; width: 100%; }

    .main-content {
        margin-left: 0; width: 100%; margin-top: 60px;
        height: calc(100vh - 60px);
    }
    .home-container {
        flex-direction: column-reverse; justify-content: center;
        padding: 0 20px; text-align: center;
        height: auto; min-height: 100%;
        padding-top: 40px; padding-bottom: 40px;
    }
    .home-text, .home-img { max-width: 100%; flex: 0 0 auto; }
    .home-img { margin-bottom: 30px; }
    .home-img img { width: 200px; height: 200px; }
    .section { padding: 0 20px; }
    .form-group { flex-direction: column; gap: 0; }
}
