/* Employee Manager Plugin Styles - Optimized Version */

.employee-manager-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.department-section {
    margin-bottom: 3rem;
}

.department-title {
    color: #00467f;
    border-bottom: 3px solid #00467f;
    padding-bottom: 10px;
    margin-bottom: 2rem;
    font-size: 1.8rem;
    font-weight: 600;
    line-height: 1.2;
}

.employees-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
    justify-content: center; /* Center cards if fewer than columns */
}

/* Fixed column layouts to maintain consistent card sizes */
.employees-grid.columns-1 {
    grid-template-columns: repeat(1, minmax(320px, 1fr));
    max-width: 400px;
}
.employees-grid.columns-2 {
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    max-width: 800px;
}
.employees-grid.columns-3 {
    grid-template-columns: repeat(3, minmax(320px, 1fr));
    max-width: 1200px;
}
.employees-grid.columns-4 {
    grid-template-columns: repeat(4, minmax(280px, 1fr));
    max-width: 1200px;
}

.employee-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #50b848;
    position: relative;
    height: fit-content;
    width: 100%;
    max-width: 400px;
}

.employee-card:hover {
    transform: translateY(0px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
    border-color: #50b848;
}

.employee-image {
    position: relative;
    width: 100%;
    height: 320px;
    overflow: hidden;
    background: linear-gradient(135deg, #00467f 50%, #50b848 100%);
}

.employee-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.employee-card:hover .employee-photo {
    transform: scale(1.05);
}

.employee-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #ffffff;
    font-size: 4rem;
    background: linear-gradient(135deg, #00467f 50%, #50b848 100%);
    position: relative;
}

.employee-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.employee-placeholder .dashicons {
    position: relative;
    z-index: 1;
}

.employee-info {
    padding: 1.5rem;
    background: #ffffff;
    position: relative;
}

.employee-name {
    margin: 0 0 0.5rem 0;
    color: #2c3e50;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    min-height: 1.6rem;
}

.employee-position {
    color: #7f8c8d;
    font-style: italic;
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    line-height: 1.4;
    min-height: 1.3rem;
}

.employee-contact {
    border-top: 1px solid #ecf0f1;
    padding-top: 1rem;
    margin-top: 1rem;
}

.employee-contact p {
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    line-height: 1.4;
}

.employee-contact .dashicons {
    margin-right: 0.5rem;
    color: #50b848;
    font-size: 1rem;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.employee-contact a {
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.3s ease;
    word-break: break-word;
    hyphens: auto;
    flex: 1;
}

.employee-contact a:hover,
.employee-contact a:focus {
    color: #3498db;
    text-decoration: underline;
    outline: none;
}

.employee-contact a:focus {
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
    border-radius: 2px;
}

.no-employees-message {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 3rem 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 2rem 0;
}

/* Enhanced responsive design */
@media (max-width: 1200px) {
    .employee-manager-container {
        max-width: 100%;
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .employee-manager-container {
        padding: 0 0.75rem;
    }
    
    .employees-grid,
    .employees-grid.columns-1,
    .employees-grid.columns-2,
    .employees-grid.columns-3,
    .employees-grid.columns-4 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .department-section {
        margin-bottom: 2.5rem;
    }
    
    .department-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .employee-image {
        height: 400px;
    }
    
    .employee-info {
        padding: 1.25rem;
    }
    
    .employee-name {
        font-size: 1.2rem;
    }
    
    .employee-position {
        font-size: 0.9rem;
    }
    
    .employee-contact p {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .employee-manager-container {
        padding: 0 0.5rem;
    }
    
    .employees-grid {
        gap: 1.25rem;
    }
    
    .department-title {
        font-size: 1.3rem;
        padding-bottom: 8px;
        margin-bottom: 1.25rem;
    }
    
    .employee-image {
        height: 300px;
    }
    
    .employee-info {
        padding: 1rem;
    }
    
    .employee-name {
        font-size: 1.1rem;
        margin-bottom: 0.4rem;
    }
    
    .employee-position {
        font-size: 0.85rem;
        margin-bottom: 0.8rem;
    }
    
    .employee-contact {
        padding-top: 0.8rem;
        margin-top: 0.8rem;
    }
    
    .employee-contact p {
        font-size: 0.8rem;
        margin: 0.4rem 0;
    }
    
    .employee-contact .dashicons {
        font-size: 0.9rem;
        width: 18px;
        height: 18px;
    }
    
    .no-employees-message {
        padding: 2rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 320px) {
    .employee-manager-container {
        padding: 0 0.25rem;
    }
    
    .employee-image {
        height: 180px;
    }
    
    .employee-info {
        padding: 0.8rem;
    }
    
    .department-title {
        font-size: 1.2rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .employee-card {
        border: 2px solid #000;
        box-shadow: none;
    }
    
    .employee-card:hover {
        box-shadow: 0 0 0 3px #000;
        transform: none;
    }
    
    .employee-contact a {
        text-decoration: underline;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .employee-card,
    .employee-photo,
    .employee-contact a {
        transition: none;
    }
    
    .employee-card:hover {
        transform: none;
    }
    
    .employee-card:hover .employee-photo {
        transform: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .employee-card {
        background: #2c3e50;
        border-color: #34495e;
    }
    
    .employee-info {
        background: #2c3e50;
    }
    
    .employee-name {
        color: #ecf0f1;
    }
    
    .employee-position {
        color: #bdc3c7;
    }
    
    .employee-contact {
        border-top-color: #34495e;
    }
    
    .employee-contact a {
        color: #ecf0f1;
    }
    
    .employee-contact a:hover,
    .employee-contact a:focus {
        color: #74b9ff;
    }
    
    .department-title {
        color: #ecf0f1;
        border-bottom-color: #74b9ff;
    }
    
    .no-employees-message {
        background: #34495e;
        color: #bdc3c7;
    }
}

/* Print styles */
@media print {
    .employee-manager-container {
        max-width: none;
        padding: 0;
    }
    
    .employees-grid,
    .employees-grid.columns-1,
    .employees-grid.columns-2,
    .employees-grid.columns-3,
    .employees-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        break-inside: avoid;
    }
    
    .employee-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 1rem;
    }
    
    .employee-card:hover {
        transform: none;
        box-shadow: none;
    }
    
    .employee-image {
        height: 150px;
    }
    
    .employee-info {
        padding: 1rem;
    }
    
    .department-title {
        color: #000;
        border-bottom-color: #000;
        page-break-after: avoid;
    }
    
    .department-section {
        page-break-inside: avoid;
    }
}

/* Focus management for accessibility */
.employee-card:focus-within {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Loading state (if needed for future enhancements) */
.employee-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.employee-card.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}