/* --- 1. CONFIGURATION & RESET --- */
:root {
    /* Palette: Deep Cyber-Blue & Neon Teal */
    --bg-body: #050507;
    --bg-panel: #0E0E12;
    --bg-card: rgba(20, 20, 25, 0.6);
    --text-main: #E0E0E0;
    --text-muted: #9494a0;
    --primary: #00F0FF; /* Electric Cyan */
    --secondary: #7000FF; /* Deep Electric Purple */
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --border: 1px solid rgba(255, 255, 255, 0.06);
    --border-hover: 1px solid rgba(0, 240, 255, 0.4);
    
    /* Spacing */
    --sidebar-width: 280px;
}

* { margin: 0; padding: 0; box-sizing: border-box; outline: none; text-decoration: none; list-style: none; scrollbar-width: thin; scrollbar-color: var(--primary) var(--bg-body); }

html { scroll-behavior: smooth; }

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
    display: flex;
}

/* --- ANIMATED BACKGROUND GRID --- */
.bg-grid {
    position: fixed; top: 0; left: 0; width: 200vw; height: 200vh; z-index: -1;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
    animation: moveGrid 20s linear infinite;
    opacity: 0.6;
}

@keyframes moveGrid {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-50px, -50px); }
}

/* --- SCROLL REVEAL ANIMATION CLASS --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- 2. SIDEBAR NAVIGATION --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0; top: 0;
    background: rgba(14, 14, 18, 0.95);
    backdrop-filter: blur(10px);
    border-right: var(--border);
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 100;
}

.logo { font-family: 'JetBrains Mono', monospace; font-size: 1.6rem; font-weight: 800; color: #fff; letter-spacing: -1px; }
.logo span { color: var(--primary); text-shadow: 0 0 15px rgba(0, 240, 255, 0.4); }

.nav-links { display: flex; flex-direction: column; gap: 10px; margin-top: -50px; }
.nav-link {
    display: flex; align-items: center; gap: 15px;
    padding: 12px 18px;
    color: var(--text-muted);
    font-weight: 500;
    border-radius: 8px;
    transition: 0.3s;
    font-size: 0.95rem;
    border: 1px solid transparent;
}
.nav-link i { width: 20px; text-align: center; font-size: 1.1rem; }
.nav-link:hover, .nav-link.active { 
    background: rgba(0, 240, 255, 0.05); 
    color: var(--primary); 
    border-color: rgba(0, 240, 255, 0.1);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.05);
}

.sidebar-footer { font-size: 0.8rem; color: var(--text-muted); opacity: 0.5; font-family: 'JetBrains Mono', monospace; }

/* --- 3. MAIN CONTENT AREA --- */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: 80px 100px;
}

h1, h2, h3 { font-family: 'Outfit', sans-serif; color: #fff; }
.mono-header { 
    font-family: 'JetBrains Mono', monospace; 
    color: var(--primary); 
    font-size: 0.9rem; 
    margin-bottom: 15px; 
    display: inline-block;
    padding: 5px 10px;
    background: rgba(0, 240, 255, 0.05);
    border-radius: 4px;
    border: 1px solid rgba(0, 240, 255, 0.1);
}

.section-title { font-size: 3rem; margin-bottom: 60px; font-weight: 800; letter-spacing: -1.5px; line-height: 1; }
.section-title span { 
    background: var(--gradient); 
    -webkit-background-clip: text; 
    background-clip: text; 
    -webkit-text-fill-color: transparent; 
}

section { margin-bottom: 180px; scroll-margin-top: 50px; }

/* --- 4. HERO SECTION --- */
.hero { min-height: 90vh; display: flex; flex-direction: column; justify-content: center; position: relative; }

.hero-badge {
    display: inline-block; padding: 8px 18px;
    background: rgba(0, 240, 255, 0.08); 
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: var(--primary); 
    font-family: 'JetBrains Mono', monospace; 
    font-size: 0.85rem;
    border-radius: 50px; 
    margin-bottom: 30px;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.1);
}

