/* --- CORE VARIABLES & PRESET STYLES --- */
:root {
    --bg-color: #0b0b0f;
    --text-color: #f5f5f7;
    --accent-color: #0071e3;
    --card-bg: #16161d;
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.light-mode {
    --bg-color: #f5f5f7;
    --text-color: #1d1d1f;
    --accent-color: #0071e3;
    --card-bg: #ffffff;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    transition: var(--transition);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.section {
    padding: 8rem 0 4rem 0;
}

.bg-light {
    background-color: rgba(0, 113, 227, 0.02);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 4rem;
    letter-spacing: -1px;
}

.section-title span {
    color: var(--accent-color);
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background-color: var(--accent-color);
    color: #ffffff;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 113, 227, 0.4);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    margin-left: 1rem;
}

.btn-outline:hover {
    background-color: var(--accent-color);
    color: #ffffff;
}

/* --- SYSTEM UTILITIES --- */
#loader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: #0b0b0f;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.loader-circle {
    width: 50px; height: 50px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s infinite linear;
    margin-bottom: 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

#progress-bar {
    position: fixed;
    top: 0; left: 0; height: 4px;
    background-color: var(--accent-color);
    z-index: 9999;
    width: 0%;
}

#topBtn {
    position: fixed;
    bottom: 2rem; right: 2rem;
    width: 45px; height: 45px;
    background-color: var(--accent-color);
    color: #fff; border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 0; visibility: hidden;
    transition: var(--transition); z-index: 999;
}

#topBtn.show { opacity: 1; visibility: visible; }

/* --- HEADER NAVIGATION --- */
header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    background-color: rgba(11, 11, 15, 0.8);
    backdrop-filter: blur(12px);
    z-index: 995;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.light-mode header {
    background-color: rgba(245, 245, 247, 0.8);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo span { color: var(--accent-color); }

#navbar ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

#navbar ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 400;
    transition: var(--transition);
    opacity: 0.7;
}

#navbar ul li a:hover, #navbar ul li a.active {
    opacity: 1;
    color: var(--accent-color);
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#themeBtn, #menuBtn {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

#menuBtn { display: none; } /* Desktop par desktop menu dikhega */

/* --- HERO DESIGN SECTION --- */
#home {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding-top: 60px;
}

#particles-js {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-left h3 {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.hero-left h1 {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.hero-left h1 span { color: var(--accent-color); }

.hero-left h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    height: 40px;
}

.hero-left p {
    font-size: 1.05rem;
    line-height: 1.6;
    opacity: 0.8;
    margin-bottom: 2.5rem;
    max-width: 550px;
}

.social-icons {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}

.social-icons a {
    color: var(--text-color);
    font-size: 1.3rem;
    transition: var(--transition);
    opacity: 0.6;
}

.social-icons a:hover {
    opacity: 1;
    color: var(--accent-color);
    transform: translateY(-3px);
}

.hero-right {
    display: flex;
    justify-content: center;
}

/* Profile Image Handling Fix */
.profile-card {
    width: 320px;
    height: 320px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--accent-color);
    box-shadow: var(--shadow);
}

.profile-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- ABOUT SECTION & COUNTERS --- */
.about-content {
    max-width: 800px;
    margin: 0 auto 4rem auto;
    text-align: center;
}

.about-text h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.about-text p {
    line-height: 1.7;
    opacity: 0.8;
    margin-bottom: 1.5rem;
}

.counters-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 4rem;
}

.counter-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.counter-card i {
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.counter-card span {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* --- SKILLS MATRIX --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
}

.skills-category h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
}

