/* SPECIALISTEN FLIPBOX STYLING */
.specialisten-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* DESKTOP GRID - MET EXACTE AFMETINGEN */
.specialisten-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    position: relative;
}

/* SPECIALISTEN FLIP CARD BASIS - EXACTE AFMETINGEN */
.specialisten-wrapper .flip-card {
    background-color: transparent;
    width: 265px;
    height: 376px;
    perspective: 1000px;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: z-index 0.1s ease;
    justify-self: center;
}

/* VERHOOGDE Z-INDEX VOOR GEFLIPTE SPECIALISTEN CARDS */
.specialisten-wrapper .flip-card.is-flipped {
    z-index: 100;
    position: relative;
}

/* SPECIALISTEN FLIP CARD INNER */
.specialisten-wrapper .flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    transform-origin: center center;
}

/* HORIZONTALE FLIP ANIMATIE - SPECIFIEK VOOR SPECIALISTEN */
.specialisten-wrapper .flip-card.is-flipped .flip-card-inner {
    transform: rotateY(180deg);
}

/* SPECIALISTEN VOOR- EN ACHTERKANT BASIS */
.specialisten-wrapper .flip-card-front, 
.specialisten-wrapper .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    margin: 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    box-sizing: border-box;
}

/* SPECIALISTEN VOORKANT */
.specialisten-wrapper .flip-card-front {
    background-color: #ccc;
    z-index: 2;
    transform: rotateY(0deg);
}

.specialisten-wrapper .card-bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    justify-content: space-between;
}

.specialisten-wrapper .card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.7) 100%);
}

.specialisten-wrapper .card-content {
    position: relative;
    z-index: 2;
    padding: 20px;
    width: 100%;
    color: white;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
    box-sizing: border-box;
}

.specialisten-wrapper .card-title-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.specialisten-wrapper .specialist-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    text-align: left;
}

.specialisten-wrapper .card-bottom-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
}

.specialisten-wrapper .specialist-role {
    font-size: 16px;
    margin: 0;
    opacity: 0.9;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    text-align: left;
}

.specialisten-wrapper .plus-btn {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border: none;
    cursor: pointer;
    pointer-events: none;
    flex-shrink: 0;
}

.specialisten-wrapper .flip-card:hover .plus-btn {
    background: rgba(255,255,255,0.35);
    transform: scale(1.1);
}

/* SPECIALISTEN ACHTERKANT */
.specialisten-wrapper .flip-card-back {
    background: #F3ECDF;
    transform: rotateY(180deg);
    padding: 25px;
    display: flex;
    flex-direction: column;
    z-index: 1;
    box-sizing: border-box;
}

.specialisten-wrapper .back-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.specialisten-wrapper .avatar-img {
    width: 60px;
    height: 60px;
    border-radius: 2%;
    overflow: hidden;
    margin-right: 15px;
    border: 3px solid #e9ecef;
    flex-shrink: 0;
}

.specialisten-wrapper .avatar-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.specialisten-wrapper .back-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #333;
    text-align: left;
}

.specialisten-wrapper .back-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.specialisten-wrapper .back-description {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin: 0 0 15px 0;
    text-align: left;
    flex: 1;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Stijl de scrollbar */
.specialisten-wrapper .back-description::-webkit-scrollbar {
    width: 4px;
}

.specialisten-wrapper .back-description::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 2px;
}

.specialisten-wrapper .back-description::-webkit-scrollbar-thumb {
    background: #44B088;
    border-radius: 2px;
}

.specialisten-wrapper .back-description::-webkit-scrollbar-thumb:hover {
    background: #3a9574;
}

.specialisten-wrapper .linkedin-btn {
    background: #44B088;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    align-self: flex-start;
    font-size: 14px;
    border: none;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 10;
}

.specialisten-wrapper .linkedin-btn:hover {
    background: #113527;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(68, 176, 136, 0.3);
    color: white;
    text-decoration: none;
}

