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

/* --- CSS Variables for easy theme management --- */
:root {
    --primary-color: #ffffff;
    --secondary-color: #e2e8f0;
    --accent-color: #4f46e5;
    --background-start: #111827;
    --background-end: #0c0d24;
    --card-background: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.2);
    --bubble-color: rgba(255, 255, 255, 0.1);
}

/* --- General Body and Reset Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--primary-color);
    background: linear-gradient(45deg, var(--background-start), var(--background-end), #1e1b4b, #4f46e5);
    background-size: 400% 400%;
    animation: shinyBackground 15s ease infinite;
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- Animated Background Keyframes --- */
@keyframes shinyBackground {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* --- Bubble Background --- */
.bubble-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bubble-background span {
    position: absolute;
    bottom: -150px;
    background: var(--bubble-color);
    border-radius: 50%;
    animation: bubble-rise 25s linear infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 2.5rem;
    /* Base icon size */
}

/* --- Bubble Styles --- */
.bubble-background span:nth-child(1) {
    width: 80px;
    height: 80px;
    left: 10%;
    animation-duration: 25s;
    animation-delay: 0s;
    font-size: 2.5rem;
}

.bubble-background span:nth-child(2) {
    width: 60px;
    height: 60px;
    left: 20%;
    animation-duration: 15s;
    animation-delay: 3s;
    font-size: 2rem;
}

.bubble-background span:nth-child(3) {
    width: 50px;
    height: 50px;
    left: 35%;
    animation-duration: 30s;
    animation-delay: 7s;
    font-size: 1.8rem;
}

.bubble-background span:nth-child(4) {
    width: 100px;
    height: 100px;
    left: 50%;
    animation-duration: 22s;
    animation-delay: 1s;
    font-size: 3.5rem;
}

.bubble-background span:nth-child(5) {
    width: 70px;
    height: 70px;
    left: 65%;
    animation-duration: 18s;
    animation-delay: 5s;
    font-size: 2.2rem;
}

.bubble-background span:nth-child(6) {
    width: 40px;
    height: 40px;
    left: 80%;
    animation-duration: 28s;
    animation-delay: 2s;
    font-size: 1.5rem;
}

.bubble-background span:nth-child(7) {
    width: 90px;
    height: 90px;
    left: 90%;
    animation-duration: 12s;
    animation-delay: 9s;
    font-size: 3rem;
}

.bubble-background span:nth-child(8) {
    width: 60px;
    height: 60px;
    left: 5%;
    animation-duration: 20s;
    animation-delay: 4s;
    font-size: 2rem;
}

.bubble-background span:nth-child(9) {
    width: 45px;
    height: 45px;
    left: 60%;
    animation-duration: 24s;
    animation-delay: 11s;
    font-size: 1.6rem;
}

.bubble-background span:nth-child(10) {
    width: 85px;
    height: 85px;
    left: 85%;
    animation-duration: 19s;
    animation-delay: 6s;
    font-size: 2.8rem;
}

.bubble-background span:nth-child(11) {
    width: 55px;
    height: 55px;
    left: 15%;
    animation-duration: 23s;
    animation-delay: 8s;
    font-size: 1.9rem;
}

.bubble-background span:nth-child(12) {
    width: 75px;
    height: 75px;
    left: 28%;
    animation-duration: 17s;
    animation-delay: 14s;
    font-size: 2.4rem;
}

.bubble-background span:nth-child(13) {
    width: 40px;
    height: 40px;
    left: 42%;
    animation-duration: 29s;
    animation-delay: 10s;
    font-size: 1.5rem;
}

.bubble-background span:nth-child(14) {
    width: 65px;
    height: 65px;
    left: 72%;
    animation-duration: 16s;
    animation-delay: 12s;
    font-size: 2.1rem;
}

.bubble-background span:nth-child(15) {
    width: 95px;
    height: 95px;
    left: 55%;
    animation-duration: 21s;
    animation-delay: 15s;
    font-size: 3.2rem;
}

.bubble-background span:nth-child(16) {
    width: 30px;
    height: 30px;
    left: 88%;
    animation-duration: 32s;
    animation-delay: 18s;
    font-size: 1.2rem;
}

.bubble-background span:nth-child(17) {
    width: 60px;
    height: 60px;
    left: 2%;
    animation-duration: 14s;
    animation-delay: 20s;
    font-size: 2rem;
}

.bubble-background span:nth-child(18) {
    width: 80px;
    height: 80px;
    left: 22%;
    animation-duration: 26s;
    animation-delay: 22s;
    font-size: 2.5rem;
}

.bubble-background span:nth-child(19) {
    width: 50px;
    height: 50px;
    left: 48%;
    animation-duration: 20s;
    animation-delay: 25s;
    font-size: 1.8rem;
}

.bubble-background span:nth-child(20) {
    width: 100px;
    height: 100px;
    left: 68%;
    animation-duration: 18s;
    animation-delay: 28s;
    font-size: 3.5rem;
}

.bubble-background span:nth-child(21) {
    width: 45px;
    height: 45px;
    left: 82%;
    animation-duration: 27s;
    animation-delay: 17s;
    font-size: 1.6rem;
}

.bubble-background span:nth-child(22) {
    width: 65px;
    height: 65px;
    left: 95%;
    animation-duration: 23s;
    animation-delay: 21s;
    font-size: 2.1rem;
}

.bubble-background span:nth-child(23) {
    width: 70px;
    height: 70px;
    left: 33%;
    animation-duration: 19s;
    animation-delay: 26s;
    font-size: 2.2rem;
}

.bubble-background span:nth-child(24) {
    width: 55px;
    height: 55px;
    left: 78%;
    animation-duration: 25s;
    animation-delay: 30s;
    font-size: 1.9rem;
}

.bubble-background span:nth-child(25) {
    width: 40px;
    height: 40px;
    left: 45%;
    animation-duration: 18s;
    animation-delay: 32s;
    font-size: 1.5rem;
}

.bubble-background span:nth-child(26) {
    width: 80px;
    height: 80px;
    left: 62%;
    animation-duration: 22s;
    animation-delay: 35s;
    font-size: 2.5rem;
}

@keyframes bubble-rise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.7;
    }

    100% {
        transform: translateY(-120vh) scale(1.5);
        opacity: 0;
    }
}

