@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

:root {
    /* Color Palette */
    --color-bg-primary: #121212;
    --color-bg-secondary: #1e1e1e;
    --color-text-primary: #ffffff;
    --color-text-secondary: #b3b3b3;
    --color-accent: #8EFFF0;
    /* Retaining user's preferred accent */
    --color-accent-hover: #5cdecb;

    /* Spacing */
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-section: 6rem;

    /* Typography */
    --font-main: 'Poppins', sans-serif;

    /* Layout */
    --max-width: 90%;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3 {
    margin-bottom: 1rem;
    line-height: 1.2;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

img {
    max-width: 100%;
    display: block;
}

/* Utilities */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.btn {
    display: inline-block;
    padding: 15px 70px;
    background-color: var(--color-accent);
    color: #000;
    font-weight: 600;
    font-size: 20px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.btn:hover {
    background-color: var(--color-accent-hover);
    transform: translateY(-3px);
}

/* Header / Hero Section */
header {
    min-height: 100vh;
    width: 100%;
    background-color: var(--color-bg-primary);
    /* Static background */
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
    /* Space for nav */
    overflow: hidden;
    /* Ensure particles don't overflow */
}

#header-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    /* Allow clicks to pass through */
}

/* Ensure content stays above particles */
.hero-content,
nav {
    position: relative;
    z-index: 2;
}

nav {
    position: fixed;
    /* Fixed nav for better UX */
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: flex-end;
    z-index: 100;
    background-color: rgba(18, 18, 18, 0.9);
    /* Dimm background for readability */
    backdrop-filter: blur(5px);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--color-text-primary);
    font-weight: 500;
    font-size: 1.1rem;
}

.nav-links a:hover {
    color: var(--color-accent);
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.hero-text {
    flex: 1;
    padding-right: 2rem;
}

.hero-text h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero-text h1 span {
    color: var(--color-accent);
}

.hero-text h2 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 2rem;
    color: var(--color-text-secondary);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    width: 500px;
    /* Larger image */
    height: auto;
    max-height: 750px;
    object-fit: contain;
    /* No border, no box-shadow as requested */
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
    /* Subtle shadow for depth */
}

/* Sections General */
section {
    padding: var(--spacing-section) 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--color-accent);
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text p {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
}

.timeline {
    border-left: 2px solid var(--color-accent);
    padding-left: 2rem;
}

.timeline-item {
    margin-bottom: 2rem;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.6rem;
    top: 0.4rem;
    width: 1rem;
    height: 1rem;
    background-color: var(--color-accent);
    border-radius: 50%;
}

.timeline-date {
    font-size: 0.9rem;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
    display: block;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.skill-card {
    background-color: var(--color-bg-secondary);
    padding: 2rem;
    border-radius: 10px;
    transition: background-color 0.3s;
}

.skill-card:hover {
    background-color: #2a2a2a;
}

.skill-card h3 {
    color: var(--color-accent);
    margin-bottom: 1rem;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--color-bg-secondary);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.project-card:hover {
    transform: translateY(-10px);
}

.project-img {
    height: 200px;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 2rem;
    overflow: hidden;
    /* Ensure image doesn't overflow */
}

.project-thumb {
    width: 100%;
    height: auto;
    object-fit: contain;
    /* Prevent cropping */
    display: block;
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    margin-bottom: 0.5rem;
}

.project-info p {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Footer / Contact */
footer {
    background-color: var(--color-bg-secondary);
    padding: 4rem 0 2rem;
}

.contact-wrapper {
    display: flex;
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto 3rem;
}

.contact-form-container,
.social-notice {
    flex: 1;
    background-color: #252525;
    padding: 2rem;
    border-radius: 10px;
}

.social-notice h3 {
    color: var(--color-accent);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.social-notice p {
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.contact-form-container {
    /* Previously had margin and max-width, resetting for flex usage */
    margin: 0;
    max-width: none;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-text-secondary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    background-color: #333;
    border: 1px solid #444;
    border-radius: 5px;
    color: #fff;
    font-family: var(--font-main);
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.2rem;
}

.contact-item i {
    color: var(--color-accent);
    font-size: 1.5rem;
}

.copy {
    text-align: center;
    color: var(--color-text-secondary);
    border-top: 1px solid #333;
    padding-top: 2rem;
    font-size: 0.9rem;
}

/* Projects Page specific */
.projects-header {
    text-align: center;
    padding: 3rem 0 4rem;
}

.project-detail {
    background-color: var(--color-bg-secondary);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 4rem;
    display: flex;
    flex-direction: column;
}

@media(min-width: 768px) {
    .project-detail {
        flex-direction: row;
    }

    .project-detail-img {
        width: 50%;
        min-height: 300px;
    }

    .project-detail-info {
        width: 50%;
        padding: 3rem;
    }
}

.project-detail-img {
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #555;
    background-size: cover;
    background-position: center;
}

.project-detail-info {
    padding: 2rem;
}

.tech-stack {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.tech-tag {
    background-color: #333;
    color: var(--color-accent);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
}

/* Responsive */
/* Responsive */
@media (max-width: 900px) {
    .container {
        padding: 0 var(--spacing-sm);
    }

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        gap: 2rem;
        padding-top: 20px;
    }

    .hero-text {
        padding-right: 0;
    }

    .hero-text h1 {
        font-size: 3rem;
        line-height: 1.1;
    }

    .hero-text h2 {
        font-size: 1.5rem;
    }

    .hero-image img {
        width: 100%;
        max-width: 400px;
        height: auto;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    nav {
        background-color: rgba(18, 18, 18, 0.98);
        padding: 1rem;
    }

    /* Mobile Nav */
    .hamburger {
        display: block;
    }

    .nav-links {
        position: fixed;
        background-color: rgba(18, 18, 18, 0.98);
        height: 100vh;
        width: 100%;
        top: 0;
        left: 0;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transform: translateY(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 15;
    }

    .nav-links.active {
        transform: translateY(0);
    }

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

    .btn {
        padding: 12px 40px;
        font-size: 18px;
    }

    .projects-header {
        padding-top: 6rem;
    }
}

@media (max-width: 600px) {
    .hero-text h1 {
        font-size: 2.2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .contact-info {
        gap: 1.5rem;
    }

    .contact-item span {
        font-size: 1rem;
    }

    .btn {
        padding: 12px 30px;
        font-size: 16px;
        width: 100%;
        max-width: 300px;
        /* Prevent full width on larger phones */
    }
}

/* Very small screens */
@media (max-width: 350px) {
    html {
        font-size: 14px;
        /* Scale down base font size */
    }

    .hero-text h1 {
        font-size: 1.8rem;
    }

    .btn {
        padding: 10px 0;
        font-size: 14px;
        width: 100%;
    }

    .nav-links a {
        font-size: 1.2rem;
    }
}

/* Fix for contact section stacking on mobile */
@media (max-width: 900px) {
    .contact-wrapper {
        flex-direction: column;
    }
}

/* Legal Footer Links */
.legal-links {
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #333;
    text-align: center;
    font-size: 0.8rem;
}

.legal-links ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 0;
}

.legal-links a {
    color: var(--color-text-secondary);
}

.legal-links a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

/* =========================================
   PROJECT DETAILS PAGE STYLES
   ========================================= */

.project-detail-page {
    padding-top: 2rem;
    padding-bottom: 4rem;
}

.detail-hero {
    text-align: center;
    margin-bottom: 4rem;
}

.detail-hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--color-accent);
}

.detail-hero .subtitle {
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.main-image-container {
    width: 100%;
    max-height: 500px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
}

.main-project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: start;
}

.detail-section {
    margin-bottom: 3rem;
}

.detail-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.detail-section p {
    margin-bottom: 1rem;
    color: #ddd;
    line-height: 1.8;
}

/* Feature List */
.feature-list {
    list-style: none;
}

.feature-list li {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.feature-list i {
    color: var(--color-accent);
    margin-top: 5px;
}

/* Sidebar */
.sidebar-box {
    background-color: var(--color-bg-secondary);
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.sidebar-box h3 {
    margin-bottom: 1.5rem;
    color: var(--color-text-primary);
    font-size: 1.2rem;
    border-left: 3px solid var(--color-accent);
    padding-left: 10px;
}

.tech-stack-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #333;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9rem;
}

.tech-item i {
    color: var(--color-accent);
}

.meta-list li {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

.meta-list strong {
    color: #fff;
    margin-right: 5px;
}

.btn-full {
    display: flex;
    justify-content: center;
    /* Center content horizontally */
    align-items: center;
    /* Center content vertically */
    width: 100%;
    text-align: center;
    margin-bottom: 1rem;
    gap: 10px;
    /* Space between icon and text */
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--color-accent);
    color: var(--color-accent);
}

.btn-outline:hover {
    background-color: var(--color-accent);
    color: #000;
}

/* Gallery */
.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.gallery-item {
    background-color: #333;
    height: 150px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    gap: 10px;
}

@media(max-width: 900px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-hero h1 {
        font-size: 2.5rem;
    }
}

/* =========================================
   CV PRINT STYLES (Embedded)
   ========================================= */
.cv-print-container {
    display: none;
    /* Hidden on screen */
}

@media print {

    /* Hide everything standard */
    body>*:not(.cv-print-container) {
        display: none !important;
    }

    /* Reset Body for Print */
    body {
        background-color: white !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: 100% !important;
        overflow: visible !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Show CV Container */
    .cv-print-container {
        display: block !important;
        width: 210mm;
        min-height: 297mm;
        background-color: white;
        margin: 0 auto;
        position: relative;
        left: 0;
        top: 0;
    }

    /* CV Layout Styles (Namespaced) */
    .cv-print-container .a4-page {
        display: flex;
        width: 100%;
        min-height: 100vh;
        overflow: hidden;
    }

    .cv-print-container .sidebar {
        width: 32%;
        background-color: #1e1e1e !important;
        color: white !important;
        padding: 25px 15px;
        display: flex;
        flex-direction: column;
        height: 100vh;
        /* Full height */
        -webkit-print-color-adjust: exact;
    }

    .cv-print-container .main-content {
        width: 68%;
        padding: 30px 25px;
        background-color: white !important;
        color: #333 !important;
    }

    /* Typography & Components from CV */
    .cv-print-container .profile-header {
        text-align: left;
        margin-bottom: 25px;
    }

    .cv-print-container .profile-header h1 {
        font-family: 'Poppins', sans-serif;
        font-size: 22px;
        font-weight: 700;
        margin-bottom: 5px;
        text-transform: uppercase;
        color: white;
        line-height: 1.1;
    }

    .cv-print-container .profile-header h2 {
        font-family: 'Poppins', sans-serif;
        font-size: 12px;
        font-weight: 400;
        color: #8EFFF0;
        letter-spacing: 1px;
    }

    .cv-print-container .sidebar-section {
        margin-bottom: 25px;
    }

    .cv-print-container .sidebar-title {
        font-family: 'Poppins', sans-serif;
        font-size: 14px;
        color: #8EFFF0;
        border-bottom: 1px solid rgba(142, 255, 240, 0.3);
        padding-bottom: 3px;
        margin-bottom: 10px;
        text-transform: uppercase;
        font-weight: 600;
    }

    .cv-print-container .contact-list li {
        list-style: none;
        margin-bottom: 8px;
        font-size: 11px;
        display: flex;
        align-items: center;
        gap: 8px;
        color: white;
    }

    .cv-print-container .contact-list i {
        color: #8EFFF0;
        width: 14px;
        text-align: center;
        flex-shrink: 0;
    }

    .cv-print-container .skills-list {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .cv-print-container .skill-tag {
        background-color: rgba(255, 255, 255, 0.2) !important;
        padding: 3px 6px;
        border-radius: 3px;
        font-size: 10px;
        white-space: nowrap;
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: white;
    }

    .cv-print-container .lang-item {
        display: flex;
        justify-content: space-between;
        margin-bottom: 6px;
        font-size: 11px;
        color: white;
    }

    .cv-print-container .main-section {
        margin-bottom: 25px;
    }

    .cv-print-container .main-title {
        font-family: 'Poppins', sans-serif;
        font-size: 16px;
        color: #121212;
        text-transform: uppercase;
        font-weight: 700;
        border-bottom: 2px solid #1e1e1e;
        padding-bottom: 3px;
        margin-bottom: 15px;
    }

    .cv-print-container .job-desc {
        font-family: 'Poppins', sans-serif;
        font-size: 12px;
        line-height: 1.4;
        color: #444;
        margin-top: 3px;
        text-align: justify;
    }

    /* Timeline specific to CV */
    .cv-print-container .timeline-item {
        margin-bottom: 15px;
        position: relative;
        padding-left: 15px;
        border-left: 1px solid #ddd;
    }

    .cv-print-container .timeline-item::before {
        content: '';
        position: absolute;
        left: -4.5px;
        top: 6px;
        width: 8px;
        height: 8px;
        background-color: #1e1e1e;
        border-radius: 50%;
    }

    /* Override standard style */

    .cv-print-container .job-title {
        font-size: 14px;
        font-weight: 600;
        color: #000;
    }

    .cv-print-container .job-company {
        font-size: 12px;
        color: #666;
        font-style: italic;
        margin-bottom: 3px;
    }

    .cv-print-container .job-date {
        font-size: 11px;
        color: #888;
        float: right;
        margin-top: 2px;
    }

    /* QR Code */
    .cv-print-container .qr-code-section {
        margin-top: 20px;
        text-align: right;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 10px;
    }

    .cv-print-container .qr-img {
        width: 80px;
        /* Small but visible */
        height: auto;
        border: 1px solid #ddd;
        padding: 5px;
        background: white;
    }
}

/* Add these to the end of your existing CSS or replace the media queries section */

/* Mobile Menu Styles */
.hamburger {
    display: none;
    /* Hidden by default on desktop */
    cursor: pointer;
    color: var(--color-text-primary);
    font-size: 1.5rem;
    z-index: 20;
}

/* Responsive */
@media (max-width: 900px) {
    .container {
        padding: 0 var(--spacing-sm);
    }

    .hero-content {
        flex-direction: column-reverse;
        /* Ensure this is what you want on mobile */
        text-align: center;
        gap: 2rem;
        padding-top: 20px;
    }

    .hero-text {
        padding-right: 0;
    }

    .hero-text h1 {
        font-size: 3rem;
        line-height: 1.1;
    }

    .hero-text h2 {
        font-size: 1.5rem;
    }

    .hero-image img {
        width: 100%;
        max-width: 400px;
        height: auto;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    nav {
        background-color: rgba(18, 18, 18, 0.98);
        padding: 1rem;
    }

    /* Mobile Nav */
    .hamburger {
        display: block;
        /* Shown only on mobile */
    }

    .nav-links {
        position: fixed;
        background-color: rgba(18, 18, 18, 0.98);
        height: 100vh;
        width: 100%;
        top: 0;
        left: 0;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transform: translateY(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 15;
    }

    .nav-links.active {
        transform: translateY(0);
    }

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

    .btn {
        padding: 12px 40px;
        font-size: 18px;
    }

    .projects-header {
        padding-top: 6rem;
    }
}

@media (max-width: 600px) {
    .hero-text h1 {
        font-size: 2.2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .contact-info {
        gap: 1.5rem;
    }

    .contact-item span {
        font-size: 1rem;
    }

    .btn {
        padding: 12px 30px;
        font-size: 16px;
        width: 100%;
        max-width: 300px;
        /* Prevent full width on larger phones */
    }
}

/* Very small screens */
@media (max-width: 350px) {
    html {
        font-size: 14px;
        /* Scale down base font size */
    }

    .hero-text h1 {
        font-size: 1.8rem;
    }

    .btn {
        padding: 10px 0;
        font-size: 14px;
        width: 100%;
    }

    .nav-links a {
        font-size: 1.2rem;
    }
}