:root {
    --bg-color: #050505;
    --card-bg-color: rgba(17, 17, 17, 0.5);
    --border-color: rgba(255, 255, 255, 0.05);
    --hover-border-color: rgba(192, 132, 252, 0.5);
    --text-color: #f3f4f6;
    --text-muted-color: #9ca3af;
    --primary-color: #c084fc; /* Purple */
    --secondary-color: #3b82f6; /* Blue */
    --shadow-color: rgba(0, 0, 0, 0.5);
    --glow-color: rgba(192, 132, 252, 0.4);
}

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

::selection {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

.text-gradient {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Portfolio Filter Buttons */
.portfolio-filter-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.portfolio-filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.portfolio-filter-btn:hover::before {
    left: 100%;
}

.portfolio-filter-btn:active {
    transform: scale(0.95);
}

.portfolio-filter-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.5);
}

/* Project Cards Smooth Transitions */
.project-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(192, 132, 252, 0.15);
}

.projects-carousel-track {
    transition: transform 0.1s linear;
    will-change: transform;
}

.projects-carousel-container {
    overflow: hidden;
    mask: linear-gradient(90deg, transparent, white 5%, white 95%, transparent);
    -webkit-mask: linear-gradient(90deg, transparent, white 5%, white 95%, transparent);
}

.glassmorphism {
    background: var(--card-bg-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    box-shadow: 0 0 0px 0px rgba(192, 132, 252, 0); /* Start transparent */
    transition: all 0.5s ease-out;
}
.glassmorphism:hover {
    border-color: var(--hover-border-color);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 0 30px 2px var(--glow-color);
}

/* Interactive Glow Effect */
.interactive-glow {
    position: relative;
    overflow: hidden;
}
.interactive-glow::before {
    content: "";
    position: absolute;
    left: var(--mouse-x, -100%);
    top: var(--mouse-y, -100%);
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at center, rgba(192, 132, 252, 0.15), transparent 80%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.6s ease-out, left 0.1s ease-out, top 0.1s ease-out;
    pointer-events: none;
}
.interactive-glow:hover::before {
    opacity: 1;
}

/* Animated background glows */
.glow-element {
    position: fixed;
    border-radius: 50%;
    filter: blur(200px);
    pointer-events: none;
    z-index: -1;
    transition: transform 0.2s ease-out;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-30px); }
}
.animate-float { animation: float 12s ease-in-out infinite; }

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    z-index: 10000;
    width: 0%;
}

/* Section Title Style */
.section-title {
    position: relative;
    display: inline-block;
    padding-bottom: 0.75rem;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0.25);
    transform-origin: center;
    transition: transform 0.4s ease-out;
}
.section-title.aos-animate::after {
    transform: scaleX(1);
}

/* Button hover effect */
.btn-primary {
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: all 0.4s ease-out;
    box-shadow: 0 4px 20px rgba(192, 132, 252, 0.2);
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(192, 132, 252, 0.4);
    color: white !important;
}
.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}
.btn-primary:hover::before {
    left: 100%;
}

/* Achievement Scroller Styles */
@keyframes scrollAndFloat {
    0% { transform: translateX(0) translateY(0px); }
    25% { transform: translateX(-12.5%) translateY(-8px); }
    50% { transform: translateX(-25%) translateY(0px); }
    75% { transform: translateX(-37.5%) translateY(8px); }
    100% { transform: translateX(-50%) translateY(0px); }
}

@keyframes scrollAndFloatReverse {
    0% { transform: translateX(-50%) translateY(0px); }
    25% { transform: translateX(-37.5%) translateY(8px); }
    50% { transform: translateX(-25%) translateY(0px); }
    75% { transform: translateX(-12.5%) translateY(-8px); }
    100% { transform: translateX(0) translateY(0px); }
}