.hero h1 { font-size: 5rem; line-height: 1.05; margin-bottom: 20px; font-weight: 800; letter-spacing: -2px; }
.hero h1 .hero-last-name { color: #888; }
.hero-title {
    font-family: 'JetBrains Mono', monospace;
    color: var(--primary);
    margin-bottom: 25px;
    font-size: 1.8rem;
    height: 1.8rem;
    display: flex;
    align-items: center;
}

.hero-title::after {
    content: '|';
    animation: blink 1s step-start infinite;
    color: var(--text-main);
    margin-left: 5px;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-desc { 
    font-size: 1.15rem; 
    color: var(--text-muted); 
    max-width: 600px; 
    line-height: 1.8; 
    margin-bottom: 40px; 
}

.btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 16px 35px;
    background: var(--gradient);
    color: #000;
    font-weight: 700; border-radius: 50px;
    transition: 0.3s;
    font-size: 1rem;
    box-shadow: 0 10px 30px rgba(0, 240, 255, 0.2);
    border: none;
    cursor: pointer;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 15px 40px rgba(0, 240, 255, 0.4); }

.btn-outline { 
    background: transparent; 
    border: 1px solid rgba(255,255,255,0.2); 
    color: #fff; 
    box-shadow: none; 
}
.btn-outline:hover { 
    border-color: #fff; 
    background: rgba(255,255,255,0.05); 
    box-shadow: 0 5px 20px rgba(255,255,255,0.1); 
}

/* --- 5. ABOUT (Bento Layout) --- */
.bento-grid { display: grid; grid-template-columns: 1.8fr 1fr; gap: 30px; }

.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: var(--border);
    padding: 40px;
    border-radius: 20px;
    transition: 0.4s ease;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
.card:hover { 
    border-color: rgba(255, 255, 255, 0.2); 
    transform: translateY(-5px); 
    box-shadow: 0 20px 50px rgba(0,0,0,0.4); 
}

.about-description p { color: var(--text-muted); line-height: 1.8; font-size: 1.05rem; margin-top: 15px; }
.about-description p + p { margin-top: 15px; }
.about-description strong { color: #fff; font-weight: 600; }

.stat-row { display: flex; justify-content: space-between; margin-top: 35px; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 25px; }
.stat h4 { font-size: 2rem; color: #fff; font-weight: 700; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;}
.stat span { font-size: 0.85rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: 1px; }

.about-photo-card { padding: 12px; }
.about-photo { width: 100%; height: 320px; object-fit: cover; border-radius: 14px; filter: grayscale(10%); transition: 0.5s; }
.about-photo-card:hover .about-photo { filter: grayscale(0%); }

.about-meta { padding: 20px 10px 5px; }
.about-meta-item { display: flex; align-items: center; gap: 15px; margin-bottom: 12px; font-size: 0.95rem; color: var(--text-muted); }
.about-meta-item i { color: var(--primary); font-size: 1rem; width: 20px; text-align: center; text-shadow: 0 0 10px rgba(0, 240, 255, 0.5); }

/* --- 6. SKILLS --- */
.skills-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 25px; }
.skill-group {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    padding: 30px; 
    border-radius: 16px; 
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.3s;
}
.skill-group:hover { border-color: var(--primary); box-shadow: 0 0 30px rgba(0, 240, 255, 0.1); transform: translateY(-5px); }
.skill-group h3 { font-size: 1.1rem; margin-bottom: 20px; display: flex; align-items: center; gap: 12px; font-weight: 600; }
.skill-group h3 i { color: var(--secondary); font-size: 1.2rem; }
.tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
    background: rgba(255,255,255,0.05); color: #ccc;
    padding: 6px 14px; font-size: 0.8rem; border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.05);
    font-family: 'JetBrains Mono', monospace;
    transition: 0.2s;
}
.tag:hover { background: rgba(0, 240, 255, 0.1); color: var(--primary); border-color: rgba(0, 240, 255, 0.3); }

