/* --- CSS Variables and Theme Setup --- */
:root {
  --primary-color: #4A90E2;
  --primary-gradient: linear-gradient(to right, #1a2a4a, #003d33);
  --bg-dark: #121212;
  --bg-dark-2: #000000;
  --surface-dark: #1e1e1e;
  --surface-dark-2: #2d2d2d;
  --surface-dark-transparent: rgba(30, 30, 30, 0.7);
  --text-light: #e0e0e0;
  --text-light-2: #b0b0b0;
  --text-dark: #1f1f1f;
  --text-dark-2: #555555;
  --border-light: rgba(255, 255, 255, 0.1);
  --border-dark: #dddddd;
  --success-color: #4CAF50;
  --error-color: #F44336;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --highlight-shadow: rgba(74, 144, 226, 0.2);
}

[data-theme="light"] {
  --primary-gradient: linear-gradient(to right, #e0f7fa, #e8f5e9);
  --bg-dark: #f4f4f9;
  --bg-dark-2: #ffffff;
  --surface-dark: #ffffff;
  --surface-dark-2: #f9f9f9;
  --surface-dark-transparent: rgba(255, 255, 255, 0.7);
  --text-light: var(--text-dark);
  --text-light-2: var(--text-dark-2);
  --border-light: var(--border-dark);
  --shadow-color: rgba(0, 0, 0, 0.1);
  --highlight-shadow: rgba(74, 144, 226, 0.15);
}


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

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

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: var(--text-light);
    background-color: var(--bg-dark);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: #357ABD;
}


/* --- Navbar --- */
.navbar {
    background-color: transparent;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
.navbar.scrolled {
    background-color: var(--surface-dark);
    box-shadow: 0 2px 5px var(--shadow-color);
}
.nav-container {
    max-width: 1200px;
    margin: auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-light);
}
.logo-img {
    width: 40px;
    height: 40px;
    margin-right: 0.5rem;
    border-radius: 50%;
}
.nav-menu-wrapper {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.nav-menu {
    list-style: none;
    display: flex;
    gap: 2rem;
}
.nav-link {
    text-decoration: none;
    color: var(--text-light-2);
    font-weight: 500;
    transition: color 0.3s ease;
}
[data-theme="dark"] .navbar:not(.scrolled) .nav-link {
    color: #ffffff;
}
[data-theme="dark"] .navbar:not(.scrolled) .theme-toggle-btn {
    border-color: #ffffff;
    color: #ffffff;
}
.nav-link:hover {
    color: var(--primary-color);
}
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001; /* Ensure it's above menu */
}
.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: var(--text-light);
    border-radius: 3px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}
.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}


/* --- Theme Toggle Button --- */
.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border-light);
    color: var(--text-light-2);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s ease;
}
.theme-toggle-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}
.theme-toggle-btn .fa-sun { display: none; }
.theme-toggle-btn .fa-moon { display: block; }
[data-theme="light"] .theme-toggle-btn .fa-sun { display: block; }
[data-theme="light"] .theme-toggle-btn .fa-moon { display: none; }


/* --- Hero Section --- */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background: var(--primary-gradient);
    color: #ffffff; /* This text should be light on both themes */
    text-align: center;
}
.hero-content {
    max-width: 800px;
}
.hero-content h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    font-weight: 700;
}
.hero-content h1 .highlight {
    color: #ffffff;
}
.typed-cursor {
    color: #ffffff;
    font-weight: 400;
}
.hero-text {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: #d1d1d1;
}
[data-theme="light"] .hero-text {
    color: #333;
}
.hero-buttons .btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #ffffff;
    background-color: transparent;
    color: #ffffff;
    font-weight: 500;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.hero-buttons .btn:hover {
    background-color: #ffffff;
    color: #1a2a4a;
}


