/* Role Filter Buttons */
.role-filter-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1.5rem 1rem;
    background: linear-gradient(to bottom, #f9fafb, #ffffff);
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.9);
}

/* Profile Photo in Filter Bar */
.filter-bar-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-right: 0.5rem;
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.filter-bar-photo.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.filter-bar-photo.visible:hover {
    border-color: #ec4899;
    box-shadow: 0 4px 6px rgba(236, 72, 153, 0.2);
    transform: scale(1.05);
}

.role-filter-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    border-radius: 9999px;
    border: 2px solid #d1d5db;
    background-color: #ffffff;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.role-filter-button:hover {
    border-color: #9ca3af;
    background-color: #f9fafb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.role-filter-button:active {
    transform: translateY(0);
}

.role-filter-button.active {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    color: #ffffff;
    border-color: #ec4899;
    box-shadow: 0 4px 6px -1px rgba(236, 72, 153, 0.3);
}

.role-filter-button.active:hover {
    background: linear-gradient(135deg, #db2777 0%, #7c3aed 100%);
    border-color: #db2777;
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(236, 72, 153, 0.4);
}

/* Block-level Content Switching Animations */
.role-content-block {
    opacity: 0;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.role-content-block.content-fade-in {
    opacity: 1;
}

.role-content-block.content-fade-out {
    opacity: 0;
}

/* Responsive auto-adjusting grids */
.skill-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    justify-content: center;
    gap: 1.5rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure grid items don't stretch too much when sparse */
.skill-grid > .filterable-content {
    max-width: 400px;
    justify-self: center;
}

/* AI Skills grid - auto-adjust for 2-column max */
.ai-skills-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)) !important;
    justify-content: center;
    gap: 1.5rem !important;
}

/* Certifications grid - auto-compact */
.certifications-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 240px)) !important;
    justify-content: center;
    gap: 2rem 2rem !important;
}

@media (max-width: 768px) {
    .skill-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
    }

    .ai-skills-grid {
        grid-template-columns: 1fr !important;
    }

    .certifications-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 200px)) !important;
    }
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .role-filter-container {
        gap: 0.5rem;
        padding: 1rem 0.5rem;
    }

    .role-filter-button {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }

    .filter-bar-photo {
        width: 32px;
        height: 32px;
        margin-right: 0.25rem;
    }
}

/* Accessibility - Focus states */
.role-filter-button:focus {
    outline: 2px solid #ec4899;
    outline-offset: 2px;
}

.role-filter-button:focus:not(:focus-visible) {
    outline: none;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Performance optimization - GPU acceleration */
.filterable-content,
.role-filter-button {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Certifications Carousel */
.carousel-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 2rem 0;
}

.carousel-track {
    display: flex;
    gap: 3rem;
    width: calc((180px * 24) + (3rem * 23));
    animation: scroll-left 60s linear infinite;
    will-change: transform;
}

.carousel-track:hover {
    animation-play-state: paused;
}

.carousel-item {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.carousel-item:hover {
    transform: scale(1.1);
    z-index: 10;
}

.carousel-item img {
    display: block;
    width: 180px;
    height: 180px;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Mobile carousel adjustments */
@media (max-width: 768px) {
    .carousel-track {
        gap: 2rem;
        width: calc((140px * 24) + (2rem * 23));
        animation: scroll-left 45s linear infinite;
    }

    .carousel-item img {
        width: 140px;
        height: 140px;
    }
}

@media (max-width: 480px) {
    .carousel-track {
        gap: 1.5rem;
        width: calc((120px * 24) + (1.5rem * 23));
        animation: scroll-left 38s linear infinite;
    }

    .carousel-item img {
        width: 120px;
        height: 120px;
    }
}
