/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Poppins:wght@300;400;600;700&display=swap');

/* --- CSS Variables --- */
:root {
    --primary-color: #007bff;
    --primary-color-hover: #0056b3;
    --secondary-color: #f8f9fa;
    --text-color: #343a40;
    --heading-color: #212529;
    --border-color: #dee2e6;
    --background-color: #ffffff;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

/* --- Global & Reset Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.7;
}

h1, h2, h3 {
    color: var(--heading-color);
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.2rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.4rem; }

p {
    margin-bottom: 1rem;
}

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

a:hover {
    color: var(--primary-color-hover);
}

section {
    padding: 6rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
    text-align: center;
}

/* --- Animations --- */
@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- Header & Navigation --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    animation: slideDown 0.8s ease-out forwards;
}

nav {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 2rem;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav ul li a {
    font-weight: 600;
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

nav ul li a:hover::after {
    width: 100%;
}

.nav-socials {
    position: absolute;
    right: 2rem;
    display: flex;
    gap: 1.5rem;
}

.nav-social-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-social-link i {
    font-size: 1.3rem;
}

/* --- Scroll Navigation Dots --- */
.scroll-nav {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    z-index: 1000;
}

.scroll-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background-color: transparent;
    transition: all 0.3s ease;
}

.scroll-dot:hover {
    background-color: rgba(0, 123, 255, 0.3);
    transform: scale(1.2);
}

.scroll-dot.active {
    background-color: var(--primary-color);
    transform: scale(1.3);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 80px;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 4.5rem;
    line-height: 1.15;
    margin-top: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp 0.8s ease-out 0.2s forwards;
}

.accent {
    color: var(--primary-color);
}

.hero-subtitle {
    font-size: 1.2rem;
    margin: 1rem 0 1.5rem 0;
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeUp 0.8s ease-out 0.4s forwards;
}

.hero-about {
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto 2.5rem auto;
    opacity: 0;
    animation: fadeUp 0.8s ease-out 0.6s forwards;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: #fff;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: var(--primary-color-hover);
    color: #fff;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.4);
}

.btn i {
    font-size: 1.3rem;
    filter: brightness(0) invert(1); /* Forces the GitHub logo to be perfectly white */
}

.view-work-btn {
    margin-top: 3rem;
    opacity: 0;
    animation: fadeUp 0.8s ease-out 0.8s forwards;
}

/* --- Projects Section --- */
.project-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    max-width: 800px;
    margin: 3rem auto 0 auto;
    text-align: left;
}

.project-card {
    background: var(--secondary-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    opacity: 0;
    transform: translateY(80px);
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    margin-bottom: 5rem;
}

.project-card.show {
    opacity: 1;
    transform: translateY(0);
}

.project-card.show:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    display: block;
}

.project-card img.project-logo {
    object-fit: contain;
    padding: 3rem;
    background-color: #ffffff;
}

.project-card img.project-screenshot {
    object-fit: contain;
    background-color: #ffffff;
}

.project-card img.chatbot-vid {
    width: calc(100% + 20px);
    max-width: none;
    margin-left: -10px;
}

.project-card > h3 {
    padding: 1.5rem 1.5rem 0;
    margin-bottom: 1rem;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.publication-badge {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
}

.project-card .publication-badge img {
    width: auto;
    height: 22px;
    object-fit: contain;
}

.project-card-content {
    padding: 0 1.5rem 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-card-content p {
    flex-grow: 1;
    margin-top: 2rem;
}

.tech-logos {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.tech-logos i {
    font-size: 2rem;
    color: #6c757d;
}

.tech-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: #6c757d;
}

/* --- Contact Section --- */
#contact-form {
    max-width: 600px;
    margin: 2rem auto 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#contact-form input,
#contact-form textarea {
    width: 100%;
    padding: 0.8rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
}

#contact-form textarea {
    min-height: 150px;
    resize: vertical;
}

/* --- Footer --- */
footer {
    background: var(--heading-color);
    color: var(--secondary-color);
    text-align: center;
    padding: 2rem;
}