/* --- Header and Social Links --- */
header {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 100;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-link {
    display: flex;
    align-items: center;
    background-color: var(--card-background);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    padding: 10px;
    border-radius: 50px;
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.4s ease, transform 0.3s ease-out;
    overflow: hidden;
    width: 45px;
}

.social-link i {
    font-size: 20px;
    min-width: 25px;
    text-align: center;
}

.social-link .link-text {
    margin-left: 10px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* --- Main Content Styling --- */
main {
    padding: 100px 20px 40px;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4rem;
}

/* --- Profile Section --- */
.profile-section {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    text-align: center;
}

.profile-image-container {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid var(--accent-color);
    box-shadow: 0 0 25px var(--accent-color);
    animation: fadeIn 1.5s ease-in-out, pulse-glow 4s ease-in-out infinite;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-image-container:hover {
    transform: scale(1.05);
    box-shadow: 0 0 50px var(--accent-color);
}

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

.profile-text {
    max-width: fit-content;
}

.profile-text h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.bio-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 650px;
    margin-top: 2rem;
    background-color: var(--card-background);
    backdrop-filter: blur(8px);
    border-radius: 100px;
    padding: 1.5rem 2.5rem;
    opacity: 0;
    animation: fadeInCard 0.5s ease-out 0.4s forwards;
}

.scanner-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--accent-color), transparent);
    box-shadow: 0 0 10px var(--accent-color);
    animation: scan 0.8s ease-in-out forwards;
}

.bio-container p {
    margin-bottom: 0;
}

/* --- Name Component --- */
.profile-text .name-component {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25em;
}

.name-component .bracket {
    font-size: 2.5em;
    font-weight: initial;
    color: var(--primary-color);
}

