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

:root {
    --background-color: #000;
    --text-color: #e0e0e0;
    --primary-color: #8a42f5; /* Vibrant Purple */
    --secondary-color-blue: #3b82f6; /* Vibrant Blue */
    --secondary-color-red: #ef4444; /* Vibrant Red */
    --container-bg: #111;
    --border-color: #333;
    --font-family: 'Inter', sans-serif;
    --navbar-background: rgba(0, 0, 0, 0.5);
}

body.light-theme {
    --background-color: #ffffff;
    --text-color: #333333;
    --primary-color: #6200ee;
    --secondary-color-blue: #03dac6;
    --secondary-color-red: #cf6679;
    --container-bg: #f0f0f0;
    --border-color: #ccc;
    --navbar-background: rgba(255, 255, 255, 0.5);
    background-image: none !important;
}

body.dark-theme {
    /* background-image: url('../gifs/LoopBall.gif'); */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#video-background {
    position: fixed;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -100;
    background-size: cover;
    transition: 1s opacity;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the video covers the entire area while maintaining aspect ratio */
}

body.light-theme #video-background {
    opacity: 0;
}

main {
    flex: 1 0 auto;
    position: relative;
    z-index: 1;
}

.footer {
    flex-shrink: 0;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navbar */
.navbar {
    background: var(--navbar-background) !important; /* Opaque background */
    backdrop-filter: blur(10px); /* Glassy blur effect */
    -webkit-backdrop-filter: blur(10px); /* Safari support */
    padding: 0.2rem 0;
}

header {
    position: sticky;
    top: 0;
    z-index: 1000; /* Ensure the header stays on top of other content */
    background-color: transparent; /* Make header background transparent to allow navbar's glassy effect */
}

.navbar-brand,
.nav-link {
    color: var(--text-color) !important;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
    text-decoration: none;
    padding: 5px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}

.nav-link:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.btn-link {
    color: var(--text-color) !important;
}

.navbar-brand:hover,
.nav-link:hover {
    color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #7b38e0;
    border-color: #7b38e0;
}

/* Hero Section */
.hero-section {
    padding: 6rem 0;
    text-align: center;
    background-color: transparent;
}

.hero-section h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--text-color);
}

.hero-section p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 2rem auto;
    color: var(--text-color);
}