/* --- Section Headers --- */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 0 2rem;
}
.section-title {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}
.section-subtitle {
    color: var(--text-light-2);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* --- About Section --- */
#about {
    padding: 80px 0;
    background-color: var(--bg-dark-2);
    transition: background-color 0.3s ease;
}
.about-content, .mission-values {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.about-text h3 {
    color: var(--primary-color);
}
.mission, .values {
    background: var(--surface-dark);
    border-top: 3px solid var(--primary-color);
    box-shadow: 0 4px 6px var(--shadow-color);
}
.mission h3, .values h3 {
    color: var(--text-light);
}
.mission-values {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 40px;
}
.mission, .values {
    flex: 1;
    min-width: 280px;
    padding: 25px;
    border-radius: 8px;
}
.about-content {
    margin: 0 auto 40px auto;
    text-align: center;
}
.about-text {
    max-width: 800px;
    margin: 0 auto;
}
.about-text p {
    color: var(--text-light);
    margin-bottom: 1rem;
}
.values ul {
    list-style-type: none;
    padding: 0;
}
.values li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 25px;
    color: var(--text-light);
}
.values li:before {
    content: "✓";
    color: #4CAF50;
    position: absolute;
    left: 0;
    font-weight: bold;
}


/* --- Projects Section --- */
#projects {
    padding: 80px 0;
    background-color: var(--bg-dark);
}
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 0 2rem;
    max-width: 1200px;
    margin: 0 auto;
}
.project-card {
    background: var(--surface-dark);
    box-shadow: 0 4px 6px var(--shadow-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}
.project-card:hover {
    box-shadow: 0 8px 15px var(--shadow-color);
    transform: translateY(-5px);
}
.project-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}
.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.project-card:hover .project-img {
    transform: scale(1.05);
}
.project-info {
    padding: 1.5rem;
}
.project-info h3 {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}
.project-description {
    color: var(--text-light-2);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    min-height: 50px;
}
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}
.tech-tag {
    background: var(--surface-dark-2);
    color: var(--text-light);
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 500;
}
.btn-outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.6rem 1.2rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: none;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
}
.btn-outline:hover {
    background-color: var(--primary-color);
    color: #ffffff;
}


/* --- Team Section --- */
#team {
    padding: 80px 0;
    background-color: var(--bg-dark-2);
    transition: background-color 0.3s ease;
}
.team-members {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 0 2rem;
    max-width: 1200px;
    margin: 0 auto;
}
.team-member {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--bg-dark-2);
}
.team-member:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px var(--highlight-shadow);
}
.member-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.team-member:hover .member-img {
    transform: scale(1.1);
}
.member-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 20%, transparent);
    padding: 3rem 1.5rem 1.5rem;
    text-align: center;
}
.member-name, .member-role {
    color: #ffffff;
    margin: 0;
}
.member-name {
    font-weight: 600;
}
.member-role {
    font-size: 0.9rem;
}
.member-social {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.team-member:hover .member-social {
    opacity: 1;
    transform: translateY(0);
}
.team-member .member-name, .team-member .member-role {
    transition: transform 0.3s ease;
}
.team-member:hover .member-name {
    transform: translateY(-35px);
}
.team-member:hover .member-role {
    transform: translateY(-35px);
}
.social-link {
    color: #ffffff;
    font-size: 1.2rem;
    transition: color 0.3s ease, transform 0.3s ease;
}
.social-link:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}


/* --- Tech Stack Animation --- */
.tech-stack-animation {
    padding: 60px 0;
    background: var(--bg-dark);
    margin: 80px 0;
}
.tech-title {
    color: var(--text-light);
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 30px;
}
.tech-slider {
    position: relative;
    width: 100%;
    height: 100px;
    overflow: hidden;
}
.tech-container {
    position: absolute;
    display: flex;
    align-items: center;
    animation: slide 30s linear infinite;
    white-space: nowrap;
}
@keyframes slide {
    from { transform: translateX(0%); }
    to { transform: translateX(-50%); }
}
.tech-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    transition: all 0.3s ease;
    margin: 0 15px;
}
.tech-logo {
    width: 60px;
    height: 60px;
    margin: 0 15px;
    object-fit: contain;
    transition: all 0.3s ease;
    filter: grayscale(50%);
}
[data-theme="light"] .tech-logo {
    filter: grayscale(20%);
}
.tech-item:hover .tech-logo {
    filter: grayscale(0%);
}