.name-component .name {
    margin-top: 0.1em;
    white-space: nowrap;
    background: linear-gradient(90deg, #e2e8f0, #ffffff, #4f46e5, #e2e8f0);
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: gradient-shine 4s linear infinite;
}



/* --- Connect Button --- */
.connect-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.connect-button {
    background-image: linear-gradient(to right, var(--accent-color) 0%, var(--card-background) 51%, var(--accent-color) 100%);
    background-size: 200% auto;
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    color: var(--secondary-color);
    font-weight: 600;
    transition: all 0.5s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpFadeIn 0.6s ease-out 0.8s forwards;
}

.connect-button:hover {
    color: var(--primary-color);
    background-position: right center;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* MODIFIED: .connect-icon to remove conflicting animations */
.connect-icon {
    background-image: linear-gradient(to right, var(--accent-color) 0%, var(--card-background) 51%, var(--accent-color) 100%);
    background-size: 200% auto;
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    height: 50px;
    width: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 1.5rem;
    transition: all 0.5s ease, transform 0.3s ease-out;
    opacity: 0;
    animation: fadeIn 0.6s ease-out 1s forwards;
    /* Use a simpler fade-in */
}

/* MODIFIED: .connect-icon:hover to remove conflicting transform */
.connect-icon:hover {
    color: var(--primary-color);
    background-position: right center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}


/* --- FINAL, CORRECTED PROJECT CARD STYLES --- */
.project-card {
    background-color: transparent;
    width: 100%;
    aspect-ratio: 16 / 9;
    perspective: 1000px;
    border: none;
    box-shadow: none;
}

.project-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.project-card:hover .project-card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 15px;
}

.card-front {
    background: var(--card-background);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    overflow: hidden;
}

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

/* This is the main anchor and container for the back face */
.card-back {
    background: linear-gradient(45deg, #111827b8, #0c0d24ad);
    color: white;
    transform: rotateY(180deg);
    position: relative;
    /* CRITICAL: This acts as the anchor for the floating button */
    overflow: hidden;
    /* CRITICAL: This hides parts of the content that are outside the scroll area */
}

/* This is the container for ALL content that needs to scroll */
.card-back-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.5rem;
    padding-bottom: 6rem;
    /* IMPORTANT: This creates space at the bottom so content doesn't get hidden by the button */
    overflow-y: auto;
    /* CRITICAL: This enables the scrollbar when content is too long */
    text-align: center;
}

/* This is the floating button, positioned relative to .card-back */
.view-project-btn {
    position: fixed;
    /* CRITICAL: This takes the button out of the normal flow */
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 10;
    /* Ensures the button is on top of the scrolling content */
    text-decoration: none;
    color: var(--primary-color);
    background-color: var(--accent-color);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    transition: background-color 0.3s ease;
}

.view-project-btn:hover {
    background-color: #3730a3;
}

.card-back-content h2 {
    margin-bottom: 1rem;
}

.card-back-content p {
    font-size: 0.95rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

/* Custom Scrollbar for Card Back Content */
.card-back-content::-webkit-scrollbar {
    width: 8px;
}

.card-back-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.card-back-content::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.card-back-content::-webkit-scrollbar-thumb:hover {
    background-color: #6d28d9;
}

/* --- Slider Styles (Inside Card Back) --- */
.slider-box {
    width: 100%;
    overflow: hidden;
    position: relative;
    border-radius: 8px;
    margin-bottom: 1rem;
    
        aspect-ratio: 16 / 9;
    /* Give the slider a fixed height */
    flex-shrink: 0;
    /* Prevent slider from shrinking */
}

.slider-track {
    height: 100%;
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.slider-slide {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
}

.slider-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-buttons {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 10px;
    pointer-events: none;
}

.slider-btn-left,
.slider-btn-right {
    pointer-events: all;
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    opacity: 0;
}

.slider-box:hover .slider-btn-left,
.slider-box:hover .slider-btn-right {
    opacity: 0.7;
}

.slider-btn-left:hover,
.slider-btn-right:hover {
    background-color: var(--bubble-color);
    opacity: 1;
}

.slider-bullets {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.slider-bullets ul {
    list-style: none;
    display: flex;
    gap: 8px;
    padding: 0;
}

.slider-bullet {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.slider-bullet.active {
    background-color: var(--accent-color);
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
    background-color: rgba(0, 0, 0, 0.2);
}

footer p {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.social-link-footer {
    text-decoration: none;
    color: var(--secondary-color);
}

/* --- Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 25px var(--accent-color);
    }

    50% {
        box-shadow: 0 0 40px var(--accent-color);
    }

    100% {
        box-shadow: 0 0 25px var(--accent-color);
    }
}

@keyframes gradient-shine {
    to {
        background-position: -200% center;
    }
}

@keyframes reveal-letter {
    to {
        opacity: 1;
        clip-path: inset(0 0 0 0);
    }
}

@keyframes scan {
    from {
        transform: translateX(-20px);
    }

    to {
        transform: translateX(650px);
    }
}

@keyframes fadeInCard {
    to {
        opacity: 1;
    }
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    header {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        padding: 15px 0;
        background-color: rgba(0, 0, 0, 0.2);
    }

    .social-links {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 1.5rem;
    }

    main {
        padding-top: 40px;
    }

    .profile-section {
        flex-direction: column;
    }

    .profile-image-container {
        width: 180px;
        height: 180px;
    }

    .profile-text .name-component {
        font-size: 1.5rem;
    }

    .name-component .bracket {
        font-size: 2em;
    }

    .bio-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .bio-container p {
        font-size: 1rem;
    }

    .slider-box {
        width: 100%;
        overflow: hidden;
        position: relative;
        border-radius: 8px;
        margin-bottom: 1rem;
    
        /* Give the slider a fixed height */
        flex-shrink: 0;
            aspect-ratio: 16/9; /* still keeps 16:9 ratio */
        /* Prevent slider from shrinking */
    }
    .slider-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.slider-track {
    height: 100%;
    display: flex;
    transition: transform 0.5s ease-in-out;
}
.slider-slide {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
}
@media (max-width: 768px) {
  body {
    background: linear-gradient(
      45deg,
      #111827,
      #1a1a2e
    );
  }
}
}