/* Project Sections */
.project-section {
    padding: 5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.project-section:last-child {
    border-bottom: none;
}

.project-section .container {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.project-section:nth-child(odd) .container {
    flex-direction: row-reverse;
}

.project-content {
    flex: 1;
}

.project-image {
    flex: 1;
    background-color: #1a1a1a;
    height: 400px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-section:nth-child(even) {
    background-color: #1a1023;
}

.project-section:nth-child(odd) {
    background-color: #101a23;
}

.project-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.project-content .tech-stack {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.project-content p {
    line-height: 1.7;
    color: var(--text-color);
}

/* Projects page */
.project-list-container {
    padding: 4rem 0;
}

.contact-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; /* This will center the items horizontally */
    min-height: calc(100vh - 200px); /* Adjust 200px based on header/footer height */
}

/* Animated Button */
.btn-animated {
    position: relative;
    padding: 12px 24px;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    background-color: transparent;
    transition: color 0.4s ease-in-out;
    text-decoration: none;
    display: inline-block;
    overflow: hidden;
    z-index: 1;
}

.btn-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--text-color);
    transform: translateX(-100%);
    transition: transform 0.4s ease-in-out;
    z-index: -1;
}

.btn-animated:hover::before {
    transform: translateX(0);
}

.btn-animated:hover {
    color: var(--background-color);
}

.btn-animated::after {
    content: '›';
    font-family: 'Roboto Mono', monospace;
    position: absolute;
    opacity: 0;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    transition: all 0.3s ease;
}

.btn-animated:hover::after {
    opacity: 1;
    right: 15px;
}

.btn-animated-primary {
    background-color: var(--text-color);
    color: var(--background-color);
    border-color: var(--text-color);
}

.btn-animated-primary::before {
    background-color: var(--primary-color);
}

.btn-animated-primary:hover {
    color: var(--text-color);
    border-color: var(--primary-color);
}

body.light-theme .btn-animated-primary:hover {
    color: #ffffff;
}

.btn-animated span {
    display: inline-block;
    transition: transform 0.2s ease-out;
}

.btn-animated:hover span {
    transform: translateX(-8px);
}

.project-item {
    margin-bottom: 2rem;
    border-left: 5px solid transparent;
    padding: 1.5rem;
    background-color: var(--container-bg);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.project-item:nth-child(odd) {
    border-left-color: var(--secondary-color-blue);
    margin-left: 2rem;
}

.project-item:nth-child(even) {
    border-right: 5px solid var(--secondary-color-red);
    margin-right: 2rem;
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.project-header h3 {
    margin: 0;
    font-size: 1.75rem;
    color: var(--text-color);
}

.project-summary {
    margin-top: 0.5rem;
    color: var(--text-color);
}

.project-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out;
    margin-top: 1rem;
}

.project-item.expanded .project-details {
    max-height: 1000px;
    transition: max-height 0.5s ease-in;
}

.project-item.expanded {
    border-left-color: var(--primary-color);
    border-right-color: var(--primary-color);
}

.toggle-arrow {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.project-item.expanded .toggle-arrow {
    transform: rotate(90deg);
}

.tech-badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: .75em;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    margin-right: -10px;
    margin-bottom: 5px;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 10px 0 100px 0;
}

.offer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-item {
    background-color: transparent;
    border: none;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    padding: 24px;
    text-align: left;
    box-shadow: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden; /* Hide overflowing pseudo-elements */
}

.feature-item::before, .feature-item::after {
    content: '';
    position: absolute;
    background-color: var(--primary-color);
    transition: all 0.3s ease;
}

/* Top and Bottom Borders */
.feature-item::before {
    height: 2px;
    width: 0;
}

/* Left and Right Borders */
.feature-item::after {
    width: 2px;
    height: 0;
}

.feature-item:nth-child(2)::after,
.feature-item:nth-child(5)::after {
    display: none;
}

/* Top-left */
.feature-item:nth-child(1)::before {
    top: 0; right: 0; transform-origin: right;
}
.feature-item:nth-child(1)::after {
    bottom: 0; left: 0; transform-origin: bottom;
}

/* Top-center */
.feature-item:nth-child(2)::before {
    top: 0; left: 50%; transform: translateX(-50%);
}

/* Top-right */
.feature-item:nth-child(3)::before {
    top: 0; left: 0; transform-origin: left;
}
.feature-item:nth-child(3)::after {
    bottom: 0; right: 0; transform-origin: bottom;
}

/* Bottom-left */
.feature-item:nth-child(4)::before {
    bottom: 0; right: 0; transform-origin: right;
}
.feature-item:nth-child(4)::after {
    top: 0; left: 0; transform-origin: top;
}

/* Bottom-center */
.feature-item:nth-child(5)::before {
    bottom: 0; left: 50%; transform: translateX(-50%);
}

/* Bottom-right */
.feature-item:nth-child(6)::before {
    bottom: 0; left: 0; transform-origin: left;
}
.feature-item:nth-child(6)::after {
    top: 0; right: 0; transform-origin: top;
}

.feature-item:hover::before {
    width: 100%;
}

.feature-item:hover::after {
    height: 100%;
}

.feature-item:nth-child(-n+3):hover {
    background: linear-gradient(to top, transparent, rgba(138, 66, 245, 0.1));
}

.feature-item:nth-child(n+4):hover {
    background: linear-gradient(to bottom, transparent, rgba(138, 66, 245, 0.1));
}

.feature-item:nth-child(3n) {
    border-right: none;
}

.feature-item:nth-last-child(-n+3) {
    border-bottom: none;
}

.feature-item:hover {
    transform: none;
    box-shadow: none;
}

.feature-item h3 {
    color: var(--text-color);
    margin: 8px 0 6px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.feature-item p {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(138,66,245,0.3) 0%, rgba(138,66,245,0.08) 100%);
    color: #fff;
}

body.light-theme .feature-icon {
    color: var(--primary-color);
    background: linear-gradient(180deg, rgba(98,0,238,0.15) 0%, rgba(98,0,238,0.05) 100%);
}

/* Responsive adjustments for smaller screens */
@media (max-width: 991px) {
    .feature-grid, .offer-grid {
        grid-template-columns: 1fr;
    }

    .feature-item {
        padding: 16px;
        border-right: none !important; /* Ensure no right borders */
    }

    /* Set bottom border for all items except the last one */
    .feature-item:not(:last-child) {
        border-bottom: 1px solid var(--border-color) !important;
    }
    
    /* Explicitly remove bottom border from the last item */
    .feature-item:last-child {
        border-bottom: none !important;
    }

    .feature-item h3 {
        font-size: 1rem;
    }

    /* --- Mobile Hover Effect --- */

    /* Reset desktop hover styles */
    .feature-item::before,
    .feature-item::after {
        transform: none !important;
        transform-origin: initial !important;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        width: 0;
        height: 0;
    }

    /* Un-hide pseudo-elements that were hidden for desktop layout */
    .feature-item:nth-child(2)::after,
    .feature-item:nth-child(5)::after {
        display: block !important;
    }

    /* Left vertical line animation */
    .feature-item::before {
        left: 0 !important;
        top: 0 !important;
        width: 2px !important;
        height: 0;
        transform-origin: top !important;
    }

    /* Right vertical line animation */
    .feature-item::after {
        right: 0 !important;
        top: 0 !important;
        width: 2px !important;
        height: 0;
        transform-origin: top !important;
    }

    /* Animate height on hover for both lines */
    .feature-item:hover::before,
    .feature-item:hover::after {
        height: 100% !important;
        width: 2px !important; /* Keep width constant */
    }
}

/* About Section on Home Page */
.about-section {
    padding: 60px 0 0 0; /* Removed bottom padding */
    text-align: center;
}

.about-section h2 {
    font-size: 3rem;
    margin-bottom: 2rem;
}

.about-section .lead {
    font-size: 1.25rem;
    max-width: 800px;
    margin: 0 auto 4rem auto;
}

.about-section .lead strong {
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.1em 0.4em;
    border-radius: 4px;
    font-weight: 200;
  }

.skill-card {
    background: var(--container-bg);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

.skill-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.project-item.scroller-item {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.scroller-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Profile Image */
.profile-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 2rem;
    border: 3px solid var(--primary-color);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-color);
    border-top: 1px solid var(--border-color);
    width: 100%;
}

.about-footer {
    background-color: #000 !important;
}

body.light-theme .about-footer {
    background-color: transparent !important;   
}

.home-footer {
    background-color: #000 !important;
}

body.light-theme .home-footer {
    background-color: transparent !important;
}

.theme-toggle-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }

    .project-section .container {
        flex-direction: column !important;
    }

    .project-image {
        width: 100%;
        height: 250px;
    }
}
.navbar-brand img {
    height: 80px; /* Increased logo size */
}

.navbar-toggler {
    border-color: var(--text-color);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.55)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

body.light-theme .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 0, 0, 0.55)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.contact-container {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.contact-links {
    margin-top: 2rem;
}

.contact-link {
    font-size: 2.5rem;
    margin: 0 1rem;
    color: var(--text-color);
    transition: color 0.3s ease;
}

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

.footer .social-links a {
    margin: 0 10px;
    color: var(--text-color);
    font-size: 1.5rem;
}

.footer .social-links a:hover {
    color: var(--primary-color);
}

body.dark-theme .offer-section {
    position: relative;
    padding: 0;
    background: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
    .offer-grid {
        grid-template-columns: 1fr;
    }
    .feature-item {
        padding: 16px;
    }
    .feature-item h3 {
        font-size: 1rem;
    }
}
