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

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

:root {
    --background-color: #1C1C1C; /* Very Dark Gray */
    --primary-color: #349c74; /* Emerald Green */
    --secondary-color: #4db894; /* Light Green */
    --text-color: #FFFFFF; /* White for text */
    --accent-color: #FF6F61; /* Coral for accent */
    --card-background: #262626; /* Card background for dark theme */
    --card-shadow: rgba(0, 0, 0, 0.3);
}

/* Light Theme */
[data-theme="light"] {
    --background-color: #F5F5F5;
    --primary-color: #2d8a65;
    --secondary-color: #349c74;
    --text-color: #1C1C1C;
    --accent-color: #FF6F61;
    --card-background: #FFFFFF;
    --card-shadow: rgba(0, 0, 0, 0.1);
}

/* Smooth theme transition */
html {
    font-size: 10px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    font-family: Inter, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Common Styles */
img {
    width: 100%;
    display: block; /* Ensures no unexpected spacing */
}

a {
    text-decoration: none;
    color: var(--secondary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color);
}

.description {
    margin-top: 1rem;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.title {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 2rem;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.item_preTitle {
    font-size: 1.4rem;
    color: var(--text-color);
    font-weight: 300;
    transition: color 0.3s ease;
}

.item_title {
    font-size: 1.9rem;
    color: var(--secondary-color);
    font-weight: 500;
    margin: 0.8rem 0;
    transition: color 0.3s ease;
}

.item_subtitle {
    font-size: 1.4rem;
    color: var(--text-color);
    font-weight: 400;
    transition: color 0.3s ease;
    margin: 0.3rem 0;
}

.item_subtitle-faculty {
    margin-bottom: 0.2rem;
}

/* Layouts */
.container {
    max-width: 1400px;
    width: 90%;
    margin: 0 auto;
    display: grid;
    padding: 5rem;
    background: var(--background-color);
    grid-template-columns: 1fr 2fr;
    grid-template-areas:
        "profile profile"
        "sidebar main";
    gap: 3rem;
    transition: background-color 0.3s ease;
}

@media only screen and (max-width: 768px) {
    .container {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 3rem;
        gap: 3rem;
    }

    .sidebar {
        display: contents !important;
    }

    .main-content {
        display: contents !important;
    }

    /* Mobile card order: profile, socials, skills, experience, projects, publications, education, languages, hardware, contact, export cv, terminal cv */
    .profile {
        order: 1 !important;
    }

    .social {
        order: 2 !important;
    }

    .skills {
        order: 3 !important;
    }

    #experience {
        order: 4 !important;
    }

    #projects {
        order: 5 !important;
    }

    #publications {
        order: 6 !important;
    }

    .edu {
        order: 7 !important;
    }

    .interest {
        order: 8 !important;
    }

    .hardware-card {
        order: 9 !important;
    }

    .contact {
        order: 10 !important;
    }

    .pdf-card {
        order: 11 !important;
    }

    .cli-section {
        order: 12 !important;
    }

    .profile,
    .contact,
    .exp,
    .edu,
    .skills,
    .interest,
    .social {
        padding: 2rem;
    }
}

.profile {
    grid-area: profile;
    background: var(--card-background);
    border-radius: 1.2rem;
    padding: 3rem;
    box-shadow: 0 4px 6px var(--card-shadow);
    transition: all 0.3s ease;
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* Main Content */
.main-content {
    grid-area: main;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* Profile */
.profile_container {
    display: flex;
    gap: 2rem;
    align-items: center; /* Vertically centers the content */
}

.profile_profileImg {
    width: 250px;
    height: 250px;
    flex-shrink: 0; /* Prevents the container from shrinking */
    border-radius: 50%; /* Ensures the container itself is circular */
    overflow: hidden; /* Hides any overflow to maintain the circle */
    position: relative; /* For better control if needed */
}

.profile_profileImg img {
    width: 100%;
    height: 100%;
    border-radius: 50%; /* Makes the image circular */
    object-fit: cover; /* Ensures the image covers the container without distortion */
    display: block; /* Removes any unwanted gaps */
}

.profile_name_firstName {
    color: var(--primary-color);
    font-weight: 700;
    font-size: clamp(2.5rem, 15vw, 7rem);
    display: inline;
    transition: color 0.3s ease;
}

.profile_name_lastName {
    color: var(--text-color);
    font-weight: 300;
    font-size: clamp(2.2rem, 13vw, 6rem);
    text-transform: uppercase;
    display: inline;
    margin-left: 0.5rem;
    letter-spacing: -0.2rem;
    transition: color 0.3s ease;
}

.profile_title {
    font-size: 1.5rem;
    font-weight: 400;
    text-transform: uppercase;
}

/* Print Button */
.printBtn {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-color);
    background-color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: Inter, sans-serif;
}

.printBtn:hover {
    background-color: transparent;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.printBtn svg {
    width: 2rem;
    height: 2rem;
}

/* PDF Download Card */
.pdf-card {
    background: var(--card-background);
    border-radius: 1.2rem;
    padding: 3rem;
    box-shadow: 0 4px 6px var(--card-shadow);
    transition: all 0.3s ease;
}

.pdf-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px var(--card-shadow);
}

.pdf-text {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-color);
    margin: 1rem 0 1.5rem 0;
    transition: color 0.3s ease;
}

