/* Modern Staff Grid Design */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4cc9f0;
    --text-dark: #2b2d42;
    --text-light: #6c757d;
    --background-light: #f8f9fa;
    --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
    --hover-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.15);
    --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Staff Section */
.staff-section {
    padding: 80px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    min-height: 100vh;
}

/* Section Title with Design */
.section-title {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.main-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
    background: var(--gradient-bg);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.sub-title {
    font-size: 1.3rem;
    color: var(--text-light);
    margin-bottom: 25px;
    font-weight: 400;
    position: relative;
}

.title-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.decoration-line {
    width: 60px;
    height: 3px;
    background: var(--gradient-bg);
    border-radius: 3px;
}

.decoration-dot {
    width: 12px;
    height: 12px;
    background: var(--gradient-bg);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.7;
    }
}

/* Staff Grid Container */
.staff-grid-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Staff Grid Layout */
.staff-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(4, 1fr);
}

.staff-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.staff-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.staff-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Modern Staff Card */
.staff-card {
    background: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

.staff-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--hover-shadow);
}

/* Image Wrapper */
.staff-image-wrapper {
    position: relative;
    overflow: hidden;
}

.staff-image {
    width: 100%;
    height: 300px;
    overflow: hidden;
    position: relative;
}

.staff-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.staff-card:hover .staff-image::after {
    opacity: 1;
}

.staff-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.staff-card:hover .staff-image img {
    transform: scale(1.1) rotate(2deg);
}

/* Designation Badge - HIDDEN */
.staff-designation-badge {
    display: none !important;
}

/* Staff Info */
.staff-info {
    padding: 25px 20px;
    text-align: center;
    position: relative;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.staff-name {
    margin: 0 0 8px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    transition: color 0.3s ease;
}

.staff-card:hover .staff-name {
    color: var(--designation-color, var(--primary-color));
}

.staff-designation {
    margin: 0 0 15px;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.staff-designation i {
    font-size: 1rem;
    opacity: 0.8;
}

/* Social Icons */
.staff-social {
    margin: 15px 0;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.staff-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--background-light);
    color: var(--designation-color, var(--primary-color));
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 1rem;
}

.staff-social a:hover {
    background: var(--designation-color, var(--primary-color));
    color: white;
    transform: translateY(-3px) rotate(360deg);
}

/* View Profile Button - ALWAYS VISIBLE */
.view-profile-btn {
    padding: 12px 25px;
    background: var(--designation-color, var(--primary-color));
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    opacity: 1;
    transform: translateY(0);
    width: 100%;
    max-width: 160px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.view-profile-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
    z-index: -1;
}

.view-profile-btn:hover::before {
    left: 100%;
}

.view-profile-btn:hover {
    background: var(--designation-color, var(--primary-color));
    filter: brightness(1.1);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.view-profile-btn:active {
    transform: translateY(-1px) scale(0.98);
}

/* Remove hover visibility rule (no longer needed) */
.staff-card:hover .view-profile-btn {
    opacity: 1;
    transform: translateY(0);
}

/* Modern Popup Modal */
.staff-popup {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    overflow-y: auto;
}

.staff-popup.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.staff-popup-content {
    position: relative;
    background: white;
    margin: 30px auto;
    width: 95%;
    max-width: 1000px;
    border-radius: 30px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.staff-popup-close {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: var(--text-dark);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.staff-popup-close:hover {
    background: white;
    transform: rotate(90deg);
}

.staff-popup-body {
    position: relative;
}

/* Popup Content Layout */
.staff-popup-details {
    display: flex;
    gap: 40px;
    background: white;
}

/* Popup Image Section */
.staff-popup-image {
    flex: 0 0 350px;
    position: relative;
    overflow: hidden;
}

.staff-popup-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    z-index: 1;
}

.staff-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Popup Info Section */
.staff-popup-info {
    flex: 1;
    padding: 40px 40px 40px 0;
}

.staff-popup-info h2 {
    margin: 0 0 15px;
    color: var(--text-dark);
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.staff-popup-info .designation {
    color: var(--designation-color, var(--primary-color));
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--designation-color, var(--primary-color));
    display: inline-block;
}

.staff-popup-info .designation i {
    margin-right: 10px;
}

/* Info Grid */
.staff-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 25px 0;
}

.staff-detail-card {
    background: var(--background-light);
    padding: 20px;
    border-radius: 15px;
    transition: all 0.3s ease;
    border-left: 4px solid var(--designation-color, var(--primary-color));
}

.staff-detail-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.staff-detail-card strong {
    display: block;
    color: var(--text-dark);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.staff-detail-card strong i {
    margin-right: 8px;
    color: var(--designation-color, var(--primary-color));
}

.staff-detail-card .value {
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 500;
}

/* Description Section */
.staff-description {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9eef5 100%);
    border-radius: 15px;
}

.staff-description h3 {
    margin: 0 0 15px;
    color: var(--text-dark);
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.staff-description h3 i {
    color: var(--designation-color, var(--primary-color));
}

.staff-description p {
    color: var(--text-light);
    line-height: 1.8;
    margin: 0;
    font-size: 1rem;
}

/* Popup Social Links */
.staff-popup-social {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.staff-popup-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: var(--designation-color, var(--primary-color));
    color: white;
    border-radius: 50%;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.staff-popup-social a:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Loading Animation */
.staff-popup .loading {
    text-align: center;
    padding: 60px;
}

.staff-popup .spinner {
    display: inline-block;
    width: 60px;
    height: 60px;
    border: 4px solid rgba(67, 97, 238, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 60px;
}

.error-message i {
    font-size: 4rem;
    color: #dc3545;
    margin-bottom: 20px;
}

.retry-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 35px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.retry-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* No Staff Message */
.no-staff {
    text-align: center;
    padding: 60px;
    font-size: 1.2rem;
    color: var(--text-light);
    background: white;
    border-radius: 15px;
    margin: 40px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .staff-grid.columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .main-title {
        font-size: 3rem;
    }
    
    .staff-grid.columns-3,
    .staff-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .staff-popup-details {
        flex-direction: column;
    }
    
    .staff-popup-image {
        flex: 0 0 300px;
    }
    
    .staff-popup-info {
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }
    
    .sub-title {
        font-size: 1.1rem;
    }
    
    .staff-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px;
    }
    
    .staff-image {
        height: 250px;
    }
    
    .staff-popup-content {
        margin: 20px;
    }
    
    .staff-popup-info h2 {
        font-size: 2rem;
    }
    
    .staff-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .view-profile-btn {
        max-width: 140px;
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 2rem;
    }
    
    .staff-grid {
        grid-template-columns: 1fr !important;
    }
    
    .staff-popup-content {
        margin: 10px;
    }
    
    .staff-popup-info {
        padding: 20px;
    }
    
    .staff-popup-info h2 {
        font-size: 1.6rem;
    }
    
    .staff-popup-image {
        flex: 0 0 200px;
    }
    
    .view-profile-btn {
        max-width: 130px;
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

/* Animation Keyframes */
@keyframes slideDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(50px);
    }
}