/* CSS Variables for Theming */
:root {
    --bg-color: linear-gradient(135deg, #1a1a1a 10%, #000000 100%);
    --text-color: #ccd6f6;
    --primary-color: #64ffda;
    --secondary-color: #8892b0;
    --card-bg-color: #112240;
    --border-color: rgba(100, 255, 218, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.2);
    --cursor-dot-color: #64ffda;
    --cursor-outline-color: #64ffda;
    --gradient-text: linear-gradient(90deg, #64ffda, #1e90ff);
}

body.light-theme {
    --bg-color: linear-gradient(135deg, #ffffff 10%, #e9eef3 100%);
    --text-color: #333333;
    --primary-color: #1e90ff;
    --secondary-color: #555;
    --card-bg-color: #ffffff;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --cursor-dot-color: #1e90ff;
    --cursor-outline-color: #1e90ff;
    --gradient-text: linear-gradient(90deg, #1e90ff, #ff6347);
}

/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    transition: background 0.5s ease, color 0.5s ease;
    overflow-x: hidden;
}

/* --- Page Load Animation --- */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header {
    animation: fadeInDown 0.8s ease-out forwards;
}

.home-content, .home-image-container {
    animation: fadeInUp 0.8s 0.2s ease-out forwards;
}

/* Custom Cursor */
.cursor-dot, .cursor-outline {
    pointer-events: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    opacity: 1;
    transition: opacity 0.3s ease-in-out, transform 0.1s ease-in-out;
    z-index: 9999;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--cursor-dot-color);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 2px solid var(--cursor-outline-color);
    background-color: transparent;
}

.cursor-hover {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0.5;
}

/* Header & Navigation */
header {
    position: sticky;
    top: 15px;
    width: 90%;
    left: 5%;
    z-index: 1000;
    margin-top: 15px;
    border-radius: 15px;
    background-color: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 2rem;
    position: relative;
}

.nav-logo {
    transition: transform 0.4s ease;
}
.nav-logo img {
    height: 60px;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.nav-logo:hover img {
    opacity: 0;
    transform: translateY(20px);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-family: 'Fira Code', monospace;
    transition: color 0.3s, filter 0.3s, opacity 0.3s;
}

.nav-links:hover a {
    filter: blur(2px);
    opacity: 0.5;
}

.nav-links:hover a:hover {
    filter: blur(0);
    opacity: 1;
    color: var(--primary-color);
}

.nav-links .theme-toggle-item {
    display: none;
}

.theme-switcher {
    cursor: pointer;
    color: var(--text-color);
}

.theme-switcher svg {
    transition: transform 0.3s ease;
}

.theme-switcher svg:hover {
    transform: scale(1.2);
}

.theme-switcher .sun-icon { display: none; }
body.light-theme .theme-switcher .sun-icon { display: block; }
body.light-theme .theme-switcher .moon-icon { display: none; }

.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger div {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px;
    transition: all 0.3s ease;
}

/* Sections */
section {
    padding: 100px 10%;
    min-height: 100vh;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-family: 'Fira Code', monospace;
    font-size: 2.8rem;
    text-align: center;
    margin-bottom: 50px;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Home Section */
.home-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding-top: 40px;
    padding-bottom: 40px;
}

.home-content {
    flex: 1;
    max-width: 600px;
}

.home-image-container {
    flex: 1;
    max-width: 450px;
    text-align: center;
}

.home-image-container img {
    max-width: 100%;
    border-radius: 15px;
    transition: transform 0.4s ease-in-out;
}

.home-image-container img:hover {
    transform: scale(1.05);
}

.home-content .intro-text {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-family: 'Fira Code', monospace;
}

.home-content .name-text, .home-content .role-text {
    font-weight: 600;
}

.home-content .name-text { font-size: clamp(2.5rem, 5vw, 3.5rem); }
.home-content .role-text { font-size: clamp(1.5rem, 3vw, 2.2rem); color: var(--secondary-color); margin-bottom: 20px;}
.home-content .description { font-size: 1.1rem; max-width: 600px; margin-bottom: 30px;}

.name-text span, .role-text span {
    display: inline-block; 
    transition: color 0.3s;
}

.name-text span:hover, .role-text span:hover {
    color: var(--primary-color);
    animation: shakeZoom 0.4s ease-in-out;
}

@keyframes shakeZoom {
    0%, 100% { transform: scale(1) rotate(0); }
    25% { transform: scale(1.1) rotate(-3deg); }
    50% { transform: scale(1.1) rotate(3deg); }
    75% { transform: scale(1.1) rotate(-3deg); }
}

.cta-button, .resume-button {
    text-decoration: none;
    padding: 12px 24px;
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    font-weight: 600;
    border-radius: 5px;
    transition: background-color 0.3s;
    display: inline-block;
    font-family: 'Poppins', sans-serif; /* Ensure button font is correct */
}

.cta-button:hover, .resume-button:hover {
    background-color: rgba(100, 255, 218, 0.1);
}

.cta-button[type="submit"] {
    cursor: none; /* Re-apply custom cursor */
    font-size: 1rem;
    margin-top: 10px;
}

.resume-button {
    margin-top: 20px;
    padding: 10px 20px;
}

/* About Section */
.about-content {
    display: flex;
    align-items: center;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
    text-align: left;
}

.about-image {
    flex: 0 0 300px;
    position: relative;
}

.about-image img {
    width: 100%;
    border-radius: 10px;
    transition: box-shadow 0.4s ease;
}

.about-image:hover img {
    box-shadow: 0 0 25px 5px var(--primary-color);
}

.about-text {
    flex: 1;
}

.about-text p { margin-bottom: 20px; line-height: 1.8; }

/* Skills Section */
.skills-section {
    padding-top: 150px;
}

.tech-stack-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 40px;
    color: var(--secondary-color);
}

.skills-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.skill-card {
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    width: 160px;
    height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    box-shadow: 0 4px 10px var(--shadow-color);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.skill-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 20px var(--shadow-color);
    border-color: var(--primary-color);
}

.skill-card i {
    font-size: 4rem;
    color: var(--primary-color);
}

.skill-card span {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Projects Section */
.project-card {
    background-color: var(--card-bg-color);
    border-radius: 10px;
    padding: 40px;
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 10px var(--shadow-color);
}

.project-info {
    flex: 1;
}

.project-info h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.project-info p {
    font-size: 1rem; /* Base size for paragraphs in projects */
}

.project-preview {
    width: 300px;
    height: 180px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.project-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.live-view-btn {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    margin-top: 20px;
    display: inline-block;
    border: 2px solid transparent;
    padding: 8px 16px;
    border-radius: 25px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.live-view-btn:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px 0px var(--primary-color);
}

body.light-theme .live-view-btn:hover {
     box-shadow: 0 0 15px 0px var(--primary-color);
}

/* --- Contact Section --- */
.contact-section {
    text-align: center;
    padding-bottom: 100px;
}

.contact-description {
    font-size: 1.1rem;
    color: var(--secondary-color);
    margin-bottom: 40px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 10px var(--shadow-color);
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-family: 'Fira Code', monospace;
    color: var(--secondary-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    background-color: var(--card-bg-color); /* Changed to card-bg for contrast */
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px 0px var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}


/* Footer */
footer {
    padding: 50px 10%;
    text-align: center;
    background-color: var(--card-bg-color);
    border-top: 1px solid var(--border-color);
}

.social-links a {
    color: var(--text-color);
    font-size: 1.8rem;
    margin: 0 15px;
    transition: color 0.3s, transform 0.3s;
    text-decoration: none;
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-5px);
}

footer p {
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

/* Back to Top Link */
.back-to-top {
    position: fixed;
    right: -100px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    text-decoration: none;
    color: var(--text-color);
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease, right 0.4s ease;
}

.back-to-top.visible {
    right: -40px;
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover {
    color: var(--primary-color);
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .project-card {
        flex-direction: column;
    }
    
    .contact-form {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    section {
        padding: 80px 8%;
    }

    /* UPDATED: Reduced section title font size */
    .section-title {
        font-size: 2.0rem; /* Was 2.2rem */
    }

    header { width: 95%; left: 2.5%; }
    nav { padding: 0.8rem 1.5rem; }
    
    .home-section, .about-content { 
        flex-direction: column; 
        text-align: center;
    }

    .home-content .name-text { 
        font-size: 2.5rem;
    } 
    .home-content .role-text { 
        font-size: 1.5rem;
    }
    /* UPDATED: Reduced home description font size */
    .home-content .description {
        font-size: 0.95rem; /* Was 1rem */
    }

    .home-image-container img {
        max-width: 300px;
        margin: 0 auto;
    }

    .about-content { text-align: center; }
    
    /* UPDATED: Kept about text paragraph font size */
    .about-text p {
        font-size: 0.95rem;
    }

    .skills-grid { 
        gap: 20px;
     }
    .skill-card {
        width: 140px;
        height: 140px;
    }
    
    .project-card { 
        flex-direction: column; 
        padding: 30px;
    }
    
    /* UPDATED: Kept project paragraph font size */
    .project-info p {
        font-size: 0.95rem;
    }
    
    /* UPDATED: Reduced contact paragraph font size */
    .contact-description {
        font-size: 0.95rem; /* Was 1rem */
    }

    .back-to-top { display: none; }
    
    .nav-links {
        position: absolute;
        right: 0px;
        top: 65px;
        left: 0;
        background-color: var(--card-bg-color);
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        transform: translateY(-150%);
        transition: transform 0.5s ease-in;
        border-bottom-left-radius: 15px;
        border-bottom-right-radius: 15px;
        padding: 20px 0;
        box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    }
    .nav-links.active {
        transform: translateY(0%);
    }
    .nav-links li {
        opacity: 0;
        padding: 10px 0;
    }
    .hamburger {
        display: block;
    }

    .nav-right {
        display: none;
    }
    .nav-links .theme-toggle-item {
        display: list-item;
        text-align: center;
        margin-top: 15px;
    }

    .toggle .line1 {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    .toggle .line2 {
        opacity: 0;
    }
    .toggle .line3 {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .about-image{
        height: 270px;
        width: 200px;
        margin: 0 auto 2rem auto;
        flex-basis: auto;
    }
    
    @keyframes navLinkFade {
        from {
            opacity: 0;
            transform: translateX(50px);
        }
        to {
            opacity: 1;
            transform: translateX(0px);
        }
    }
}

@media screen and (max-width: 500px){
    section {
        padding: 60px 5%;
    }

    /* UPDATED: Reduced section title font size */
    .section-title {
        font-size: 1.8rem; /* Was 2rem */
    }

    .home-content .name-text { 
        font-size: 2.1rem;
    }
    .home-content .role-text { 
        font-size: 1.3rem;
    }
    /* UPDATED: Reduced home description font size */
    .home-content .description {
        font-size: 0.9rem; /* Was 0.95rem */
    }

    /* UPDATED: Kept about text paragraph font size */
    .about-text p {
        font-size: 0.9rem;
    }

    .skill-card {
        width: 120px;
        height: 120px;
        gap: 15px;
    }
    .skill-card i { font-size: 3rem; }
    .skill-card span { font-size: 1rem; }
    
    .project-preview {
        width: 100%;
        height: auto;
    }
    
    /* UPDATED: Kept project paragraph font size */
    .project-info p {
        font-size: 0.9rem;
    }

    /* UPDATED: Reduced contact paragraph font size */
    .contact-description {
        font-size: 0.9rem; /* Was 0.95rem */
    }
    
    .contact-form {
        padding: 20px;
    }
}