.specialisten-wrapper .close-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    background: #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    pointer-events: auto;
    z-index: 20;
}

.specialisten-wrapper .close-btn:hover {
    background: #dee2e6;
    transform: scale(1.1);
}

/* MOBILE PROGRESS BAR */
.specialisten-wrapper .mobile-slider-progress {
    display: none;
    margin-top: 20px;
}

.specialisten-wrapper .progress-track {
    width: 100%;
    height: 4px;
    background: #434343;
    border-radius: 2px;
    overflow: hidden;
}

.specialisten-wrapper .progress-active {
    height: 100%;
    background: #44B088;
    width: 25%;
    border-radius: 2px;
    transition: transform 0.3s ease, width 0.3s ease;
    transform: translateX(0);
}

/* ALGEMENE FLIPBOXES STYLING - ORIGINELE WERKENDE IMPLEMENTATIE */
.flipboxes-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    padding: 20px 0;
}

.flipboxes-grid {
    display: grid;
    grid-template-columns: repeat(3, 396px);
    grid-template-rows: repeat(2, 303px);
    gap: 30px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    justify-content: center;
}

.flipbox-container {
    perspective: 1000px;
    width: 396px;
    height: 303px;
}

.flipbox {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease-in-out;
    transform-style: preserve-3d;
    cursor: pointer;
}

.flipbox.flipped {
    transform: rotateY(180deg);
}

.flipbox-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    text-align: center;
}

.flipbox-front {
    background: #EFF7F0;
    border: 1px solid #e1e8e2;
}

.flipbox-front .flipbox-title {
    color: #113527;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    line-height: 1.3;
}

.flipbox-back {
    background: linear-gradient(135deg, #44B088 0%, #3a9574 100%);
    transform: rotateY(180deg);
    color: #EFF7F0;
}

.flipbox-back .flipbox-title {
    color: #EFF7F0;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.3;
}

.flipbox-content {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    opacity: 0.95;
    color: #EFF7F0;
}

.flipbox-button {
    background: white;
    color: #0C231F;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    outline: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.flipbox-button:hover {
    background: #44B088;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(68, 176, 136, 0.3);
}

.flipbox-button:hover .plus-icon {
    background: white;
    color: #44B088;
}

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

.plus-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #44B088;
    color: white;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    font-weight: 600;
}

.close-button {
    background: transparent;
    color: #44B088;
    border: none;
    padding: 0;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    position: relative;
}

.close-button:hover {
    background: transparent;
    transform: rotate(90deg);
}

.close-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: white;
    color: #44B088;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    font-weight: 300;
}

.no-flipboxes {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-style: italic;
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 1024px) {
    .specialisten-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .specialisten-wrapper .flip-card {
        width: 100%;
        height: 350px;
        max-width: 280px;
    }
    
    .flipboxes-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
        max-width: 800px;
    }
    
    .flipbox-container {
        width: 100%;
        height: 280px;
    }
}

