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

/* === CSS VARIABLES === */
:root {
    /* Colors - Light Theme */
    --primary-color: #007bff;
    --primary-hover-color: #0056b3;
    --background-color: #f0f2f5;
    --sidebar-bg-color: #ffffff;
    --content-bg-color: #ffffff;
    --text-color: #333333;
    --heading-color: #1a1a1a;
    --subtle-text-color: #6c757d;
    --border-color: #e9ecef;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --nav-shadow-color: rgba(0, 0, 0, 0.1);

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

    /* Layout */
    --border-radius: 12px;
    --card-padding: 1.5rem;
}

/* === DARK THEME VARIABLES === */
body.dark-theme {
    --primary-color: #3898ff;
    --primary-hover-color: #5caaff;
    --background-color: #121212;
    --sidebar-bg-color: #1e1e1e;
    --content-bg-color: #1e1e1e;
    --text-color: #e0e0e0;
    --heading-color: #ffffff;
    --subtle-text-color: #a0a0a0;
    --border-color: #333333;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --nav-shadow-color: rgba(0, 0, 0, 0.3);
}

/* === BASE & RESET === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.4s, color 0.4s;
}

p {
    line-height: 1.8;
}

/* === HIDE SCROLLBARS === */
.sidebar, .content-area {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.sidebar::-webkit-scrollbar, .content-area::-webkit-scrollbar {
    display: none;
}

.portfolio-container {
    display: flex;
    max-width: 1400px;
    margin: 2rem auto;
    height: calc(100vh - 4rem);
    background: var(--sidebar-bg-color);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px var(--shadow-color);
    overflow: hidden;
}

/* === LEFT SIDEBAR (Desktop) === */
.sidebar {
    width: 320px;
    background: var(--sidebar-bg-color);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    transition: background-color 0.4s, border-color 0.4s;
    flex-shrink: 0;
    overflow-y: auto;
}

.profile-info {
    text-align: center;
    margin-bottom: 1.5rem;
}

.profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    object-fit: cover;
    margin-bottom: 1rem;
}

.name { font-size: 1.8rem; color: var(--heading-color); }
.profession { color: var(--subtle-text-color); font-weight: 500; margin-bottom: 1rem; }
.location { display: flex; justify-content: center; align-items: center; gap: 0.5rem; color: var(--subtle-text-color); }

.sidebar-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 1rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.social-links { display: flex; align-items: center; gap: 1.25rem; }
.sidebar .social-links a { font-size: 1.3rem; color: var(--subtle-text-color); transition: color 0.3s, transform 0.3s; }
.sidebar .social-links a:hover { color: var(--primary-color); transform: translateY(-2px); }

.site-controls {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.theme-switcher { font-size: 1.3rem; cursor: pointer; color: var(--heading-color); }

.language-switcher { position: relative; }
.lang-toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--heading-color);
    padding: 0;
}
.lang-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--content-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 15px var(--shadow-color);
    overflow: hidden;
    z-index: 1001; /* Ensure it's above the nav bar */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}
.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 500;
    display: block;
    width: 100%;
    text-align: left;
    transition: background-color 0.3s;
}
.lang-btn:hover { background-color: var(--background-color); }
.lang-btn.active { color: var(--primary-color); font-weight: 600; }

