@import url("https://fonts.googleapis.com/css?family=DM+Sans:400,500|Jost:400,500,600&display=swap");

/* ===== Root Variables ===== */
:root {
    --white: #FFF;
    --gray: #F3F3F3;
    --gray-mid: #9D9D9D;
    --gray-dark: #3e3e3e;
    --gray-hover: #F7F7F7;
    --body-background: #dfdfdf;
    --primary-purple: #6C63FF;
    --primary-purple-light: #e7e3ff;
}

/* ===== Base & Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Jost', 'Poppins', sans-serif;
    color: #2b2c48;
    background-color: var(--primary-purple-light);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    min-height: 100vh;
    padding: 20px;
}

.copyright {
    position: absolute;
    bottom: 2px;
    right: 15px;
    font-size: 0.75rem;
    color: var(--gray-mid);
}

/* ===== General Layout Containers ===== */
#contain {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80vh;
    width: 100%;
}

#contain .row {
    display: flex;
    justify-content: center;
    align-items: stretch; /* Changed for better alignment on wrap */
    height: 100%;
    width: 100%;
    gap: 16px;
}

#contain .col,
#contain .col-3 {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

/* ===== Tabs Component ===== */
.tabs-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    padding: 16px;
    gap: 8px;
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
}

.tabs {
    position: relative;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    list-style-type: none;
    gap: 8px;
    padding-right: 16px;
    padding-left: 0;
    border-right: 1px solid #F0F0F0;
}

.tabs li {
    width: 100%;
    margin-bottom: 4px;
}

.tabs a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: start;
    gap: 8px;
    width: 100%;
    padding: 12px;
    color: var(--gray-mid);
    text-align: left;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease-in-out;
}

.tabs a img {
    height: 20px;
    width: 20px;
}

.tabs a svg {
    fill: var(--gray-mid);
    transition: fill 0.3s ease-in-out;
}

.tabs a.active,
.tabs a:hover {
    color: var(--white);
    background-color: var(--gray-dark);
    font-weight: 700;
    outline: none;
}

.tabs a.active svg,
.tabs a:hover svg {
    fill: var(--white);
}

.tab-content-wrapper {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100%;
    width: 100%;
    padding-right: 16px; /* Add some padding for the scrollbar */
}

.tab-content {
    display: none;
    min-width: 240px;
    font-size: 0.8rem;
    opacity: 0; /* Start hidden for animation */
    transition: opacity 0.5s ease-in-out; /* Smooth transition */
}

.tab-content.active {
    display: block;
    opacity: 1; /* Fade in */
}

.tab-content h2 {
    margin-top: 0;
    margin-bottom: 8px;
    color: var(--gray-dark);
    font-size: 1.2rem;
    font-weight: 600;
}

.separator {
    margin: 30px 0;
    color: var(--gray-mid);
}

/* ===== Profile Card Component ===== */
.card {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    margin: auto;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
    background-color: white;
    border-radius: 10px;
    box-shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
    transition: 0.3s;
    -webkit-transition: 0.3s;
}

.floater {
    position: absolute;
    top: 55%;
    left: 60%;
    padding: 2px 5px;
    background: var(--primary-purple);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 10px;
    cursor: pointer;
    transition: 0.3s;
    -webkit-transition: 0.3s;
}

.card-header {
    position: relative;
    display: flex;
    height: 200px;
    flex-shrink: 0;
    width: 100%;
    transition: 0.3s;
    -webkit-transition: 0.3s;
}

.card-header * {
    transition: 0.3s;
    -webkit-transition: 0.3s;
}

.card-cover {
    position: absolute;
    width: 100%;
    height: 160px;
    top: -20%;
    left: 0;
    background-size: cover;
    background-position: center;
    will-change: top;
    filter: blur(30px);
    -webkit-filter: blur(30px);
    transform: scale(1.2);
    -webkit-transform: scale(1.2);
    transition: 0.5s;
    -webkit-transition: 0.5s;
}

.card-avatar {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    box-shadow: 0 8px 8px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    object-position: center;
    transform: translateX(-50%) translateY(-64px);
    -webkit-transform: translateX(-50%) translateY(-64px);
}