@media (max-width: 768px) {
    .specialisten-wrapper {
        padding: 15px;
        overflow: hidden;
    }
    
    .specialisten-grid {
        display: flex;
        transition: transform 0.3s ease;
        gap: 20px;
        overflow: visible;
        padding: 0 10px;
        position: relative;
    }
    
    .specialisten-wrapper .flip-card {
        flex: 0 0 calc(100% - 20px);
        width: calc(100% - 20px);
        height: 400px;
        max-width: none;
        margin-right: 0;
    }
    
    .specialisten-wrapper .mobile-slider-progress {
        display: block;
    }
    
    .specialisten-wrapper .specialist-title {
        font-size: 20px;
    }
    
    .specialisten-wrapper .card-content {
        padding: 15px;
    }
    
    .specialisten-wrapper .flip-card-back {
        padding: 20px;
    }
    
    .specialisten-wrapper .avatar-img {
        width: 50px;
        height: 50px;
        margin-right: 12px;
        border-radius: 2%;
    }
    
    .specialisten-wrapper .back-title {
        font-size: 16px;
    }
    
    /* Mobile scroll area - exact same as desktop */
    .specialisten-wrapper .back-description {
        font-size: 14px;
        line-height: 1.6;
        color: #666;
        margin: 0 0 15px 0;
        text-align: left;
        flex: 1;
        max-height: 180px;
        overflow-y: auto;
        padding-right: 5px;
    }
    
    /* Mobile scrollbar styling */
    .specialisten-wrapper .back-description::-webkit-scrollbar {
        width: 4px;
    }
    
    .specialisten-wrapper .back-description::-webkit-scrollbar-track {
        background: #f0f0f0;
        border-radius: 2px;
    }
    
    .specialisten-wrapper .back-description::-webkit-scrollbar-thumb {
        background: #44B088;
        border-radius: 2px;
    }
    
    .specialisten-wrapper .back-description::-webkit-scrollbar-thumb:hover {
        background: #3a9574;
    }
    
    .flipboxes-container {
        padding: 20px 0;
    }
    
    .flipboxes-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 20px;
        padding: 0 20px 20px 20px;
        max-width: none;
        margin: 0;
        -webkit-overflow-scrolling: touch;
    }
    
    .flipbox-container {
        flex: 0 0 280px;
        height: 250px;
        scroll-snap-align: start;
    }
    
    .flipbox-face {
        padding: 20px;
    }
    
    .flipbox-title {
        font-size: 20px;
    }
    
    .flipbox-content {
        font-size: 14px;
    }
    
    .flipboxes-grid::-webkit-scrollbar {
        height: 6px;
    }
    
    .flipboxes-grid::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }
    
    .flipboxes-grid::-webkit-scrollbar-thumb {
        background: #44B088;
        border-radius: 3px;
    }
    
    .flipboxes-grid::-webkit-scrollbar-thumb:hover {
        background: #3a9574;
    }
}

@media (max-width: 480px) {
    .specialisten-wrapper .flip-card {
        height: 350px;
        flex: 0 0 calc(100% - 10px);
        width: calc(100% - 10px);
    }
    
    .specialisten-wrapper .specialist-title {
        font-size: 18px;
    }
    
    .specialisten-wrapper .specialist-role {
        font-size: 14px;
    }
    
    .specialisten-wrapper .plus-btn, 
    .specialisten-wrapper .close-btn {
        width: 35px;
        height: 35px;
    }
    
    .specialisten-grid {
        gap: 15px;
        padding: 0 5px;
    }
    
    .flipbox-container {
        height: 250px;
    }
}

/* ACCESSIBILITY EN PERFORMANCE */
.specialisten-wrapper .flip-card:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.specialisten-wrapper .linkedin-btn:focus,
.specialisten-wrapper .close-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.flipbox:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

@media (hover: none) and (pointer: coarse) {
    .specialisten-wrapper .flip-card:hover .plus-btn {
        background: rgba(255,255,255,0.25);
        transform: scale(1);
    }
    
    .specialisten-wrapper .plus-btn {
        background: rgba(255,255,255,0.35);
    }
}

.specialisten-wrapper .flip-card-inner,
.specialisten-wrapper .flip-card-front,
.specialisten-wrapper .flip-card-back {
    will-change: transform;
}

.specialisten-wrapper .progress-active {
    will-change: transform, width;
}

.flipbox,
.flipbox-face {
    will-change: transform;
}

/* MOBILE SCROLL FIX - Extra specifiek voor mobiel */
@media (max-width: 768px) {
    .specialisten-wrapper .flip-card-back .back-content .back-description {
        max-height: 180px !important;
        overflow-y: auto !important;
        margin: 0 0 15px 0 !important;
        padding-right: 5px !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .specialisten-wrapper .back-description {
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* Small mobile extra fix */
@media (max-width: 480px) {
    .specialisten-wrapper .flip-card-back .back-content .back-description {
        max-height: 160px !important;
        overflow-y: auto !important;
    }
}