.styreg-employees-directory {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Department Tabs Styling */
.styreg-employees-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.styreg-department-tabs {
    position: relative;
}

/* Tab container with scroll */
.styreg-tabs-container {
    position: relative;
    overflow: hidden;
}

/* Add a bottom border to the container that will show between tabs */
.styreg-tabs-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #ddd;
    z-index: 1;
}

.styreg-tabs-nav {
    display: flex;
    flex-wrap: nowrap; /* Prevent wrapping to new lines */
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
    overflow-x: auto; /* Enable horizontal scrolling */
    overflow-y: visible; /* Enable vertical scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    white-space: nowrap; /* Keep all tabs in a single line */
    padding-right: 70px; /* Space for the arrows */
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    height: auto; /* Ensure height is based on content */
    min-height: 42px; /* Set a minimum height to prevent layout shifts */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.styreg-tabs-nav::-webkit-scrollbar {
    display: none;
}

/* Scroll arrows styling */
.styreg-tabs-scroll-arrows {
    position: absolute;
    right: 0;
    top: 0;
    display: flex;
    z-index: 10;
    height: 100%;
    align-items: center;
    background-color: #EEF5FB; /* STYREG light blue background */
    padding-left: 10px; /* Add padding for gradient effect */
    box-shadow: -10px 0 15px -5px rgba(255, 255, 255, 0.9); /* Gradient shadow effect */
}

/* Create a white gradient fade effect */
.styreg-tabs-scroll-arrows:before {
    content: '';
    position: absolute;
    left: -20px;
    top: 0;
    height: 100%;
    width: 20px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(238, 245, 251, 1));
    z-index: -1;
}

.styreg-tab-arrow {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff; /* White background */
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    margin-left: 4px;
    color: #333; /* Darker text for better contrast */
    font-size: 16px; /* Slightly larger */
    transition: all 0.2s ease;
    opacity: 0.8;
    outline: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
}

.styreg-tab-arrow.active {
    opacity: 1;
    pointer-events: auto;
}

.styreg-tab-arrow:hover {
    background-color: #f0f0f0;
    color: #0073aa; /* Brand color on hover */
    border-color: #0073aa;
}

.styreg-tab-arrow:focus {
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.3);
}

.styreg-tab-arrow span {
    display: inline-block;
    line-height: 1;
    font-weight: bold;
}

/* Tab styling with individual borders */
.styreg-tab {
    margin-right: -0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem; /* Smaller font size */
    flex: 0 0 auto; /* Don't allow tabs to grow or shrink */
    position: relative;
    padding: 0.5rem 1rem;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: 1px solid #ddd; /* Each tab has its own bottom border */
    border-radius: 4px 4px 0 0;
    margin-bottom: -1px; /* Pull down to overlap with container border */
    z-index: 1; /* Default z-index */
    overflow: hidden;
}
.styreg-tab:last-child{
    margin-right: 5rem; /* Remove margin on the last tab */
}

.styreg-tab:hover {
    background-color: #e9ecef;
}

/* Active tab styling */
.styreg-tab.active {
    background-color: #fff;
    color: #0073aa;
    border-bottom-color: #fff; /* Hide bottom border on active tab */
    z-index: 2; /* Higher z-index for active tab */
}

.styreg-employee-count {
    font-size: 0.85em;
    color: #6c757d;
    font-weight: normal;
}

/* Department content transitions */
.styreg-dept-content {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.styreg-dept-content.active {
    opacity: 1;
}

/* Responsive tabs - only apply on very small screens */
@media (max-width: 480px) {
    .styreg-tabs-nav {
        flex-direction: column;
        overflow-x: hidden; /* Disable horizontal scrolling */
        white-space: normal; /* Allow wrapping */
        padding-right: 0; /* Remove padding for arrows */
    }
    
    .styreg-tabs-container::after {
        display: none; /* Hide the bottom border on mobile */
    }
    
    .styreg-tab {
        margin-right: 0;
        margin-bottom: 0.25rem;
        width: 100%;
        border: 1px solid #ddd; /* Full border on mobile */
        border-radius: 4px;
        margin-bottom: 0.25rem; /* Add space between tabs */
    }
    
    .styreg-tab.active {
        border-bottom-color: #ddd; /* Restore bottom border on mobile */
    }
    
    .styreg-tabs-scroll-arrows {
        display: none; /* Hide arrows on mobile */
    }
}

/* Force 4 columns for the grid regardless of the CSS variable */
.styreg-employees-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 2rem;
    padding: 2rem;
    background-color: #fff;
}

.styreg-employee-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.styreg-employee-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.styreg-employee-photo {
    width: 100%;
    height: 280px;
    overflow: hidden;
    background-color: #f5f5f5;
    position: relative;
}

.styreg-employee-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.styreg-employee-placeholder-image {
    width: 100%;
    height: 100%;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.styreg-employee-placeholder-image:after {
    content: "\f110";
    font-family: dashicons;
    font-size: 48px;
    color: #999;
}

.styreg-employee-info {
    padding: 1.5rem;
}

.styreg-employee-info h3 {
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    color: #333;
}

.styreg-employee-position {
    color: #666;
    font-size: 1rem;
    margin: 0.5rem 0;
    font-weight: 500;
}

.styreg-employee-department {
    color: #888;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.styreg-employee-organization-unit {
    color: #888;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.styreg-employee-contact {
    font-size: 0.9rem;
    margin-top: 1rem;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.styreg-employee-contact a {
    color: #0073aa;
    text-decoration: none;
    display: inline-block;
    margin: 0.25rem 0;
}

.styreg-employee-contact a:hover {
    text-decoration: underline;
}

.styreg-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.styreg-no-employees {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    color: #6c757d;
}

.styreg-employee-linkedin a {
    display: flex;
    align-items: center;
    color: #0077b5;
    font-weight: 500;
}

.styreg-employee-linkedin a:hover {
    color: #005582;
}

.linkedin-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background-color: #0077b5;
    color: white;
    border-radius: 2px;
    font-weight: bold;
    margin-right: 6px;
    font-size: 12px;
}

/* Position filter dropdown styling */
.styreg-position-filter {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-block;
    background-color: #f8f9fa;
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    z-index: 10;
}

.styreg-position-filter select {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    background-color: #f8f9fa;
    cursor: pointer;
}

.styreg-position-filter select:hover {
    background-color: #e9ecef;
}

.styreg-position-filter select:focus {
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.3);
}

/* These classes are now overridden by the !important rule above */
.styreg-employee-col-1 {
    --styreg-columns: 1;
}

.styreg-employee-col-2 {
    --styreg-columns: 2;
}

.styreg-employee-col-3 {
    --styreg-columns: 3;
}

.styreg-employee-col-4 {
    --styreg-columns: 4;
}

.styreg-employee-col-5 {
    --styreg-columns: 5;
}

.styreg-employee-col-6 {
    --styreg-columns: 6;
}

/* Responsive breakpoints - override the !important rule for smaller screens */
@media (max-width: 1200px) {
    .styreg-employees-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 992px) {
    .styreg-employees-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .styreg-employees-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 576px) {
    .styreg-employees-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .styreg-employees-directory {
        padding: 1rem;
    }
}
