/* style.css */
/* ==== Root Variables ==== */
:root {
    --primary-color: #4CA1D3;
    --secondary-color: #5FB3E6;
    --accent-color: #FFB347;
    --background-color: #121212;
    --text-color: #e0e0e0;
    --header-bg: rgba(30, 30, 30, 0.95);
    --card-bg: #2a2a2a;
    --card-border: #3d3d3d;
    --card-shadow: rgba(0, 0, 0, 0.2);
    --border-color: #404040;
}

.dark-theme {
    --primary-color: #A9D3FF;
    --secondary-color: #A9D3FF;
    --accent-color: #2541B2;
    --background-color:#F2F4FF;
    --text-color: #000000;
    --header-bg: #96C5F7;
    --card-bg: #A9D3FF;
    --card-border: #A9D3FF;
    --card-shadow: rgba(0, 0, 0, 0.05);
    --border-color: #A9D3FF;
}


/* ==== Base Styles ==== */
body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    overflow-x: hidden;
}

#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
    background: transparent !important
}

/* ==== Navigation Styles ==== */
.navbar-custom {
    background: var(--header-bg) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --bs-navbar-color: var(--text-color);
    --bs-navbar-hover-color: var(--primary-color);
    --bs-navbar-active-color: var(--primary-color);
    z-index: 1100;
}

.navbar-brand.logo {
    font-size: 1.75rem;
    color: var(--text-color);
    font-weight: 700;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: bounce 0.5s ease;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='White' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
  }

@keyframes bounce {
    0% {
        transform: translateX(-50%) scale(0);
    }

    50% {
        transform: translateX(-50%) scale(1.2);
    }

    100% {
        transform: translateX(-50%) scale(1);
    }
}

/* ==== Swiper Carousel Styles ==== */
.swiper {
    width: 100%;
    max-width: 600px; /* Keeps a reasonable max width */
    margin: auto;
}

.project-swiper {
    padding: 2rem 1rem;
    overflow: visible;
}

.swiper-slide {
    width: 85%;
    opacity: 0.5;
    transform: scale(0.9);
    transition: transform 0.4s ease, opacity 0.4s ease;
    display: flex;
    justify-content: center;
}

.swiper-slide-active {
    opacity: 1;
    transform: scale(1);
}

.swiper-button-next,
.swiper-button-prev {
    color: var(--primary-color);
    background: var(--card-bg);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 10px var(--card-shadow);
    transition: all 0.3s ease;
}

.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 1.2rem;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    transform: scale(110%);
}

.swiper-pagination-bullet {
    background: var(--text-color);
    opacity: 0.3;
}

.swiper-pagination-bullet-active {
    background: var(--primary-color);
    opacity: 1;
}



/* ==== Project Cards ==== */
.compact-card {
    background: var(--card-bg);
    border: none;
    border-radius: 15px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.compact-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.project-image-container {
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #f8f9fa;
    transition: transform 0.4s ease;
}

.compact-card:hover .project-image {
    transform: scale(1.05);
}

.compact-card .card-body {
    padding: 1.5rem;
}

.card.card-custom.h-100 {
    background: var(--card-bg);
    border-color: var(--card-border);
    color: var(--text-color);
}

.tech-stack .badge {
    font-size: 0.8rem;
    padding: 0.5em 0.8em;
    margin: 0 0.3em 0.3em 0;
    background: var(--background-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.tech-stack .badge:hover {
    background: var(--secundary-color);
    color: white !important;
    border-color: var(--primary-color);
}

/* ==== Text & Typography ==== */
.card-text {
    color: var(--text-color);
    opacity: 0.9;
    line-height: 1.6;
}

.h5 {
    color: var(--text-color);
}

/* ==== Contact Section ==== */
.contact .card-custom {
    background: var(--card-bg);
    border: none;
    border-radius: 15px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.contact .card-custom:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.contact .card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1.5rem;
}

.contact .card-body i {
    color: var(--text-color);
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.contact .card-body:hover i {
    transform: scale(1.1);
}

.contact h4 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.contact p {
    color: var(--text-color);
    opacity: 0.9;
    margin-bottom: 0;
}

.contact .social-links {
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
}

.contact .social-links .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.3s ease;
}

.contact .social-links .btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.contact .social-links .btn-dark {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.contact .social-links .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--card-shadow);
}

.contact .social-links .btn i {
    font-size: 0.9rem;
}

@media (max-width: 576px) {
    .contact .social-links .btn {
        padding: 0.5rem 0.8rem;
        /* Keep a smaller but rectangular shape */
        border-radius: 6px;
        /* Prevents full circle transformation */
        width: 100%;
        /* Allow button to resize dynamically */
        height: 100%;
        /* Prevents forced circle shape */
        justify-content: center;
        /* Keep icons & text aligned */
    }

    .contact .social-links .btn span {
        display: inline;
        /* Ensure text is visible */
    }

    .contact .social-links .btn i {
        font-size: 1rem;
        /* Adjust icon size properly */
        margin-right: 0.4rem;
        /* Keep spacing consistent */
    }
}

/* ==== Timeline Styles ==== */
.timeline {
    border-left: 3px solid var(--primary-color);
    padding-left: 1.5rem;
    position: relative;
}

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

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-date {
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* ==== Utilities ==== */
.scroll-progress {
    height: 3px;
    background: var(--primary-color);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    transition: width 0.3s ease;
}

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-toggle-container {
    position: absolute;
    right: 2rem;
    top: 1.2rem;
    z-index: 1001;
}

.theme-toggle {
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-color);
    transition: transform 0.3s ease;
}

.theme-toggle i {
    transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
    will-change: scroll-position;
}

.btn-sm.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ==== Skills Section Styling ==== */
#skills .section-title {
    position: relative;
    margin-bottom: 3rem;
}

#skills .section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: #007bff;
    border-radius: 2px;
}