/* --- 7. EXPERIENCE --- */
.experience-list { position: relative; padding-left: 50px; display: flex; flex-direction: column; gap: 50px; }
.experience-list::before {
    content: ""; position: absolute; left: 15px; top: 0; bottom: 0; width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--secondary), transparent);
}
.experience-card {
    background: linear-gradient(145deg, rgba(20, 20, 25, 0.8), rgba(20, 20, 25, 0.4));
    border: 1px solid rgba(255,255,255,0.05);
    padding: 35px;
}
.experience-card::before {
    content: ""; position: absolute; left: -42px; top: 35px; width: 16px; height: 16px;
    background: var(--bg-body); border: 2px solid var(--primary); border-radius: 50%;
    box-shadow: 0 0 15px var(--primary);
    z-index: 2;
}
.experience-card h3 { font-size: 1.4rem; margin-bottom: 5px; color: #fff; }
.exp-company { font-size: 1rem; color: var(--secondary); margin-bottom: 15px; font-weight: 600; }
.exp-duration { 
    position: absolute; top: 35px; right: 35px; 
    font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; color: #fff; 
    background: rgba(112, 0, 255, 0.2); padding: 5px 12px; border-radius: 4px;
    border: 1px solid rgba(112, 0, 255, 0.3);
}
.exp-description { font-size: 0.95rem; color: var(--text-muted); line-height: 1.7; }

/* --- 8. EDUCATION --- */
.edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 30px; }
.edu-item {
    background: linear-gradient(180deg, rgba(20, 20, 25, 0.8), rgba(10, 10, 15, 0.8));
    padding: 35px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex; gap: 20px; transition: 0.3s;
}
.edu-item:hover { border-color: rgba(0, 240, 255, 0.3); transform: translateY(-5px); }
.edu-icon {
    width: 60px; height: 60px; background: rgba(255,255,255,0.03); border-radius: 12px;
    display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 1.8rem;
    flex-shrink: 0; box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}