/* --- Contact Section --- */
#contact {
    padding: 80px 0;
    background: var(--primary-gradient);
    position: relative;
}
.contact-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}
.contact-form-container {
    background: var(--surface-dark-transparent);
    border: 1px solid var(--border-light);
    box-shadow: 0 10px 30px var(--shadow-color);
    padding: 40px;
    backdrop-filter: blur(10px);
    border-radius: 15px;
}
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}
.form-group {
    position: relative;
    padding-bottom: 20px;
}
.form-group.floating label {
    color: var(--text-light-2);
    position: absolute;
    top: 15px;
    left: 15px;
    pointer-events: none;
    transition: all 0.3s ease;
}
.form-group.floating input:focus ~ label,
.form-group.floating input:not(:placeholder-shown) ~ label,
.form-group.floating textarea:focus ~ label,
.form-group.floating textarea:not(:placeholder-shown) ~ label {
    color: var(--primary-color);
    background: var(--surface-dark);
    top: -10px;
    left: 10px;
    font-size: 0.75rem;
    padding: 0 5px;
    border-radius: 3px;
}
.form-group input, .form-group textarea {
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    width: 100%;
    padding: 15px;
    border: 1px solid transparent;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}
[data-theme="light"] .form-group input, 
[data-theme="light"] .form-group textarea {
    background: var(--surface-dark-2);
    color: var(--text-dark);
    border: 1px solid var(--border-dark);
}
.form-group textarea {
    resize: vertical;
    min-height: 120px;
}
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: transparent;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}
.email-validation-message {
    font-size: 0.8rem;
    padding-left: 5px;
    position: absolute;
    bottom: 0px;
    left: 5px;
}
.email-validation-message.invalid {
    color: var(--error-color);
}
.email-validation-message.valid {
    color: var(--success-color);
}
.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 30px;
    border: none;
    background: linear-gradient(135deg, #4A90E2, #357ABD);
    color: white;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}
.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.4);
}
.send-icon {
    transition: transform 0.3s ease;
}
.submit-btn:hover .send-icon {
    transform: translateX(5px);
}
.form-status {
    text-align: center;
    padding: 10px;
    margin-top: 20px;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: opacity 0.5s ease;
    opacity: 0;
    height: 0;
    overflow: hidden;
}
.form-status.success {
    color: var(--success-color);
    background-color: rgba(76, 175, 80, 0.15);
    opacity: 1;
    height: auto;
}
.form-status.error {
    color: var(--error-color);
    background-color: rgba(244, 67, 54, 0.15);
    opacity: 1;
    height: auto;
}


/* --- Footer --- */
.footer {
    background-color: var(--bg-dark-2);
}
.copyright {
    color: var(--text-light-2);
    padding: 2rem 1rem;
    text-align: center;
    border-top: 1px solid var(--border-light);
    font-size: 0.9rem;
}


/* --- Back to Top Button --- */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}
#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- Project Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background-color: var(--surface-dark);
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.modal-overlay.visible .modal-content {
    transform: scale(1);
}
.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-light-2);
    cursor: pointer;
    line-height: 1;
}
.modal-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.modal-title {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}
.modal-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.modal-desc {
    margin-bottom: 1.5rem;
    color: var(--text-light-2);
}
.modal-link {
    display: inline-block;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .nav-menu-wrapper {
        display: none;
        flex-direction: column;
        background-color: var(--surface-dark);
        position: absolute;
        top: 65px;
        right: 0;
        width: 100%;
        text-align: center;
        box-shadow: 0 4px 10px var(--shadow-color);
        padding: 1rem;
        border-bottom-left-radius: 8px;
        border-bottom-right-radius: 8px;
    }
    .nav-menu-wrapper.active {
        display: flex;
    }
    .nav-menu {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }
    .nav-menu li {
        padding: 1rem 0;
        border-bottom: 1px solid var(--border-light);
    }
    .nav-menu li:last-child {
        border-bottom: none;
    }
    .theme-toggle-btn {
        margin-top: 1rem;
        margin-left: auto;
        margin-right: auto;
    }
    .hamburger {
        display: flex;
    }

    .hero {
        padding: 4rem 1.5rem;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
    .section-title {
        font-size: 1.8rem;
    }
    .about-content, .mission-values {
        flex-direction: column;
    }
    .contact-form-container {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .project-grid {
        grid-template-columns: 1fr;
    }
    .team-members {
        grid-template-columns: 1fr;
    }
    .modal-content {
        padding: 1.5rem;
    }
    .modal-img {
        height: 180px;
    }
}