.achievement-scroller {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
    mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent);
}
.scroller-inner {
    display: flex;
    flex-wrap: nowrap;
    width: fit-content;
    animation: scrollAndFloat 80s linear infinite;
}
.scroller-inner.reverse {
    animation-name: scrollAndFloatReverse;
}
.achievement-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem 2rem;
    background: rgba(22,22,22,0.7);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    transition: all 0.4s ease-out;
}
.achievement-card:hover {
    background: rgba(30,30,30,0.8);
    border-color: var(--hover-border-color);
    box-shadow: 0 0 20px 1px var(--glow-color);
    transform: translateY(-5px);
}
.achievement-card img {
    height: 3rem;
    filter: grayscale(100%) opacity(0.7);
    transition: all 0.4s ease;
}
.achievement-card:hover img {
    filter: grayscale(0%) opacity(1);
}

/* Achievement Tabs */
.achievement-tab {
    transition: all 0.3s ease;
}
.achievement-tab.active {
    color: var(--primary-color);
    background-color: rgba(192, 132, 252, 0.1);
}
.achievement-tab-content {
    animation: fadeIn 0.5s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.social-icon {
    transition: all 0.4s ease-out;
}
.social-icon:hover {
    background-color: rgba(192, 132, 252, 0.1);
    box-shadow: 0 0 20px 1px var(--glow-color);
    transform: scale(1.1);
}

/* Skill Tag Hover Effect */
.skill-tag {
    transition: all 0.4s ease-out;
}
.skill-tag:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 0 20px 2px var(--glow-color);
    font-weight: 500;
}

/* Logo Hover Effect */
.logo-img {
    transition: all 0.5s ease-out;
}
.logo-img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px 4px var(--glow-color);
}

/* Journey Map Modal */
#map-modal {
    transition: opacity 0.3s ease-in-out;
}
#map-modal.visible {
    opacity: 1;
}
#map-modal.visible #map-modal-content {
    transform: scale(1);
}
#map-modal .overflow-y-auto::-webkit-scrollbar {
    width: 8px;
}
#map-modal .overflow-y-auto::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}
#map-modal .overflow-y-auto::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}
#map-modal .overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #a855f7;
}

/* Styles for "Show More" functionality on mobile */
@media (max-width: 767px) {
    #about-text-wrapper {
        max-height: 120px; /* Approx 5 lines of text */
        overflow: hidden;
        position: relative;
        transition: max-height 0.5s ease-in-out;
    }

    #about-text-wrapper::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 40px;
        background: linear-gradient(to bottom, transparent, rgba(17, 17, 17, 0.8));
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    #about-text-wrapper.expanded {
        max-height: 1000px; /* Large value to ensure all content is visible */
    }
    
    #about-text-wrapper.expanded::after {
        opacity: 0;
    }
    
    /* Animation for the button */
    .show-more-btn {
        transition: all 0.3s ease-in-out;
        opacity: 1;
    }
    .show-more-btn:hover {
        letter-spacing: 0.5px;
        color: #d8b4fe; /* Lighter purple on hover */
    }

    /* Keyframe for button text fade-in effect */
    @keyframes textFadeIn {
        from { opacity: 0; transform: translateY(5px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .btn-animating {
        animation: textFadeIn 0.4s ease-in-out;
    }
}

/* Custom Scrollbar Styles for Certificate Preview Modal */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: rgba(192, 132, 252, 0.6) rgba(17, 17, 17, 0.3);
}

.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(17, 17, 17, 0.3);
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.6), rgba(59, 130, 246, 0.6));
    border-radius: 4px;
    transition: background 0.3s ease;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.8), rgba(59, 130, 246, 0.8));
}

.custom-scrollbar::-webkit-scrollbar-corner {
    background: rgba(17, 17, 17, 0.3);
}

/* Certificate Image Styles */
.certificate-image {
    max-width: 100%;
    height: auto;
    transition: filter 0.3s ease;
}

.certificate-image:hover {
    filter: brightness(1.05);
}

