/* --- Global Styles & Variables --- */
:root {
    --bg-color: #111111;
    --text-color: #f0f0f0;
    /* UPDATED: Using a gradient for a more modern feel */
    --accent-color-main: #ff477e;
    --accent-color-gradient: linear-gradient(45deg, #ff477e, #ff8a65);
    --secondary-bg-color: #1a1a1a;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(255, 71, 126, 0.2); /* UPDATED: Shadow color for glows */
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Poppins', sans-serif; /* Now this font will actually load */
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

/* --- Header & Navigation --- */
header {
    position: fixed; top: 0; left: 0; width: 100%; padding: 1rem 5%;
    background: rgba(17, 17, 17, 0.8); backdrop-filter: blur(10px);
    display: flex; justify-content: space-between; align-items: center;
    z-index: 100; border-bottom: 1px solid var(--border-color);
}
.nav-logo { font-size: 1.5rem; font-weight: 600; color: var(--text-color); text-decoration: none; }
nav ul { list-style: none; display: flex; gap: 2rem; }
nav a { color: var(--text-color); text-decoration: none; font-weight: 500; position: relative; transition: color 0.3s; }
nav a::after {
    content: ''; position: absolute; width: 0; height: 2px;
    bottom: -5px; left: 50%; transform: translateX(-50%);
    background: var(--accent-color-gradient); /* UPDATED */
    transition: width 0.3s ease;
}
nav a:hover, nav a.active { color: var(--accent-color-main); }
nav a:hover::after, nav a.active::after { width: 100%; }

/* --- Sections --- */
section {
    min-height: 100vh; display: flex; flex-direction: column;
    justify-content: center; align-items: center; padding: 100px 5%;
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
section#home { min-height: 100vh; }
section.content-section { min-height: auto; padding: 120px 5%; }
section.visible { opacity: 1; transform: translateY(0); }
.section-title {
    font-size: 3rem; margin-bottom: 4rem; /* UPDATED: Increased margin */
    text-align: center; position: relative; padding-bottom: 10px;
}
.section-title::after {
    content: ''; position: absolute; width: 80px; height: 4px;
    bottom: 0; left: 50%; transform: translateX(-50%);
    background: var(--accent-color-gradient); /* UPDATED */
}

/* --- Home Section --- */
#home { text-align: center; }
.home-content h1 {
    font-size: 4rem; font-weight: 700;
    /* UPDATED: Added text-shadow for better visibility */
    text-shadow: 0 0 15px rgba(0,0,0,0.5);
}
.home-content h2 { font-size: 2rem; font-weight: 400; margin-bottom: 2rem; }
.accent-color {
    /* UPDATED: Applying the gradient to text */
    background: var(--accent-color-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.btn {
    display: inline-block; padding: 0.8rem 2rem;
    border: 2px solid var(--accent-color-main); border-radius: 5px;
    color: var(--accent-color-main); text-decoration: none; font-weight: 600;
    transition: background-color 0.3s, color 0.3s, transform 0.3s;
}
.btn:hover { background-color: var(--accent-color-main); color: var(--bg-color); transform: translateY(-3px); }
.arrow { margin-left: 0.5rem; transition: transform 0.3s; display: inline-block; }
.btn:hover .arrow { transform: translateY(5px); }

/* --- About Section --- */
.section-container { max-width: 1100px; width: 100%; }
.about-content { display: grid; grid-template-columns: 1fr 2fr; gap: 3rem; align-items: center; }
.about-image img { width: 100%; max-width: 300px; margin: 0 auto; border-radius: 10px; border: 2px solid var(--border-color); }
.about-text h3 { color: var(--accent-color-main); margin-bottom: 0.5rem; font-size: 1.3rem;}
.about-text p { margin-bottom: 1.5rem; font-size: 1.1rem; }

/* --- Skills Section --- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1.5rem; }
.skill-card {
    background: var(--secondary-bg-color); padding: 1.5rem; border-radius: 10px;
    text-align: center; border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s;
}
.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px var(--shadow-color); /* UPDATED: Glow effect */
}
.skill-card i { font-size: 3rem; color: var(--accent-color-main); }
.skill-card span { display: block; margin-top: 0.5rem; font-weight: 500; }

/* --- Staggered Animation for Grids --- */
.animated-grid .skill-card, .animated-grid .certificate-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
    transition-delay: var(--delay); /* Custom property for JS to set */
}

/* --- Internships & Projects Section (REFACTORED) --- */
.info-card {
    display: grid; grid-template-columns: 1fr 1.2fr; gap: 2rem;
    margin-bottom: 4rem; align-items: center; background: var(--secondary-bg-color);
    padding: 2rem; border-radius: 10px; border: 1px solid var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s;
}
.info-card:hover { transform: translateY(-5px); box-shadow: 0 0 25px var(--shadow-color); }
.info-card:last-child { margin-bottom: 0; }
.info-card.reverse { grid-template-columns: 1.2fr 1fr; }
.info-card.reverse .card-info { grid-column: 1; grid-row: 1; }
.info-card.reverse img { grid-column: 2; }
.info-card img { width: 100%; border-radius: 5px; opacity: 0.9; transition: opacity 0.3s; }
.info-card:hover img { opacity: 1; }
.card-info h3 { font-size: 1.8rem; color: var(--accent-color-main); margin-bottom: 1rem; }
.card-info h4 { font-size: 1.1rem; margin-top: -0.8rem; margin-bottom: 1rem; font-weight: 500; opacity: 0.8;}
.project-links { margin-top: 1.5rem; display: flex; gap: 1rem; }
.btn-secondary {
    padding: 0.6rem 1.5rem; border: 1px solid var(--text-color); color: var(--text-color);
    text-decoration: none; border-radius: 5px; transition: all 0.3s;
}
.btn-secondary:hover { background-color: var(--accent-color-main); color: var(--bg-color); border-color: var(--accent-color-main); }

/* --- Certificates Section --- */
.certificate-grid {
  display: grid;
  /* UPDATED: Flexible grid that adapts to screen size */
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.certificate-card {
    background: var(--secondary-bg-color); border: 1px solid var(--border-color);
    border-radius: 10px; text-align: center; padding: 1rem;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    transition: transform 0.3s, box-shadow 0.3s;
}
.certificate-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }
.certificate-card img {
    width: 100%; height: auto; border-radius: 5px;
    margin-bottom: 1rem; border: 1px solid var(--border-color);
}
.certificate-card p {
    font-size: 1rem; color: var(--text-color); font-weight: 500;
    margin-top: auto; /* Pushes text to bottom */
}

/* --- Resume & Contact Sections --- */
.resume-content, .contact-form-container { max-width: 700px; margin: 0 auto; text-align: center; }
.resume-content p { margin-bottom: 2rem; font-size: 1.1rem; }
.contact-subtitle { text-align: center; max-width: 600px; margin: 0 auto 2rem; }
.contact-form { display: flex; flex-direction: column; gap: 1rem; max-width: 600px; margin: 0 auto; }
.contact-form input, .contact-form textarea {
    width: 100%; padding: 1rem; background: var(--secondary-bg-color);
    border: 1px solid var(--border-color); border-radius: 5px;
    color: var(--text-color); font-family: inherit; font-size: 1rem;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent-color-main); }

/* --- Footer --- */
footer { padding: 4rem 5% 2rem; text-align: center; background-color: var(--secondary-bg-color); position: relative; }
.scroll-top-btn {
    position: absolute; top: -25px; left: 50%; transform: translateX(-50%);
    background: var(--accent-color-gradient); /* UPDATED */
    color: var(--bg-color); width: 50px; height: 50px;
    border-radius: 50%; display: flex; justify-content: center; align-items: center;
    font-size: 1.5rem; text-decoration: none; transition: transform 0.3s;
}
.scroll-top-btn:hover { transform: translateX(-50%) translateY(-5px); }
.social-links { margin-bottom: 1rem; display: flex; justify-content: center; gap: 1.5rem; }
.social-links a {
    color: var(--text-color); font-size: 1.8rem;
    transition: color 0.3s, transform 0.3s;
}
.social-links a:hover { color: var(--accent-color-main); transform: translateY(-3px); }

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .about-content { grid-template-columns: 1fr; text-align: center; }
    .about-image img { margin: 0 auto 2rem auto; }
    .info-card, .info-card.reverse { grid-template-columns: 1fr; }
    .info-card.reverse img { grid-column: auto; grid-row: auto; }
}
@media (max-width: 768px) {
    header { padding: 1rem 3%; }
    nav ul { display: none; /* Consider implementing a hamburger menu here */ }
    .home-content h1 { font-size: 3rem; }
    .home-content h2 { font-size: 1.5rem; }
    .section-title { font-size: 2.5rem; }
}