/* Desktop Tabs */
.tabs { margin-top: auto; display: flex; flex-direction: column; gap: 0.5rem; }
.tab-item { display: flex; align-items: center; gap: 1rem; padding: 1rem; border-radius: 8px; cursor: pointer; background: transparent; border: none; color: var(--subtle-text-color); font-size: 1rem; font-weight: 500; text-align: left; transition: background-color 0.3s, color 0.3s; }
.tab-item i { width: 24px; text-align: center; font-size: 1.25rem; }
.tab-item:hover { background: var(--background-color); color: var(--heading-color); }
.tab-item.active { background: var(--primary-color); color: #fff; }

/* === CONTENT AREA === */
.content-area { flex-grow: 1; padding: 3rem; overflow-y: auto; background: var(--background-color); }
.content-section { display: none; }
.content-section.active { display: block; }
.section-title { font-size: 2.5rem; color: var(--heading-color); margin-bottom: 1rem; }
.section-intro { font-size: 1.1rem; max-width: 800px; margin-bottom: 1.5rem; }

.about-cta-container { margin-bottom: 3rem; }
.btn-cv {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 12px 28px;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
}
.btn-cv i { font-size: 1.1rem; }
.btn-cv:hover {
    background: var(--primary-hover-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.about-grid, .projects-grid { display: grid; gap: 1.5rem; }
.about-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.projects-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.about-card, .project-card { background: var(--content-bg-color); padding: var(--card-padding); border-radius: var(--border-radius); border: 1px solid var(--border-color); transition: transform 0.3s, box-shadow 0.3s; }
.about-card:hover, .project-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px var(--shadow-color); }
.about-card i { font-size: 1.75rem; color: var(--primary-color); margin-bottom: 1rem; }
.about-card h3 { color: var(--heading-color); margin-bottom: 0.5rem; }

.project-card { display: flex; flex-direction: column; }
.project-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.project-header i { font-size: 1.75rem; color: var(--primary-color); }
.project-header h3 { color: var(--heading-color); }
.project-card p { flex-grow: 1; margin-bottom: 1.5rem; }
.btn-link, .btn-link-disabled { color: var(--primary-color); text-decoration: none; font-weight: 600; }
.btn-link i { transition: transform 0.3s; vertical-align: middle; }
.btn-link:hover i { transform: translateX(5px); }
.btn-link-disabled { opacity: 0.6; cursor: not-allowed; }

.timeline { position: relative; max-width: 750px; }
.timeline::before { content: ''; position: absolute; width: 3px; background: var(--border-color); top: 0; bottom: 0; left: 8px; }
.timeline-item { position: relative; margin-bottom: 2rem; padding-left: 40px; }
.timeline-dot { position: absolute; width: 18px; height: 18px; left: 0; top: 5px; background-color: var(--primary-color); border: 4px solid var(--background-color); border-radius: 50%; z-index: 1; }
.timeline-date { font-weight: 500; color: var(--subtle-text-color); margin-bottom: 0.5rem; }
.timeline-content h3 { color: var(--heading-color); }
.timeline-content .company { font-style: italic; color: var(--primary-color); margin-bottom: 0.5rem; }

#contact-form { max-width: 700px; }
.form-group { position: relative; margin-bottom: 2.5rem; }
.form-group input, .form-group textarea { width: 100%; padding: 12px 0; background: transparent; border: none; border-bottom: 2px solid var(--border-color); color: var(--text-color); font-size: 1rem; transition: border-color 0.3s; }
.form-group textarea { resize: vertical; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-bottom-color: var(--primary-color); }
.form-group label { position: absolute; top: 12px; left: 0; color: var(--subtle-text-color); transition: all 0.3s; pointer-events: none; }
.form-group input:focus + label, .form-group input:valid + label, .form-group textarea:focus + label, .form-group textarea:valid + label { top: -16px; left: 0; font-size: 0.8rem; color: var(--primary-color); }
.btn-cta { display: inline-flex; align-items: center; gap: 0.75rem; padding: 12px 28px; border-radius: 8px; border: none; text-decoration: none; font-weight: 600; cursor: pointer; transition: all 0.3s ease; background: var(--primary-color); color: #fff; }
.btn-cta:hover { background: var(--primary-hover-color); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3); }

.contact-socials { margin-top: 4rem; text-align: center; }
.contact-socials-title { color: var(--subtle-text-color); font-weight: 500; margin-bottom: 1.5rem; }
.contact-socials .social-links { justify-content: center; gap: 2rem; }
.contact-socials .social-links a { font-size: 1.8rem; color: var(--subtle-text-color); }
.contact-socials .social-links a:hover { color: var(--primary-color); transform: translateY(-3px); }


/*
============================================================
=== RESPONSIVE DESIGN (TABLET & MOBILE) - CORRECTED FIX ===
============================================================
*/

@media (max-width: 1024px) {
    body {
        /* This is crucial: Add padding to prevent the fixed header and footer from covering your content */
        padding-top: 70px; 
        padding-bottom: 75px; 
    }

    .portfolio-container {
        flex-direction: column;
        height: auto;
        margin: 0;
        border-radius: 0;
        box-shadow: none; /* Remove shadow for full-screen mobile view */
    }

    /* --- TOP HEADER BAR (Replaces the Sidebar) --- */
    .sidebar {
        /* This turns the sidebar into a fixed header bar at the top */
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        width: 100%;
        height: 70px; /* Give it a fixed height */
        flex-direction: row; /* Arrange items horizontally */
        justify-content: space-between;
        align-items: center;
        padding: 0 1rem; /* Adjust padding for a cleaner look */
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        background: var(--sidebar-bg-color); /* Use the theme background */
        overflow: visible; /* Allow dropdowns to show */
    }

    /* --- FIX: Simplify the header content layout --- */
    .sidebar-top {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    .profile-info {
        /* Use grid to neatly align the smaller profile picture and text */
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        column-gap: 0.75rem;
        align-items: center;
        text-align: left;
        margin: 0;
    }

    .profile-pic {
        grid-row: 1 / 3;
        width: 45px;
        height: 45px;
        border-width: 2px;
        margin: 0;
    }

    .name {
        grid-column: 2;
        grid-row: 1;
        font-size: 1rem;
        line-height: 1.2;
    }

    .profession {
        grid-column: 2;
        grid-row: 2;
        font-size: 0.75rem;
        line-height: 1.2;
        margin: 0;
    }
    
    .location, 
    .sidebar .social-links {
        display: none; /* Hide location and social links in the header to declutter */
    }

    .sidebar-actions {
        display: contents; /* This allows .site-controls to be a direct flex item of .sidebar */
    }

    .site-controls {
        gap: 1.2rem;
    }

    .theme-switcher, .lang-toggle-btn {
        font-size: 1.2rem;
    }


    /* --- BOTTOM NAVIGATION BAR (This is the critical fix for the overlapping tabs) --- */
    .tabs {
        /* This moves the navigation tabs to a fixed bar at the bottom */
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        
        /* Arrange tabs in a row and space them out */
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        
        /* Styling for the bar */
        height: 75px;
        background: var(--sidebar-bg-color);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 -2px 10px var(--nav-shadow-color);
        margin-top: 0;
    }

    .tab-item {
        /* This stacks the icon and text vertically to prevent overlap */
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0.25rem;
        padding: 0.6rem 0.5rem;
        font-weight: 500;
        flex-grow: 1; /* Ensure items take up equal space */
        border-radius: 0;
        color: var(--subtle-text-color);
    }

    .tab-item i {
        font-size: 1.25rem; /* Make icons clear and tappable */
    }

    .tab-item span {
        font-size: 0.7rem; /* Small but readable labels */
    }

    /* Style the active tab to be obvious */
    .tab-item.active {
        color: var(--primary-color);
        background: transparent; /* Remove the desktop background color */
    }

    /* --- CONTENT AREA ADJUSTMENTS --- */
    .content-area {
        padding: 2rem 1.5rem; /* Add consistent padding */
    }

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


@media (max-width: 480px) {
    .content-area {
        padding: 1.5rem 1rem;
    }

    .btn-cv, .btn-cta {
        width: 100%;
        justify-content: center;
        padding: 14px;
    }
}