.card-fullname {
    position: absolute;
    left: 50%;
    bottom: 5px;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    transform: translateY(-10px) translateX(-50%);
    -webkit-transform: translateY(-10px) translateX(-50%);
}

.card-jobtitle {
    position: absolute;
    left: 50%;
    bottom: 0;
    margin: 0;
    margin-top: 10px;
    opacity: 0.7;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transform: translateX(-50%) translateY(-7px);
    -webkit-transform: translateX(-50%) translateY(-7px);
}

.card-main {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    padding-top: 10px;
    overflow-y: auto; /* Allow scrolling on card */
}

/* Card Active State */
.card.is-active .card-header {
    height: 80px;
}

.card.is-active .card-cover {
    height: 100px;
    top: -50px;
}

.card.is-active .card-avatar {
    left: 20px;
    bottom: 10px;
    width: 50px;
    height: 50px;
    transform: none;
    -webkit-transform: none;
}

.card.is-active .card-fullname,
.card.is-active .card-jobtitle {
    left: 86px;
    transform: none;
    -webkit-transform: none;
}

.card.is-active .card-fullname {
    bottom: 18px;
    font-size: 19px;
}

.card.is-active .card-jobtitle {
    bottom: 16px;
    font-size: 10px;
    letter-spacing: 1px;
}

/* Card Content */
.card-content {
    padding: 20px;
}

.card-subtitle {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

.card-desc {
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #636b6f;
    line-height: 1.6;
    margin: 0;
}

.card-social {
    display: flex;
    align-items: center;
    padding: 0 20px;
    margin-bottom: 30px;
}

.card-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 35px;
    width: 35px;
    margin-right: 10px;
    color: #8797a1;
    background-color: rgba(93, 133, 193, 0.05);
    border-radius: 50%;
    transition: 0.3s;
    -webkit-transition: 0.3s;
}

.card-social a:last-child {
    margin-right: 0;
}

.card-social svg {
    display: block;
    width: 16px;
    height: 16px;
    fill: #a5b5ce;
    stroke: #a5b5ce;
    transition: all 0.3s;
    -webkit-transition: all 0.3s;
}

.card-social a:hover svg {
    fill: var(--primary-purple);
    stroke: var(--primary-purple);
}

/* Card Tab Buttons */
.card-buttons {
    display: flex;
    position: sticky;
    bottom: 0;
    left: 0;
    margin-top: auto;
    background-color: #fff;
    z-index: 10;
}

.card-buttons button {
    flex: 1 1 auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    background: 0;
    border: 0;
    outline: 0;
    padding: 15px 5px;
    cursor: pointer;
    color: #5c5c6d;
    font-family: "Jost", sans-serif;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: 0.3s;
    -webkit-transition: 0.3s;
}

.card-buttons button.is-active,
.card-buttons button:hover {
    color: #2b2c48;
    border-bottom: 3px solid var(--primary-purple);
    background: linear-gradient(to bottom, rgba(127, 199, 231, 0) 0%, rgba(207, 204, 255, 0.2) 44%, rgba(211, 226, 255, 0.4) 100%);
    background: -webkit-gradient(linear, left top, left bottom, from(rgba(127, 199, 231, 0)), color-stop(44%, rgba(207, 204, 255, 0.2)), to(rgba(211, 226, 255, 0.4)));
}

/* Card Sections (Tabs) */
.card-section {
    display: none;
}

.card-section.is-active {
    display: block;
    animation: fadeIn 0.6s both;
    -webkit-animation: fadeIn 0.6s both;
}

/* Timeline */
.card-timeline {
    position: relative;
    margin-top: 30px;
}

