/* Basic Resets & Global Styles */
:root {
    --primary-color: #00e0e0;
    --secondary-color: #8c8c8c;
    --background-dark: #0d0d1e;
    --text-light: #e0e0e0;
    --card-bg: #1a1a2e;
    --border-color: #3a3a5a;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    color: var(--text-light);
    background-color: var(--background-dark);
    scroll-behavior: smooth;
    overflow-x: hidden;
    position: relative;
}

/* 3D Background Canvas */
#threejs-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.7;
}

/* Content wrapper to ensure content stays above 3D background */
main {
    position: relative;
    z-index: 1;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
    text-align: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.section h2 {
    font-size: 3em;
    margin-bottom: 40px;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

.section h2::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -10px;
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* --- Header & Navigation --- */
.header {
    background-color: rgba(26, 26, 46, 0.9);
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    color: var(--text-light);
    font-weight: 600;
    position: relative;
    padding-bottom: 5px;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    background-color: var(--primary-color);
    left: 0;
    bottom: 0;
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Burger menu for mobile */
.burger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 20px;
    z-index: 1001;
}

.burger div {
    width: 100%;
    height: 3px;
    background-color: var(--text-light);
    border-radius: 10px;
    transition: all 0.3s ease;
}

/* --- Hero Section --- */
.hero {
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 80px;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top left, rgba(0, 224, 224, 0.1) 0%, transparent 30%),
                radial-gradient(circle at bottom right, rgba(0, 224, 224, 0.1) 0%, transparent 30%);
    z-index: -1;
    animation: gradientShift 20s ease infinite alternate;
}

@keyframes gradientShift {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

.hero-content h1 {
    font-size: 4.5em;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content h1 .typed-text {
    color: var(--primary-color);
    font-weight: 700;
}

.hero-content .cursor {
    display: inline-block;
    background-color: var(--primary-color);
    margin-left: 0.1em;
    width: 3px;
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

.hero-content p {
    font-size: 1.5em;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--background-dark);
    padding: 15px 30px;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: #00a0a0;
    transform: translateY(-3px);
    text-decoration: none;
}

/* --- About Section --- */
.about-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
    text-align: left;
    justify-content: center;
}

.about-text {
    flex: 2;
    min-width: 300px;
    font-size: 1.1em;
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.about-text p {
    margin-bottom: 20px;
}

/* Profile Picture Shutter Effect */
.about-image-container {
    flex: 1;
    min-width: 250px;
    max-width: 350px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    position: relative;
    cursor: pointer;
    background-color: var(--card-bg);
}

.about-image-container img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}

.shutter-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 26, 46, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: var(--primary-color);
    font-size: 1.5em;
    font-weight: 600;
    transition: opacity 0.5s ease;
    pointer-events: all;
}

.shutter-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.shutter-message {
    z-index: 10;
    position: relative;
    text-shadow: 0 0 10px var(--primary-color);
}

.shutter-blades {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    overflow: hidden;
}

.shutter-blade {
    background-color: var(--background-dark);
    border: 1px solid var(--border-color);
    transition: transform 1s ease-out, opacity 1s ease-out;
    position: relative;
}

/* Initial state of blades (closed) */
.shutter-blades .top-left { transform-origin: bottom right; }
.shutter-blades .top-right { transform-origin: bottom left; }
.shutter-blades .bottom-left { transform-origin: top right; }
.shutter-blades .bottom-right { transform-origin: top left; }

/* Open state of blades */
.shutter-overlay.open .top-left { transform: rotate(-45deg) translate(-50%, -50%); opacity: 0; }
.shutter-overlay.open .top-right { transform: rotate(45deg) translate(50%, -50%); opacity: 0; }
.shutter-overlay.open .bottom-left { transform: rotate(45deg) translate(-50%, 50%); opacity: 0; }
.shutter-overlay.open .bottom-right { transform: rotate(-45deg) translate(50%, 50%); opacity: 0; }

/* --- Education & Certifications Section --- */
.edu-cert-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
    text-align: left;
}

