﻿.employees-section h2 {
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
    font-size: 2rem;
    font-weight: 300;
}

.employee-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.employee-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
}

    .employee-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    }

.employee-header {
    height: 100px;
    min-height: 100px;
    max-height: 100px;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
    padding: 10px;
    background: linear-gradient(135deg, #a3bffa, #d6bcfa);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

    .employee-header h3 {
        margin: 5px 0;
        font-size: 1.1rem;
        color: #2c3e50;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 95%;
    }

    .employee-header .photo-path {
        font-size: 0.75rem;
        color: #555;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 95%;
        line-height: 1.2;
    }

.image-container {
    position: relative;
    width: 100%;
    /* Keep a fixed height for consistent card appearance. */
    height: 196px;
    display: flex;
    justify-content: center;
    align-items: center;
    /* FIX: Ensure container is a hard boundary and flush with elements above/below */
    padding: 0;
    margin: 0;
    overflow: hidden; /* Crucial for cropping the excess image */
}

.employee-image {
    width: 100%;
    /* Set the height to match the container's height (196px) */
    height: 196px;
    /* THE FIX: Use 'cover' to stretch the image to fill the container entirely.
       It will maintain the aspect ratio and crop the parts that don't fit. */
    object-fit: cover;
    object-position: center;
    /* Remove the border at the bottom to ensure the image is flush with the footer */
    border-bottom: none;
    display: none;
}
    .employee-image.loaded {
        display: block;
    }

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

    .spinner.hidden {
        display: none;
    }

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.employee-footer {
    padding: 10px;
    text-align: center;
    width: 100%;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.btn {
    padding: 10px 20px;
    margin: 0 5px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.btn-primary {
    background: #007bff;
    color: white;
}

    .btn-primary:hover {
        background: #0056b3;
        transform: translateY(-1px);
    }

.btn-danger {
    background: #dc3545;
    color: white;
}

    .btn-danger:hover {
        background: #c82333;
        transform: translateY(-1px);
    }

/* Responsive styles for employee directory */
@media (max-width: 768px) {
    .employee-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .employee-header h3 {
        font-size: 1rem;
    }

    .employee-header .photo-path {
        font-size: 0.7rem;
    }

    .employee-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}