/* Modal Backdrop Animation */
.modal-backdrop {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { 
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to { 
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

/* Certificate Modal Content Animation */
.certificate-modal-content {
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Enhanced Project Link Styles */
.project-links a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.project-links a:hover {
    background: rgba(192, 132, 252, 0.1);
    border-color: rgba(192, 132, 252, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(192, 132, 252, 0.2);
}

.project-links a svg,
.project-links a i {
    transition: transform 0.3s ease;
}

.project-links a:hover svg,
.project-links a:hover i {
    transform: scale(1.1);
}

/* Specific site color themes */
.project-links a[href*="github.com"]:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.project-links a[href*="vercel"]:hover {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.project-links a[href*="netlify"]:hover {
    background: rgba(0, 173, 181, 0.1);
    border-color: rgba(0, 173, 181, 0.3);
}

.project-links a[href*="firebase"]:hover {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
}

/* Clean Animated Projects Carousel */
.projects-carousel-container {
    width: 100%;
    height: auto;
    min-height: 550px;
    position: relative;
    padding: 20px 0;
    mask: linear-gradient(90deg, transparent, white 5%, white 95%, transparent);
    -webkit-mask: linear-gradient(90deg, transparent, white 5%, white 95%, transparent);
}

.projects-carousel-track {
    width: max-content;
    will-change: transform;
    transition: none; /* Remove transition for smoother continuous animation */
    transform: translate3d(0, 0, 0); /* Hardware acceleration */
    backface-visibility: hidden; /* Optimize rendering */
    height: auto;
    align-items: flex-start; /* Prevent card cutting */
    padding: 20px 0;
}

/* Project Card Enhancements */
.project-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 320px;
    max-width: 320px;
    position: relative;
    -webkit-user-select: none;
    user-select: none;
    cursor: pointer;
    flex-shrink: 0;
    height: auto;
    overflow: visible;
}

.project-card:hover {
    z-index: 10;
    box-shadow: 0 20px 40px rgba(192, 132, 252, 0.3);
}

/* Smooth fade edges */
.projects-carousel-container::before,
.projects-carousel-container::after {
    content: '';
    position: absolute;
    top: 0;
    width: 100px;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

.projects-carousel-container::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-color), transparent);
}

.projects-carousel-container::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-color), transparent);
}

/* Speed Control Slider */
.speed-slider {
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    border-radius: 2px;
    -webkit-appearance: none;
    appearance: none;
}

.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #c084fc, #3b82f6);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.speed-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.5);
}

.speed-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #c084fc, #3b82f6);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.speed-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(192, 132, 252, 0.5);
}

/* Mobile optimization for project carousel */
@media (max-width: 768px) {
    .projects-carousel-container {
        height: auto;
        min-height: 550px;
        padding: 20px 0;
        touch-action: pan-y; /* Allow vertical scrolling on mobile */
        overflow: visible; /* Ensure content isn't clipped */
    }
    
    .project-card.mobile-card {
        min-width: 300px;
        max-width: 300px;
        padding: 20px;
        display: flex;
        flex-direction: column;
        height: auto;
    }
    
    .project-card .project-links {
        margin-top: auto;
        gap: 8px;
    }
    
    .project-card .project-links a {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
        font-weight: 600;
        border-radius: 8px;
        text-decoration: none;
        transition: all 0.3s ease;
    }
    
    .project-card h3 {
        font-size: 18px;
        line-height: 1.3;
        margin-bottom: 12px;
    }
    
    .project-card p {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 16px;
    }
    
    .projects-carousel-track {
        gap: 20px;
        padding: 20px;
        touch-action: pan-y; /* Allow vertical scrolling */
        align-items: flex-start; /* Align cards to top to prevent cutting */
        height: auto;
    }
    
    .projects-carousel {
        gap: 1rem;
        padding-bottom: 1rem;
    }
    
    .carousel-control-btn {
        display: none;
    }
}

/* Extra small mobile devices */
@media (max-width: 480px) {
    .projects-carousel-container {
        min-height: 600px;
    }
    
    .project-card.mobile-card {
        min-width: 280px;
        max-width: 280px;
        padding: 16px;
    }
    
    .project-card .project-links a {
        padding: 10px 14px;
        font-size: 13px;
        min-height: 40px;
    }
}