@media (min-width: 768px) {
    .edu-cert-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.education-column, .certifications-column {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.education-column h3, .certifications-column h3 {
    font-size: 2em;
    color: var(--primary-color);
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.education-column h3::after, .certifications-column h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.icon-left {
    font-size: 0.9em;
    color: var(--primary-color);
}

.education-item, .certification-item {
    background-color: var(--background-dark);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.education-item:hover, .certification-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.education-item:last-child, .certification-item:last-child {
    margin-bottom: 0;
}

.education-item h4, .certification-item h4 {
    font-size: 1.3em;
    color: var(--text-light);
    margin-bottom: 5px;
}

.education-item .institution, .certification-item .issuer {
    font-size: 1em;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.education-item .dates, .certification-item .dates {
    font-style: italic;
    font-size: 0.9em;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.education-item .details {
    font-size: 0.95em;
    color: var(--text-light);
}

/* --- Skills Section --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
}

.skill-item {
    background-color: var(--card-bg);
    padding: 30px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, background-color 0.3s ease;
    border: 1px solid var(--border-color);
}

.skill-item:hover {
    transform: translateY(-5px);
    background-color: #3a3a5a;
}

.skill-item i {
    font-size: 3.5em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.skill-item h3 {
    font-size: 1.3em;
    color: var(--text-light);
}

/* --- Projects Section --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.project-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.project-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.project-card h3 {
    font-size: 1.3em;
    margin: 15px 15px 8px;
    color: var(--primary-color);
}

.project-card p {
    font-size: 0.9em;
    padding: 0 15px 15px;
    flex-grow: 1;
}

.project-card .project-link {
    display: inline-block;
    margin: 0 15px 15px;
    color: var(--primary-color);
    font-weight: 600;
    transition: color 0.3s ease;
}

.project-card .project-link:hover {
    color: #00a0a0;
    text-decoration: underline;
}

/* --- Contact Section --- */
.contact-info {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 40px;
}

.contact-method {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    min-width: 250px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    border: 1px solid var(--border-color);
}

.contact-method:hover {
    transform: translateY(-5px);
}

.contact-method i {
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.contact-method h3 {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.contact-method p, .contact-method a {
    color: var(--text-light);
    font-size: 1em;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto 50px;
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    text-align: left;
    border: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-size: 1.1em;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--background-dark);
    color: var(--text-light);
    font-size: 1em;
    transition: border-color 0.3s ease;
    font-family: 'Courier New', monospace;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.contact-form .btn {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
}

.social-links {
    margin-top: 30px;
}

.social-links a {
    display: inline-block;
    font-size: 2.5em;
    color: var(--text-light);
    margin: 0 15px;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-5px);
    text-decoration: none;
}

/* --- Footer --- */
.footer {
    background-color: var(--card-bg);
    color: var(--text-light);
    text-align: center;
    padding: 30px 0;
    font-size: 0.9em;
    border-top: 1px solid var(--border-color);
}

/* --- Back To Top Button --- */
#backToTopBtn {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: var(--primary-color);
    color: var(--background-dark);
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    font-size: 22px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: background-color 0.3s ease, transform 0.3s ease;
}

#backToTopBtn:hover {
    background-color: #00a0a0;
    transform: translateY(-3px);
}

/* --- Animation Classes --- */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.fade-bottom {
    opacity: 0;
    transform: translateY(50px);
}
.fade-left {
    opacity: 0;
    transform: translateX(-50px);
}
.fade-right {
    opacity: 0;
    transform: translateX(50px);
}
.fade-in {
    opacity: 0;
}

.fade-bottom.active,
.fade-left.active,
.fade-right.active,
.fade-in.active {
    opacity: 1;
    transform: translateX(0) translateY(0);
}

/* Form Status Messages */
.form-status {
    margin-top: 20px;
    padding: 10px;
    border-radius: 5px;
    display: none;
}

.form-status.success {
    display: block;
    background-color: rgba(0, 224, 224, 0.2);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.form-status.error {
    display: block;
    background-color: rgba(255, 0, 0, 0.1);
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
}

/* Loading Spinner */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--text-light);
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .hero-content h1 {
        font-size: 3.5em;
    }
    .hero-content p {
        font-size: 1.2em;
    }
    .nav-links {
        width: 50%;
    }
    .about-content {
        flex-direction: column;
        text-align: center;
    }
    .about-image-container {
        order: -1;
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 60px 0;
        min-height: auto;
    }

    .section h2 {
        font-size: 2.5em;
    }

    /* Navbar adjustments for mobile */
    .nav-links {
        position: fixed;
        right: 0;
        top: 0;
        height: 100vh;
        background-color: var(--card-bg);
        flex-direction: column;
        align-items: center;
        width: 60%;
        transform: translateX(100%);
        transition: transform 0.5s ease-in-out;
        padding-top: 100px;
        box-shadow: -5px 0 15px rgba(0,0,0,0.4);
    }

    .nav-links.nav-active {
        transform: translateX(0%);
    }

    .nav-links li {
        opacity: 0;
        margin: 25px 0;
    }

    .burger {
        display: flex;
    }

    /* Burger animation */
    .burger.toggle .line1 {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    .burger.toggle .line2 {
        opacity: 0;
    }
    .burger.toggle .line3 {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    .hero-content h1 {
        font-size: 2.8em;
    }
    .hero-content p {
        font-size: 1em;
    }

    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .edu-cert-grid {
        grid-template-columns: 1fr;
    }

    .contact-info {
        flex-direction: column;
        align-items: center;
    }

    .contact-method {
        width: 100%;
        max-width: 300px;
    }

    .contact-form {
        padding: 30px 20px;
    }

    #backToTopBtn {
        bottom: 20px;
        right: 20px;
        padding: 12px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2.2em;
    }
    .logo {
        font-size: 1.5em;
    }
    .btn {
        padding: 12px 25px;
        font-size: 1em;
    }
    .social-links a {
        font-size: 2em;
        margin: 0 10px;
    }
}