.pdf-card .printBtn {
    margin-top: 0;
}

/* Hardware Card */
.hardware-card {
    background: var(--card-background);
    border-radius: 1.2rem;
    padding: 3rem;
    box-shadow: 0 4px 6px var(--card-shadow);
    transition: all 0.3s ease;
}

.hardware-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px var(--card-shadow);
}

.hardware-item {
    margin-top: 1.5rem;
}

.hardware-name {
    font-size: 1.9rem;
    color: var(--text-color);
    font-weight: 600;
    margin: 0 0 1.2rem 0;
}

.hardware-specs {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hardware-specs li {
    font-size: 1.4rem;
    color: var(--text-color);
    padding: 0.5rem 0;
}

.hardware-specs li span:first-child {
    font-weight: 500;
    color: var(--primary-color);
}

.hardware-services {
    display: block;
}

.hardware-services-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 2rem;
}

.hardware-services-list li {
    font-size: 1.3rem;
    padding: 0.3rem 0;
    position: relative;
    padding-left: 1.5rem;
}

.hardware-services-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--secondary-color);
}

@media only screen and (max-width: 768px) {
    .pdf-card {
        padding: 2rem;
    }

    .pdf-text {
        font-size: 1.5rem;
    }

    .hardware-card {
        padding: 2rem;
    }

    .hardware-specs li {
        font-size: 1.3rem;
    }
}

@media only screen and (max-width: 768px) {
    .profile_container {
        flex-direction: column;
    }
}

/* Card sections */
.contact,
.exp,
.edu,
.skills,
.interest,
.social {
    background: var(--card-background);
    border-radius: 1.2rem;
    padding: 3rem;
    box-shadow: 0 4px 6px var(--card-shadow);
    transition: all 0.3s ease;
}

.contact:hover,
.exp:hover,
.edu:hover,
.skills:hover,
.interest:hover,
.social:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px var(--card-shadow);
}

/* Expertise */
.skills_list {
    margin-top: 1rem;
    margin-left: 2rem;
    line-height: 2;
}

.skills_list img {
    width: 50px; /* Adjust as needed */
    height: 50px; /* Keeps the image square */
}

/* Skills Tags */
.skills-category {
    margin-top: 2rem;
}

.skills-category:first-of-type {
    margin-top: 1.5rem;
}