.card-timeline:after {
    content: "";
    position: absolute;
    top: 0;
    left: 42px;
    width: 2px;
    height: 100%;
    background: linear-gradient(to top, rgba(134, 214, 243, 0) 0%, #516acc 100%);
    background: -webkit-gradient(linear, left bottom, left top, from(rgba(134, 214, 243, 0)), to(#516acc));
}

.card-item {
    position: relative;
    z-index: 1;
    padding-left: 60px;
    padding-right: 20px;
    padding-bottom: 30px;
}

.card-item:last-child {
    padding-bottom: 5px;
}

.card-item:after {
    content: attr(data-year);
    position: absolute;
    top: 0;
    left: 39px;
    width: 8px;
    height: 8px;
    border: 2px solid #fff;
    border-radius: 50%;
    color: rgba(134, 134, 134, 0.7);
    background: linear-gradient(to bottom, #a0aee3 0%, #516acc 100%);
    background: -webkit-gradient(linear, left top, left bottom, from(#a0aee3), to(#516acc));
    font-size: 11px;
    line-height: 0.6;
    text-indent: -35px;
}

.card-item-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
}

.card-item-title span {
    color: #6f6f7b;
    font-weight: bold;
}

.card-item-desc {
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    color: #6f6f7b;
    line-height: 1.5;
}

/* Contact Section */
.card-contact-wrapper {
    margin-top: 20px;
}

.card-contact {
    display: flex;
    align-items: center;
    font-family: "DM Sans", sans-serif;
    color: #6f6f7b;
    font-size: 13px;
    line-height: 1.6;
    cursor: pointer;
}

.card-contact + .card-contact {
    margin-top: 16px;
}

.card-contact svg {
    flex-shrink: 0;
    width: 25px;
    min-height: 34px;
    margin-right: 12px;
    padding-right: 12px;
    border-right: 1px solid #dfe2ec;
    transition: 0.3s;
    -webkit-transition: 0.3s;
}

.contact-me {
    width: 100%;
    padding: 12px 16px;
    margin-top: 25px;
    border: 0;
    outline: none;
    border-radius: 5px;
    color: #fff;
    background: linear-gradient(to right, #735ce7, #acc3ff);
    box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.15);
    font-family: "Jost", sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.3s;
    -webkit-transition: 0.3s;
}

.card-contact {
    text-decoration: none;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@-webkit-keyframes fadeIn {
    0% {
        opacity: 0;
        -webkit-transform: translateY(40px);
    }
    100% {
        opacity: 1;
        -webkit-transform: translateY(0);
    }
}


/* Github cards */
.github-cards {
    /* MODIFIED: Changed to grid for responsive layout */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.github-card {
    display: block;
    box-sizing: border-box;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 20px;
    color: #555;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.3s ease;
}

.github-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.github-card > h3 {
    margin-top: 0;
    color: var(--primary-purple);
    font-size: 15px;
}

.github-card__meta {
    margin-right: 20px;
}
.github-card__meta > i {
    font-size: 13px;
}


/* =================================== */
/* ===== RESPONSIVE MEDIA QUERIES ===== */
/* =================================== */

/* Tablet Screens */
@media (max-width: 992px) {
    #contain {
        height: auto;
        padding: 20px 0;
    }
    #contain .row {
        flex-direction: column;
        height: auto;
    }
    #contain .col,
    #contain .col-3 {
        width: 100%;
        max-width: 500px; /* Limit width on tablets */
        height: auto;
        flex: 1 1 auto;
    }
    .tabs-container {
        height: auto;
        max-height: 500px; /* Limit height to prevent excessive scrolling */
    }
}


/* Mobile Screens */
@media (max-width: 768px) {
    body {
        padding: 0;
    }
    #contain {
        padding: 0;
    }
    #contain .row {
        gap: 0;
    }
    #contain .col,
    #contain .col-3 {
        max-width: 100%;
        padding: 0;
        margin-bottom: 30px;
    }
    .card, .tabs-container {
        border-radius: 0; /* Full width cards */
        box-shadow: none;
        border-bottom: 1px solid #eee;
    }
    .tabs-container {
        flex-direction: column;
        max-height: none;
        margin-bottom: 30px;
    }
    .tabs {
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid #F0F0F0;
        padding-right: 0;
        padding-bottom: 8px;
    }
    .tabs a {
        justify-content: center;
        text-align: center;
    }
    .tab-content-wrapper {
        padding: 0 10px;
    }
}