.edu-content h4 { font-size: 1.2rem; margin-bottom: 5px; }
.edu-year { font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; color: var(--text-muted); display: block; margin-bottom: 10px; }
.edu-institute { font-weight: 600; color: #fff; margin-bottom: 5px; }

/* --- 9. PROJECTS --- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 35px; }
.project-card {
    background: rgba(20, 20, 25, 0.6); border: 1px solid rgba(255,255,255,0.05); 
    border-radius: 16px; overflow: hidden; height: 100%; display: flex; flex-direction: column;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.project-card:hover { transform: translateY(-10px); border-color: var(--secondary); box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5); }
.project-img-wrapper { position: relative; height: 200px; overflow: hidden; }
.project-img-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.project-card:hover img { transform: scale(1.1); filter: brightness(0.4); }
.overlay-actions {
    position: absolute; inset: 0; display: flex; gap: 20px;
    justify-content: center; align-items: center; opacity: 0; transition: 0.3s;
}
.project-card:hover .overlay-actions { opacity: 1; }
.action-btn {
    width: 50px; height: 50px; background: #fff; color: #000; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
    transition: 0.3s; transform: translateY(20px);
}
.project-card:hover .action-btn { transform: translateY(0); }
.action-btn:hover { background: var(--primary); }
.project-content { padding: 30px; flex-grow: 1; display: flex; flex-direction: column; }
.project-content h3 { font-size: 1.3rem; margin-bottom: 10px; color: #fff; }
.project-content p { font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 25px; flex-grow: 1; }
.stack-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.stack-item { 
    font-size: 0.75rem; color: var(--primary); 
    background: rgba(0, 240, 255, 0.08); 
    padding: 5px 12px; border-radius: 4px; 
    border: 1px solid rgba(0, 240, 255, 0.1);
}

/* --- 10. CERTIFICATES --- */
.cert-scroller { display: flex; gap: 30px; overflow-x: auto; padding: 20px 0 40px; scroll-snap-type: x mandatory; }
.cert-card {
    min-width: 320px; height: 260px; background: #0b0b0f; border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.08); overflow: hidden; scroll-snap-align: start;
    transition: 0.3s; cursor: pointer; position: relative;
}
.cert-card:hover { transform: translateY(-8px); border-color: var(--primary); box-shadow: 0 15px 30px rgba(0,0,0,0.5); }
.cert-img { width: 100%; height: 180px; object-fit: cover; }
.cert-info { padding: 15px 20px; background: #0E0E12; border-top: 1px solid rgba(255,255,255,0.05); }
.cert-info h4 { font-size: 1rem; color: #fff; margin-bottom: 5px; }

/* --- 11. CONTACT & FOOTER --- */
.contact-section { 
    background: linear-gradient(135deg, rgba(20, 20, 25, 0.9), rgba(10, 10, 15, 0.9));
    padding: 80px 40px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.05); text-align: center; 
    transition: 0.3s;
}
.contact-section:hover { border-color: rgba(0, 240, 255, 0.2); box-shadow: 0 0 50px rgba(0, 0, 0, 0.5); }

/* 🔥 SOCIAL FIX: Default */
.social-dock { 
    display: inline-flex; gap: 20px; padding: 15px 30px; 
    background: rgba(255,255,255,0.02); border-radius: 50px; margin-top: 40px; 
    border: 1px solid rgba(255,255,255,0.05); 
    flex-wrap: wrap; /* Allows wrapping */
    justify-content: center;
    max-width: 100%;
}

.social-icon { 
    width: 45px; height: 45px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; color: var(--text-muted); transition: 0.3s; background: rgba(255,255,255,0.05);
    font-size: 1.2rem;
    flex-shrink: 0;
}
.social-icon:hover { background: #fff; color: #000; transform: translateY(-5px) scale(1.1); box-shadow: 0 0 20px rgba(255,255,255,0.5); }

.footer { text-align: center; padding: 50px 0 20px; color: rgba(255,255,255,0.4); font-size: 0.9rem; }

/* --- 12. MODAL LOGIC (FIXED) --- */
.cert-modal { 
    position: fixed; inset: 0; background: rgba(0,0,0,0.95); display: none; 
    align-items: center; justify-content: center; z-index: 2000; backdrop-filter: blur(10px);
    opacity: 0; transition: opacity 0.3s ease;
}
.cert-modal.active { opacity: 1; }
.cert-modal img { 
    max-width: 90%; max-height: 80vh; 
    border-radius: 12px; border: 2px solid var(--primary); 
    box-shadow: 0 0 50px rgba(0, 240, 255, 0.2); 
    transform: scale(0.9); transition: 0.3s; 
}
.cert-modal.active img { transform: scale(1); }

/* 🔥 CLOSE BUTTON FIX */
.cert-close { 
    position: absolute; 
    top: 20px; right: 20px; /* Moves closer to corner */
    font-size: 2rem; 
    color: #fff; /* White Icon */
    background: rgba(0,0,0,0.6); /* Dark background to see on white certs */
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; 
    transition: 0.3s; 
    z-index: 2010; /* Ensures it's on top of image */
    border: 1px solid rgba(255,255,255,0.2);
}
.cert-close:hover { 
    background: var(--primary); 
    color: #000; 
    transform: rotate(90deg); 
}

/* --- RESPONSIVE FIXES --- */
@media (max-width: 1024px) {
    body { flex-direction: column; }
    .sidebar { width: 100%; height: auto; padding: 20px; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); position: sticky; top: 0; flex-direction: row; align-items: center; }
    .nav-links { display: none; } 
    .main-content { margin-left: 0; width: 100%; padding: 50px 25px; }
    .hero h1 { font-size: 3.2rem; }
    .bento-grid { grid-template-columns: 1fr; }
    .sidebar-footer { display: none; }
    .edu-grid { grid-template-columns: 1fr; }
    .exp-duration { position: relative; top: 0; right: 0; display: inline-block; margin-bottom: 10px; }
}

/* 🔥 MOBILE SPECIFIC FIXES (Under 768px) */
@media (max-width: 768px) {
    /* Fix Social Dock Overflow */
    .contact-section { padding: 40px 20px; }
    
    .social-dock {
        width: 100%; /* Force width */
        display: flex; /* Flexbox */
        flex-wrap: wrap; /* Wrap if too many icons */
        justify-content: center; /* Center them */
        gap: 15px; /* Smaller gap */
        padding: 15px; /* Smaller padding */
        border-radius: 20px;
    }
    
    /* Fix Close Button on Small Screens */
    .cert-close {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
    
    /* Ensure modal image doesn't touch edges */
    .cert-modal img {
        max-width: 95%;
    }
}