#skills .card-custom {
    background: var(--card-bg);
    border: none;
    border-radius: 15px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#skills .card-custom:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

#skills .card-body {
    padding: 1.5rem;
}

#skills h3 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

#skills h3 .fas {
    margin-right: 0.8rem;
    font-size: 1.2rem;
    color: var(--text-color)
}

.skill-badge {
    background: rgba(0, 123, 255, 0.1);
    color: var(--text-color);
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 123, 255, 0.2);
    margin: 0.3rem;
    display: inline-flex;
    align-items: center;
}

.skill-badge:hover {
    background: #007bff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

/* Dark Theme Compatibility */
.dark-theme #skills .card-custom {
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.dark-theme #skills .card-custom:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.dark-theme .skill-badge {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.dark-theme .skill-badge:hover {
    background: #007bff;
    color: white;
}

.btn-primary>p {
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
}

.cta-btn {
    z-index: 999;
}

.hero {
    z-index: 1;
}

/* ==== Responsive Adjustments ==== */
.navbar .d-flex {
    flex-wrap: nowrap;
}

/* For devices with max-width 768px */
@media (max-width: 576px) {
    .project-swiper {
        padding: 1rem 0.5rem;
    }

    /* Optionally, change the order if you want the toggler on one side */
    .theme-toggle-container {
        order: -1;
        margin-right: 0;
        margin-left: 1rem;
        position: relative;
        top: 0;
        right: 0;
        margin-right: 0.5rem;
    }
}

@media (max-width: 768px) {
    .swiper-slide {
        width: 100%;
    }

    .project-image-container {
        height: 200px;
    }

    .swiper-button-next,
    .swiper-button-prev {
        display: none;
    }

    .nav-link.active::before {
        bottom: auto;
        top: 50%;
        left: -15px;
        transform: translateY(-50%);
    }

    .navbar-collapse {
        background: var(--header-bg);
    }

    .compact-card .card-body {
        padding: 1rem;
    }

    .contact .col-md-4 {
        margin-bottom: 1.5rem;
    }

    .contact .card-body {
        padding: 1.5rem;
    }

    .project-swiper {
        padding: 2rem 1rem;
        overflow: hidden;
        /* Prevent horizontal scrolling */
    }

    .swiper-slide {
        width: 100%;
        /* Ensure slides fill the container exactly */
    }
}

/* For devices with max-width 576px */
@media (max-width: 576px) {

    /* Adjust project image container height */
    .project-image-container {
        height: 180px;
    }

    /* Adjust tech stack badges */
    .tech-stack .badge {
        font-size: 0.75rem;
        padding: 0.4em 0.7em;
    }

    .compact-card {
        box-shadow: 0 2px 4px var(--card-shadow);
    }

    .contact .social-links .btn {
        padding: 0.5rem;
        border-radius: 5%;
        width: auto;
        height: auto;
        justify-content: center;
        margin-left: 0.5rem;
        margin-right:  0.5rem;
    }

    .contact .social-links .btn i {
        margin: 0;
        font-size: 1rem;
    }

    /* Navbar and logo adjustments */
    .navbar-brand.logo {
        font-size: 1.5rem;
    }

    .theme-toggle-container {
        right: 1rem;
    }

    /* Optional: Adjust project image behavior if you prefer a cover fill */
    .project-image {
        object-fit: cover;
    }

    /* Timeline and section titles adjustments */
    .timeline {
        padding-left: 1rem;
    }

    #skills .section-title {
        font-size: 1.5rem;
    }

    #skills .section-title::after {
        width: 60px;
    }

    /* Optimize card spacing in various sections */
    .compact-card .card-body,
    #skills .card-body,
    .contact .card-body {
        padding: 1rem;
    }

    .contact .col-md-4 {
        margin-bottom: 1rem;
    }
}

/* === Force all swiper slides and cards to have the same height === */
.swiper.project-swiper .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

.swiper.project-swiper .swiper-slide {
    display: flex;
    height: 100%;
    align-items: stretch;
}

.swiper.project-swiper .card.card-custom.compact-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.swiper.project-swiper .project-image-container {
    flex-shrink: 0;
}

.swiper.project-swiper .card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