.social-links {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.social-links a {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a i {
    font-size: 1.5rem;
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* --- Modal Styles --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 3rem;
    border-radius: 12px;
    max-width: 900px;
    width: 90%;
    position: relative;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(-50px);
    transition: transform 0.3s ease;
}

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

#modal-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.modal-techs {
    border-top: none;
    margin-top: 0.5rem;
    padding-top: 0;
}

/* Modal Active State */
body.modal-active .modal {
    display: block;
    opacity: 1;
}

body.modal-active .modal-content {
    transform: translateY(0);
}

body.modal-active {
    overflow: hidden;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #333;
}

#modal-img {
    width: 100%;
    height: auto;
    max-height: 450px;
    object-fit: contain;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#modal-img[src="Application_Test_Vid.gif"] {
    clip-path: inset(0 10px);
}

.info-block {
    background-color: var(--secondary-color);
    padding: 1.8rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
    text-align: left;
}

.info-title {
    font-family: 'Poppins', sans-serif;
    color: var(--heading-color);
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
}

#modal-body p {
    margin-bottom: 0;
    color: #495057;
    line-height: 1.8;
}

.modal-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* --- Responsive Design (Tablet) --- */
@media (max-width: 900px) {
    .hero h1 {
        font-size: 3rem;
    }
}

/* --- Responsive Design (Mobile) --- */
@media (max-width: 768px) {
    /* Navigation */
    .nav-socials {
        display: none;
    }
    nav {
        padding: 0.75rem 1rem;
        justify-content: center;
    }
    nav ul {
        gap: 1.2rem;
    }
    nav ul li a {
        font-size: 0.9rem;
    }

    /* Hide side scroll dots — they overlap content on narrow screens */
    .scroll-nav {
        display: none;
    }

    /* Typography scale-down */
    h1 { font-size: 1.9rem; }
    h2 { font-size: 1.5rem; margin-bottom: 1rem; }
    h3 { font-size: 1.15rem; }

    /* Section spacing */
    section {
        padding: 3.5rem 1.2rem;
    }

    /* Hero */
    .hero {
        padding-top: 70px;
    }
    .hero h1 {
        font-size: 2.2rem;
        margin-top: 1.5rem;
        margin-bottom: 1rem;
    }
    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }
    .hero-about {
        font-size: 0.9rem;
        line-height: 1.7;
        margin-bottom: 1.5rem;
    }
    .view-work-btn {
        margin-top: 1.5rem;
    }

    /* Button */
    .btn {
        padding: 0.75rem 1.8rem;
        font-size: 0.82rem;
        letter-spacing: 1px;
    }

    /* Project grid */
    .project-grid {
        gap: 2rem;
        margin: 1.5rem auto 0 auto;
    }
    .project-card {
        margin-bottom: 0;
    }
    .project-card > h3 {
        font-size: 1.35rem;
        padding: 1rem 1rem 0;
    }
    .project-card img {
        height: 210px;
    }
    .project-card img.project-logo {
        padding: 2rem;
    }
    .project-card-content {
        padding: 0 1rem 1rem;
    }
    .project-card-content p {
        margin-top: 1rem;
        font-size: 0.9rem;
    }
    .tech-logos i {
        font-size: 1.6rem;
    }

    /* Contact form */
    #contact-form {
        padding: 0 0.25rem;
    }
    #contact-form input,
    #contact-form textarea {
        font-size: 0.95rem;
    }

    /* Footer */
    .social-links {
        flex-wrap: wrap;
        gap: 0.8rem;
    }

    /* Modal */
    .modal-content {
        margin: 0 auto;
        padding: 1.25rem;
        width: 96%;
        border-radius: 8px;
        max-height: 92vh;
        overflow-y: auto;
        transform: none;
        position: relative;
        top: 4vh;
    }
    body.modal-active .modal-content {
        transform: none;
    }
    #modal-title {
        font-size: 1.3rem;
    }
    #modal-img {
        max-height: 200px;
    }
    .info-block {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    .info-title {
        font-size: 1rem;
    }
    #modal-body p {
        font-size: 0.9rem;
    }
    .modal-footer {
        flex-wrap: wrap;
        gap: 0.75rem;
        margin-top: 1.25rem;
        padding-top: 1rem;
    }
    .close-button {
        top: 0.75rem;
        right: 1rem;
        font-size: 1.75rem;
    }
}

/* --- Responsive Design (Small phones) --- */
@media (max-width: 420px) {
    h1 { font-size: 1.65rem; }
    .hero h1 {
        font-size: 1.75rem;
    }
    nav ul {
        gap: 0.8rem;
    }
    section {
        padding: 3rem 1rem;
    }
}