/* TL2 Staff Manager - Modern Responsive Frontend Styles */

.tl2-staff-wrapper {
    width: 100%;
    margin: 20px 0 40px 0;
    font-family: inherit;
}

/* Filter Bar */
.tl2-staff-filter-bar {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #eef2f6;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tl2-staff-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 1px solid #f0f2f5;
    padding-bottom: 12px;
}

.tl2-tab-btn {
    background: #f1f5f9;
    color: #475569;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tl2-tab-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.tl2-tab-btn.active {
    background: linear-gradient(135deg, #1877f2 0%, #0056b3 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

.tl2-staff-subfilters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
}

.tl2-filter-group {
    flex: 1;
    min-width: 220px;
}

.tl2-staff-select,
.tl2-staff-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    background-color: #f8fafc;
    color: #1e293b;
    transition: all 0.2s ease;
}

.tl2-staff-select:focus,
.tl2-staff-input:focus {
    outline: none;
    border-color: #1877f2;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.15);
}

/* Staff Swiper & Card Container */
.tl2-staff-wrapper {
    position: relative;
    width: 100%;
    padding: 0 18px;
    box-sizing: border-box;
}

.tl2-staff-swiper {
    position: relative;
    padding: 10px 4px 20px 4px !important;
    overflow: hidden;
}

.tl2-staff-swiper .swiper-slide {
    height: auto;
    display: flex;
    box-sizing: border-box;
}

/* Fallback before Swiper JS initializes */
.tl2-staff-swiper:not(.swiper-initialized) .swiper-wrapper {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 16px !important;
    overflow-x: auto;
}

.tl2-staff-swiper:not(.swiper-initialized) .swiper-slide {
    width: calc((100% - 64px) / 5) !important;
    min-width: calc((100% - 64px) / 5) !important;
    flex: 0 0 calc((100% - 64px) / 5) !important;
}

@media (max-width: 1023px) {
    .tl2-staff-swiper:not(.swiper-initialized) .swiper-slide {
        width: calc((100% - 48px) / 4) !important;
        min-width: calc((100% - 48px) / 4) !important;
        flex: 0 0 calc((100% - 48px) / 4) !important;
    }
}

@media (max-width: 767px) {
    .tl2-staff-swiper:not(.swiper-initialized) .swiper-slide {
        width: calc((100% - 12px) / 2) !important;
        min-width: calc((100% - 12px) / 2) !important;
        flex: 0 0 calc((100% - 12px) / 2) !important;
    }
}

.tl2-staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.tl2-staff-card {
    width: 100%;
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.tl2-staff-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

/* Swiper Navigation Buttons */
.tl2-swiper-btn-prev,
.tl2-swiper-btn-next {
    width: 40px !important;
    height: 40px !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 50% !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14) !important;
    color: #0284c7 !important;
    transition: all 0.25s ease !important;
    z-index: 25 !important;
    top: 50% !important;
    margin-top: -20px !important;
}

.tl2-swiper-btn-prev:after,
.tl2-swiper-btn-next:after {
    font-size: 16px !important;
    font-weight: 800 !important;
}

.tl2-swiper-btn-prev:hover,
.tl2-swiper-btn-next:hover {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.35) !important;
}

.tl2-swiper-btn-prev {
    left: -2px !important;
}

.tl2-swiper-btn-next {
    right: -2px !important;
}

@media (max-width: 768px) {
    .tl2-staff-wrapper {
        padding: 0 8px;
    }
    .tl2-swiper-btn-prev {
        left: -4px !important;
    }
    .tl2-swiper-btn-next {
        right: -4px !important;
    }
    .tl2-staff-card-header {
        padding: 12px 6px 8px 6px;
    }
    .tl2-staff-avatar {
        width: 100%;
        max-width: 110px;
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
        border-radius: 50% !important;
    }
    .tl2-avatar-placeholder {
        font-size: 50px;
    }
    .tl2-staff-card-body {
        padding: 8px 6px 12px 6px;
    }
    .tl2-staff-name {
        font-size: 13.5px !important;
    }
    .tl2-staff-position {
        font-size: 11.5px;
        padding: 2px 6px;
    }
    .tl2-staff-extra-text {
        font-size: 13px;
    }
}

/* Card Header */
.tl2-staff-card-header {
    background: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);
    padding: 18px 12px 12px 12px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid #f1f5f9;
}

.tl2-staff-avatar {
    width: 168px;
    height: auto;
    max-width: 92%;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    background: #ffffff;
}

.tl2-staff-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tl2-staff-card:hover .tl2-staff-avatar img {
    transform: scale(1.08);
}

.tl2-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 70px;
    background: #eef2f6;
}

/* Card Body & Spacing Optimization */
.tl2-staff-card-body {
    padding: 12px 10px 16px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.tl2-staff-name {
    font-size: 16px !important;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 2px 0 !important;
    text-align: center;
    line-height: 1.25 !important;
}

.tl2-staff-position {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #0284c7;
    background: #e0f2fe;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block;
    margin: 1px 0 !important;
    line-height: 1.25 !important;
}

.tl2-staff-extra-text {
    font-size: 15px;
    color: #475569;
    background: transparent;
    border: none;
    padding: 0;
    margin: 2px 0 0 0 !important;
    line-height: 1.3 !important;
    text-align: center;
}

.tl2-staff-meta-item {
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
    word-break: break-all;
}

.tl2-staff-meta-item a {
    color: #0284c7;
    text-decoration: none;
}

.tl2-staff-meta-item a:hover {
    text-decoration: underline;
}

/* Card Footer */
.tl2-staff-card-footer {
    padding: 12px 16px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}

.tl2-staff-btn-detail {
    width: 100%;
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tl2-staff-btn-detail:hover {
    background: #1877f2;
    color: #ffffff;
    border-color: #1877f2;
    box-shadow: 0 4px 10px rgba(24, 119, 242, 0.25);
}

/* Empty State */
.tl2-staff-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
    color: #64748b;
}

.tl2-staff-empty .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
}

/* Modal Popup Styles */
.tl2-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: tl2FadeIn 0.25s ease-out;
}

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

.tl2-modal-container {
    background: #ffffff;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow-y: auto;
    animation: tl2SlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.tl2-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 34px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.tl2-modal-close:hover {
    background: #ef4444;
    color: #ffffff;
}

.tl2-modal-content {
    padding: 28px;
}

/* Modal Internal Profile */
.tl2-modal-header-top {
    display: flex;
    gap: 20px;
    align-items: center;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.tl2-modal-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 3px solid #1877f2;
}

.tl2-modal-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tl2-modal-title-info h2 {
    margin: 0 0 8px 0;
    font-size: 22px;
    color: #0f172a;
}

.tl2-modal-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 6px;
    margin-bottom: 4px;
}

.tl2-modal-badge.position {
    background: #0284c7;
    color: #ffffff;
}

.tl2-modal-badge.campus {
    background: #e0f2fe;
    color: #0369a1;
}

.tl2-staff-detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.tl2-staff-detail-table th {
    text-align: left;
    width: 35%;
    padding: 8px 10px;
    color: #64748b;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.tl2-staff-detail-table td {
    padding: 8px 10px;
    color: #1e293b;
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.tl2-modal-section {
    margin-top: 20px;
    background: #f8fafc;
    padding: 16px;
    border-radius: 10px;
    border-left: 4px solid #1877f2;
}

.tl2-modal-section h3 {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tl2-modal-section-content {
    font-size: 14px;
    color: #334155;
    line-height: 1.6;
}
