/* =================================================================== */
/* ---        FINAL, ORGANIZED & RESPONSIVE STYLESHEET           --- */
/* =================================================================== */

/* --- Google Fonts & CSS Reset --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Ensures padding and borders don't break layouts */
}

/* --- Root Variables for Colors & Fonts --- */
:root {
    --primary-color: #3671E9;
    --secondary-color: #2D5FBE;
    --linkedin-blue: #0A66C2;
    --background-dark: #121212;
    --surface-color: #1E1E1E;
    --text-primary: #FAFAFA;
    --text-secondary: #A0A0A0;
    --font-family: "Poppins", sans-serif;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    /* Final safeguard against accidental overflow */
}

body {
    background-color: var(--background-dark);
    color: var(--text-primary);
    font-family: var(--font-family);
}

/* --- Global Styles --- */
a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

.container {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 4rem auto;
}

/* --- Header & Navigation --- */
.header {
    background-color: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #333;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-primary);
    font-weight: 400;
    position: relative;
    padding-bottom: 0.5rem;
}

.nav-link.active,
.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

/* --- Main Content & Sections --- */
main {
    padding-top: 80px;
}

section {
    padding: 6rem 0;
}

/* --- Button Component Styles --- */
.btn {
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    border: 2px solid transparent;
    /* Set transparent border initially for smooth hover */
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(54, 113, 233, 0.4);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(54, 113, 233, 0.5);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
}

.btn-linkedin {
    background-color: var(--linkedin-blue);
    border-color: var(--linkedin-blue);
    color: #fff !important;
}

.btn-linkedin:hover {
    background-color: transparent;
    color: var(--linkedin-blue) !important;
    border-color: var(--linkedin-blue);
    transform: translateY(-3px);
}

/* --- Hero Section --- */
.hero {
    display: flex;
    align-items: center;
    min-height: calc(100vh - 80px);
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    width: 100%;
}

.hero-content {
    max-width: 600px;
}

.hero-content h3 {
    font-size: 1.5rem;
    font-weight: 400;
}

.hero-content .subtitle {
    min-height: 50px;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.hero-content h1 .name {
    color: var(--primary-color);
}

.typed-wrapper {
    display: inline-block;
    min-width: 450px;
}

#typed-element {
    color: var(--primary-color);
    font-weight: 600;
}

.hero-buttons {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

.hero-image {
    max-width: 350px;
    text-align: center;
}

.hero-image img {
    width: 100%;
    border-radius: 50%;
    border: 5px solid var(--primary-color);
    box-shadow: 0 0 25px rgba(54, 113, 233, 0.4);
}

/* --- About & Certifications Section --- */
.about-container {
    display: flex;
    gap: 4rem;
    align-items: center;
}

.about-image img {
    width: 300px;
    border-radius: 10px;
    border: 3px solid var(--surface-color);
}

.about-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.about-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.about-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.info-item {
    background-color: var(--surface-color);
    padding: 1rem;
    border-radius: 8px;
}

.info-item span {
    font-weight: 600;
    color: var(--primary-color);
}

.certification-card {
    background-color: var(--surface-color);
    border-radius: 10px;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid #333;
    transition: all 0.3s ease;
}

.certification-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.cert-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #333;
}

.cert-logo {
    width: 60px;
    height: 60px;
}

.cert-title h3 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.cert-title p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.cert-body {
    padding: 1.5rem 0;
}

.cert-body p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.cert-body h4 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.cert-skills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cert-footer {
    text-align: right;
    padding-top: 1rem;
}

/* --- Services & Projects Sections --- */
.services-grid,
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.service-card {
    background-color: var(--surface-color);
    padding: 2.5rem 2rem;
    border-radius: 10px;
    text-align: center;
    border-bottom: 4px solid transparent;
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    border-bottom-color: var(--primary-color);
}

.service-card .icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.project-card {
    background-color: var(--surface-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-image img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    font-size: 1.4rem;
    color: var(--primary-color);
}

.project-content p {
    color: var(--text-secondary);
    margin: 1rem 0;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-tag {
    background-color: #333;
    color: var(--text-secondary);
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    font-size: 0.8rem;
}

.project-links a {
    font-size: 1.5rem;
    margin-right: 1rem;
}

/* --- Contact, Auth & Account Page Styles --- */
.contact-container {
    display: flex;
    gap: 4rem;
}

.contact-info {
    flex-basis: 40%;
}

.contact-form {
    flex-basis: 60%;
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-info-item .icon {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.contact-info-item h4 {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

.contact-info-item p {
    color: var(--text-secondary);
}

.auth,
.account {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    padding: 4rem 0;
}

.auth-card {
    background-color: var(--surface-color);
    max-width: 450px;
    width: 100%;
    border-radius: 10px;
    padding: 2.5rem;
    border: 1px solid #333;
}

.auth-card h1 {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-card .sub {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab {
    flex: 1;
    padding: 0.7rem;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    background-color: #333;
    transition: all 0.3s ease;
}

.tab:hover {
    background-color: #444;
}

.tab.active {
    background-color: var(--primary-color);
    color: var(--text-primary);
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border-radius: 5px;
    border: 1px solid #444;
    background-color: var(--background-dark);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 1rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    width: 100%;
    padding-right: 40px;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-secondary);
}

.form-group.remember-me {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
}

#submitBtn {
    width: 100%;
    margin-top: 1.5rem;
}

.small {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    text-align: center;
    min-height: 1.2em;
}

.danger-zone {
    margin-top: 3rem;
    border-top: 1px solid #444;
    padding-top: 1.5rem;
}

.danger-zone h2 {
    color: #ff6b6b;
    font-size: 1.2rem;
}

.danger-zone p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.5rem 0 1rem;
}

.btn-danger {
    background-color: #ff6b6b;
    border-color: #ff6b6b;
    color: #fff;
}

.btn-danger:hover {
    background-color: #e03131;
    border-color: #e03131;
}

/* --- Footer --- */
.footer {
    background-color: var(--surface-color);
    padding: 3rem 0;
    text-align: center;
}

.footer-socials {
    margin-bottom: 1.5rem;
}

.footer-socials a {
    font-size: 1.5rem;
    margin: 0 1rem;
    color: var(--text-secondary);
}

.footer-socials a:hover {
    color: var(--primary-color);
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
}


/* =================================================================== */
/* ---           SINGLE, CONSOLIDATED RESPONSIVE SECTION           --- */
/* =================================================================== */

/* --- Tablet View --- */
@media (max-width: 992px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 60%;
        height: calc(100vh - 70px);
        background-color: var(--surface-color);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: right 0.4s ease-in-out;
        gap: 3rem;
    }

    .nav-menu.active {
        right: 0;
    }

    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
        gap: 3rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .typed-wrapper {
        min-width: unset;
    }

    .about-container,
    .contact-container {
        flex-direction: column;
    }
}

/* --- Mobile View --- */
@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .hero-content h1 {
        font-size: 2.8rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .btn,
    .btn-secondary,
    .btn-primary,
    .btn-linkedin {
        width: 350px;
        /* max-width: 350px; */
    }

    .about-info {
        grid-template-columns: 1fr;
    }

    .nav-menu {
        width: 80%;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .cert-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .cert-footer {
        display: flex;
        text-align: center;
    }
}