.skills-category-title {
    font-size: 1.6rem;
    color: var(--secondary-color);
    font-weight: 500;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.skill-tag {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background-color: rgba(52, 156, 116, 0.15);
    color: var(--text-color);
    font-size: 1.3rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: 1px solid var(--primary-color);
    transition: all 0.3s ease;
    cursor: default;
}

.skill-tag:hover {
    background-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(52, 156, 116, 0.3);
}

/* Tech Stack Tags */
.tech-stack-title {
    font-size: 1.4rem;
    color: var(--text-color);
    font-weight: 400;
    margin-top: 1.2rem;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.tech-stack-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.tech-category {
    display: flex;
    flex-direction: column;
}

.tech-category-label {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tech-tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: rgba(52, 156, 116, 0.15);
    color: var(--text-color);
    font-size: 1.2rem;
    font-weight: 500;
    border-radius: 0.4rem;
    border: 1px solid var(--primary-color);
    transition: all 0.3s ease;
    cursor: default;
}

.tech-tag:hover {
    background-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(52, 156, 116, 0.3);
}

.projects-links {
    margin-top: 1rem;
    display: flex;
    gap: 1.2rem;
}

.project-icon-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--secondary-color);
    font-size: 1.3rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.project-icon-link:hover {
    color: var(--primary-color);
}

.project-icon-link i {
    width: 1.8rem;
    height: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-icon-link svg {
    width: 1.8rem;
    height: 1.8rem;
}

/* References */
.ref_item {
    margin-top: 2rem;
}

.ref_name {
    font-size: 1.6rem;
    font-weight: 700;
}

/* Education */
.edu_item {
    margin-top: 2rem;
}

/* Certification */
.certification_item {
    margin-top: 2rem;
}

/* Experience */
.exp_item {
    margin-top: 2rem;
}

/* Projects - Add visual separation between project items */
#projects .exp_item {
    padding-bottom: 2.5rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid rgba(52, 156, 116, 0.2);
}

#projects .exp_item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

/* Awards */
.awards_item {
    margin-top: 2rem;
}

/* Interests */
.interest_items {
    margin-top: 2rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.interest_item {
    font-size: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.interest_item svg {
    width: 2rem;
}

/* Socials */
.social_items {
    margin-top: 2rem;
}

.social_item {
    margin-top: 1.5rem;
    font-size: 1.5rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
    color: var(--text-color);
    transition: color 0.3s ease, transform 0.2s ease;
}

.social_item:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.social_item svg {
    width: 2rem;
    height: 2rem;
}

/* CLI Section */
.cli-section {
    background: var(--card-background);
    border-radius: 1.2rem;
    padding: 3rem;
    box-shadow: 0 4px 6px var(--card-shadow);
    transition: all 0.3s ease;
}

.cli-section:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 12px var(--card-shadow);
}

.cli-link {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text-color);
    background-color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cli-link:hover {
    background-color: transparent;
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.cli-link svg {
    width: 2rem;
    height: 2rem;
}

hr {
    grid-column: 1 / -1;
    width: 80%;
    margin: 0 auto;
    margin-top: 5rem;
    margin-bottom: 1rem;
    border: none;
    border-top: 2px solid rgba(128, 128, 128, 0.229);
}

@media only screen and (max-width: 768px) {
    hr {
        margin: 0 auto;
    }
}

/* Responsive Adjustments for Profile Image */
@media only screen and (max-width: 768px) {
    .profile_profileImg {
        width: 200px;
        height: 200px;
    }
}

@media only screen and (max-width: 480px) {
    .profile_profileImg {
        width: 150px;
        height: 150px;
    }
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 4rem;
    height: 4rem;
    border-radius: 1.2rem;
    background-color: var(--primary-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.theme-toggle svg {
    width: 2rem;
    height: 2rem;
    color: white;
    transition: all 0.3s ease;
}

[data-theme="dark"] .sun-icon {
    opacity: 0;
    transform: rotate(180deg) scale(0);
    position: absolute;
}

[data-theme="dark"] .moon-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="light"] .sun-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

[data-theme="light"] .moon-icon {
    opacity: 0;
    transform: rotate(-180deg) scale(0);
    position: absolute;
}

@media only screen and (max-width: 768px) {
    .theme-toggle {
        top: 1.5rem;
        right: 1.5rem;
        width: 3.5rem;
        height: 3.5rem;
    }
}

/* Language Toggle Button */
.language-toggle {
    position: fixed;
    top: 7rem;
    right: 2rem;
    width: 4rem;
    height: 4rem;
    border-radius: 1.2rem;
    background-color: var(--primary-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.language-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.language-toggle .lang-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.05em;
}

@media only screen and (max-width: 768px) {
    .language-toggle {
        top: 6rem;
        right: 1.5rem;
        width: 3.5rem;
        height: 3.5rem;
    }

    .language-toggle .lang-text {
        font-size: 1.2rem;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 5rem;
    height: 5rem;
    border: 4px solid rgba(52, 156, 116, 0.3);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fade-in Animation */
.fade-in {
    animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Print Styles */
@media print {
    /* Hide interactive elements */
    .theme-toggle,
    .printBtn,
    .loading-overlay,
    .pdf-card,
    .cli-section {
        display: none !important;
    }

    /* Reset colors for print */
    :root,
    [data-theme="light"],
    [data-theme="dark"] {
        --background-color: #FFFFFF;
        --primary-color: #2d8a65;
        --secondary-color: #349c74;
        --text-color: #000000;
        --card-background: #FFFFFF;
        --card-shadow: rgba(0, 0, 0, 0);
    }

    /* Remove card effects for print */
    .profile,
    .contact,
    .exp,
    .edu,
    .skills,
    .interest,
    .social,
    .pdf-card {
        box-shadow: none;
        border: 1px solid #e0e0e0;
        page-break-inside: avoid;
    }

    body {
        background-color: white;
        color: black;
    }

    /* Optimize layout for A4 */
    .container {
        max-width: 100%;
        width: 100%;
        padding: 2rem;
        margin: 0;
        box-shadow: none;
        gap: 2rem;
        grid-template-columns: 1fr 2fr;
        grid-template-areas:
            "profile profile"
            "sidebar main";
    }

    /* Ensure content fits on page */
    .sidebar,
    .main-content {
        gap: 1.5rem;
    }

    .exp_item,
    .edu_item {
        margin-top: 1.5rem;
        page-break-inside: avoid;
    }

    /* Adjust font sizes for print */
    .title {
        font-size: 1.8rem;
    }

    .description {
        font-size: 1.3rem;
    }

    .item_title {
        font-size: 1.6rem;
    }

    /* Ensure links are visible */
    a {
        color: var(--primary-color);
        text-decoration: underline;
    }

    /* Profile adjustments */
    .profile_profileImg {
        width: 150px;
        height: 150px;
    }

    .profile_name_firstName {
        font-size: 4rem;
    }

    .profile_name_lastName {
        font-size: 3.5rem;
    }

    /* Social icons for print */
    .social_item svg {
        width: 1.5rem;
    }

    /* Page breaks */
    .profile {
        page-break-after: avoid;
    }

    h3.title {
        page-break-after: avoid;
    }
}
