@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Roboto+Mono:wght@400;500&display=swap');

/* FINAL COLOR PALETTE:
  --primary-color: #9333ea (Vibrant Purple)
  --background-color: #0a0a10 (Dark Charcoal)
  --card-background: #1a1a23 (Slightly Lighter Charcoal)
  --text-light: #f0f0f0 (Off-white)
  --text-muted: #a0a0b0 (Light Gray)
  --border-color: #2a2a35 (Subtle Border)
*/
:root {
    --primary-color: #9333ea; 
    --background-color: #0a0a10;
    --card-background: #1a1a23; 
    --text-light: #f0f0f0; 
    --text-muted: #a0a0b0; 
    --border-color: #2a2a35;
    --hover-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

html, body {
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--background-color);
    color: var(--text-light);
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem;
}

section {
    padding: 2.5rem 0;
    margin-bottom: 2rem;
    background-color: transparent;
    border-radius: 8px;
}

h3 {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text-light);
    margin: 0 0 2rem 0;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

h3 i {
    color: var(--primary-color);
    margin-right: 1rem;
}

h4 {
    font-size: 1.4rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    font-weight: 600;
    /* Added transition for smooth color change */
    transition: color 0.3s ease;
}

p {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    filter: brightness(1.2);
}

.hero {
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: clamp(3rem, 10vw, 5.5rem);
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.hero h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 500;
}

.hero .subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 700px;
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(147, 51, 234, 0.25);
}

.portfolio-grid,
.research-grid,
.education-grid,
.training-grid,
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Styles for the link wrapping the project card */
.project-card-link {
    text-decoration: none;
}
/* This prevents the brightness filter from applying to the card link */
.project-card-link:hover {
    filter: none;
}

.project-card,
.finding-card,
.education-entry,
.training-card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* REMOVED height: 100% to fix sizing issue */
}

/* Hover effect on the card now matches the CTA button */
.project-card-link:hover .project-card {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(147, 51, 234, 0.25);
}

/* This changes ONLY the H4 color when the H4 is hovered */
.project-card h4:hover {
    color: var(--primary-color);
}

.finding-card:hover,
.education-entry:hover,
.training-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--hover-shadow);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.card-header i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-right: 1rem;
}

.project-card p,
.finding-card p,
.training-card p {
    flex-grow: 1;
    color: var(--text-muted);
}

.education-entry .degree {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    flex-grow: 1;
}

.education-entry .details {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 0;
}

.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.skills-container span {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 0.7rem 1.3rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    transition: transform 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    position: relative;
}

.skills-container span:hover {
    transform: translateY(-3px);
    color: var(--primary-color);
    border-color: var(--primary-color);
    cursor: default;
}

.skills-container span:hover::after {
    opacity: 1;
    visibility: visible;
}

/* --- DEFAULT TOOLTIP STYLE (FOR DESKTOP) --- */
.skills-container span::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    white-space: nowrap; /* Keeps text on a single line */
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.cert-card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    text-align: center;
}

.cert-card a {
    display: block;
}

.cert-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--hover-shadow);
}

.cert-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.cert-card p {
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 0;
}

#contact {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
}

#contact h3 {
    margin-top: 0;
}

.social-links-container {
    margin-top: 1.5rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
}

.social-icon {
    font-size: 1.8rem;
    transform: scale(0.85);
    transition: transform 0.3s ease, color 0.3s ease;
}

.social-icon:hover {
    transform: translateY(-5px) scale(0.95);
    color: var(--text-light);
}

.shiny-text {
    color: var(--text-muted);
    background: linear-gradient(
        120deg,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0.8) 50%,
        rgba(255, 255, 255, 0) 60%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    display: inline-block;
    animation: shine 5s linear infinite;
}

@keyframes shine {
    0% {
        background-position: 100%;
    }
    100% {
        background-position: -100%;
    }
}

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.lightbox:target {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    border: 3px solid var(--text-light);
    border-radius: 4px;
}

.lightbox .close {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: default;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    section {
        margin-bottom: 1.5rem;
    }
    h3 {
        font-size: 1.8rem;
    }
    .portfolio-grid,
    .research-grid,
    .education-grid,
    .training-grid,
    .cert-grid {
        grid-template-columns: 1fr;
    }
    .social-icon {
        font-size: 1.6rem;
    }
    
    /* Default mobile tooltip style */
    .skills-container span::after {
        white-space: normal;
        text-align: center;
        word-wrap: break-word;
        width: 180px;
    }

    /* Mobile tooltip alignment for Network Testing */
    .skills-container .skill-network::after {
        left: 0;
        transform: translateX(0);
        text-align: left;
    }

    /* Mobile tooltip alignment for API Testing */
    .skills-container .skill-api::after {
        left: auto;
        right: 0;
        transform: translateX(0);
        text-align: right;
    }
}