.skill-bar {
    margin-bottom: 1.5rem;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.bar-outer {
    width: 100%;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.bar-inner {
    height: 100%;
    background-color: var(--accent-color);
    border-radius: 10px;
}

/* --- SERVICES DESIGN --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.service-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-card i {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.service-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.service-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    opacity: 0.7;
}

/* --- PORTFOLIO IMAGELESS SEARCH & CARDS --- */
.project-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 0.8rem 1.5rem 0.8rem 3rem;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
    outline: none;
}

.search-box i {
    position: absolute;
    left: 1.2rem; top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
}

.filter-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn.active, .filter-btn:hover {
    background-color: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* Premium Gradient Configuration */
.project-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    height: 250px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 5;
}

.gradient-1 { background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); }
.gradient-2 { background: linear-gradient(135deg, #130cb7, #52e5e7); }
.gradient-3 { background: linear-gradient(135deg, #000000, #434343); }
.gradient-4 { background: linear-gradient(135deg, #8a2387, #e94057, #f27121); }
.gradient-5 { background: linear-gradient(135deg, #11998e, #38ef7d); }
.gradient-6 { background: linear-gradient(135deg, #1f4068, #162447, #1b1a17); }

.card-gradient-title {
    text-align: center;
    color: #ffffff;
    z-index: 1;
    padding: 1.5rem;
    transition: var(--transition);
}

.card-gradient-title i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    color: #ffffff;
}

.card-gradient-title h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.project-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(11, 11, 15, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    padding: 1.5rem;
    text-align: center;
    z-index: 10;
}

.project-card:hover .project-overlay { opacity: 1; }

.project-overlay h3 { margin-bottom: 0.5rem; font-size: 1.3rem; color: #fff;}
.project-overlay p { font-size: 0.9rem; color: var(--accent-color); margin-bottom: 1.5rem; }

.view-details-btn {
    position: relative;
    z-index: 20;
    cursor: pointer;
}

/* --- PREMIUM SYSTEM MODALS LOGIC --- */
.modal {
    display: none; 
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #16161d;
    color: #ffffff;
    padding: 2.5rem;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 71, 227, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 1.5rem; right: 1.5rem;
    font-size: 2rem; cursor: pointer;
    color: #888; transition: 0.2s;
}
.close-modal:hover { color: #ff4a4a; }

.modal-category { color: var(--accent-color); font-size: 0.95rem; margin-bottom: 1rem; }
.modal-desc { line-height: 1.6; color: #ccc; margin-bottom: 1.5rem; }
.modal-tech-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.tech-tag {
    background: rgba(0, 113, 227, 0.2);
    color: #0071e3; padding: 0.4rem 0.9rem;
    border-radius: 20px; font-size: 0.85rem;
    border: 1px solid rgba(0, 113, 227, 0.3);
}

/* --- TIMELINE EDUCATION SETUP --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: ''; position: absolute;
    width: 2px; background-color: var(--border-color);
    top: 0; bottom: 0; left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 1rem 2rem;
    position: relative;
    width: 50%;
}

.timeline-item.left { left: 0; }
.timeline-item.right { left: 50%; }

.timeline-dot {
    width: 16px; height: 16px;
    background-color: var(--accent-color);
    position: absolute; border-radius: 50%;
    top: 25px; z-index: 10;
}
.left .timeline-dot { right: -8px; }
.right .timeline-dot { left: -8px; }

.timeline-content {
    padding: 2rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.timeline-content .date {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.timeline-content h3 { margin: 0.5rem 0; font-size: 1.25rem; }
.timeline-content h4 { font-weight: 500; opacity: 0.7; font-size: 1rem; margin-bottom: 0.5rem;}
.timeline-content p { font-size: 0.9rem; opacity: 0.6; line-height: 1.5; }

/* --- CERTIFICATIONS LAYOUT --- */
.certificates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.cert-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 2rem; border-radius: 16px;
    text-align: center; box-shadow: var(--shadow);
}

.cert-icon {
    width: 50px; height: 50px;
    background-color: rgba(0, 113, 227, 0.1);
    color: var(--accent-color);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.5rem auto; font-size: 1.2rem;
}

.cert-card h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.cert-card p { font-size: 0.9rem; opacity: 0.6; }

/* --- CONTACT SYSTEM --- */
.contact-wrapper {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 4rem;
}

.contact-info h3 { font-size: 1.8rem; margin-bottom: 1rem; }
.contact-info p { opacity: 0.7; line-height: 1.6; margin-bottom: 2rem; }

.info-item {
    display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem;
}

.info-item i {
    width: 40px; height: 40px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--accent-color);
}

.contact-form {
    display: flex; flex-direction: column; gap: 1.5rem;
}

.form-group { position: relative; }

.contact-form input, .contact-form textarea {
    width: 100%; padding: 1rem 1.5rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px; color: var(--text-color);
    outline: none; transition: var(--transition);
}

.contact-form input:focus, .contact-form textarea:focus {
    border-color: var(--accent-color);
}

.error-msg {
    color: #ff4a4a; font-size: 0.8rem;
    position: absolute; bottom: -1.2rem; left: 0.5rem;
    display: none;
}

/* --- FOOTER ASSEMBLY --- */
footer {
    border-top: 1px solid var(--border-color);
    padding: 2rem 0; background-color: var(--bg-color);
}

.footer-container {
    display: flex; justify-content: space-between; align-items: center;
}

.footer-container p { font-size: 0.9rem; opacity: 0.6; }
.footer-socials { display: flex; gap: 1.5rem; }
.footer-socials a { color: var(--text-color); opacity: 0.6; font-size: 1.2rem; }
.footer-socials a:hover { opacity: 1; color: var(--accent-color); }


/* ==========================================================================
   CRITICAL MOBILE AND TABLET RESPONSIVE REPAIR CODES (MEDIA QUERIES)
   ========================================================================== */

@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
        padding-top: 4rem;
    }
    .hero-left h1 { font-size: 3rem; }
    .hero-left p { margin: 1.5rem auto 2.5rem auto; }
    .social-icons { justify-content: center; }
    
    .skills-grid, .services-grid, .projects-grid, .certificates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .contact-wrapper { grid-template-columns: 1fr; gap: 3rem; }
}

@media (max-width: 768px) {
    .section { padding: 5rem 0 3rem 0; }
    .section-title { font-size: 2rem; margin-bottom: 2.5rem; }

    /* --- HERO CONTAINER HEIGHT & OVERLAP FIX --- */
    #home {
        height: auto !important; /* Fixed 100vh ko khatam karega taake image upar na chupe */
        padding-top: 120px !important; /* Header ke niche se clear space dega */
        padding-bottom: 4rem;
        display: flex;
        align-items: center;
    }

    .hero-container {
        display: flex;
        flex-direction: column-reverse; /* Photo pehle, text baad mein */
        gap: 2.5rem;
        text-align: center;
    }

    /* --- PROFILE CARD SCALE & CLEAR VISIBILITY --- */
    .hero-right {
        display: flex;
        justify-content: center;
        width: 100%;
        margin-top: 10px;
        margin-bottom: 10px;
    }

    .profile-card {
        width: 200px; /* Mobile ke liye perfect size */
        height: 200px;
        margin: 0 auto;
        position: relative;
        z-index: 10; /* Is se image header ke peeche nahi chupegi */
    }

    .hero-left h1 { 
        font-size: 2.2rem; 
        line-height: 1.2;
    }
    
    .hero-left h2 { 
        font-size: 1.3rem; 
        height: auto; 
        margin-bottom: 1.5rem; 
    }

    .hero-left p {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }

    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .btn-outline { margin-left: 0; width: 100%; max-width: 240px; text-align: center; }
    .hero-left .btn { width: 100%; max-width: 240px; text-align: center; }

    /* --- HAMBURGER MENU TOGGLE --- */
    #menuBtn {
        display: block; 
        z-index: 1000;
    }

    #navbar {
        position: fixed;
        top: 0; right: -100%; 
        width: 70%; height: 100vh;
        background-color: #111116;
        box-shadow: -5px 0 15px rgba(0,0,0,0.5);
        transition: 0.4s ease;
        z-index: 999;
    }

    .light-mode #navbar {
        background-color: #ffffff;
    }

    #navbar.active {
        right: 0; 
    }

    #navbar ul {
        flex-direction: column;
        padding: 6rem 3rem;
        gap: 1.5rem;
    }

    #navbar ul li a {
        font-size: 1.2rem;
        display: block;
    }

    .skills-grid, .services-grid, .projects-grid, .certificates-grid {
        grid-template-columns: 1fr; 
    }

    .counters-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .timeline::after { left: 20px; }
    .timeline-item { width: 100%; padding-left: 3.5rem; padding-right: 0; }
    .timeline-item.right { left: 0; }
    .timeline-dot { left: 12px !important; }
    
    .footer-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}