/**
 * Officials Slider Styles - Modern Swiper.js Implementation
 * Mobile-first, responsive, accessible design
 */

/* Section Container */
.officials-slider-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    position: relative;
    padding: 4rem 0;
    overflow: visible; /* Allow arrows to be visible outside */
}

/* Section Heading */
.section-heading {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInUp 0.6s ease-out;
}

.section-badge {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: white;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.2);
}

.section-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.section-subtitle {
    font-size: 1.125rem;
    color: #6c757d;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Swiper Container */
.officials-swiper {
    width: 100%;
    padding: 2rem 0 3rem; /* Remove horizontal padding */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    position: relative;
}

.officials-swiper.in-view {
    opacity: 1;
    transform: translateY(0);
}

.swiper-wrapper {
    align-items: stretch; /* Ensure all slides have same height */
}

.swiper-slide {
    height: auto; /* Allow slide to match card height */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Staff Card */
.staff-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 380px; /* Fixed height for consistency */
    width: 100%; /* Full width of swiper slide */
    max-width: 320px; /* Maximum card width */
    margin: 0 auto; /* Center card in slide */
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.staff-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0d6efd 0%, #0a58ca 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.staff-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.staff-card:hover::before {
    transform: scaleX(1);
}

/* Staff Avatar */
.staff-avatar {
    width: 100px; /* Slightly smaller for better fit */
    height: 100px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid #f8f9fa;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: transform 0.3s ease;
    flex-shrink: 0; /* Prevent avatar from shrinking */
}

.staff-card:hover .staff-avatar {
    transform: scale(1.05);
}

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

/* Staff Info */
.staff-name {
    font-size: 1.125rem; /* Slightly smaller for consistency */
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    min-height: 2.6rem; /* Fixed height for 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.staff-position {
    font-size: 0.9375rem; /* Slightly smaller */
    font-weight: 600;
    color: #0d6efd;
    margin-bottom: 0.5rem;
    min-height: 2.4rem; /* Fixed height for 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.staff-department {
    font-size: 0.8125rem; /* Slightly smaller */
    color: #6c757d;
    margin-bottom: 1rem;
    min-height: 2.4rem; /* Fixed height for 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.staff-bio {
    font-size: 0.8125rem; /* Smaller font */
    color: #495057;
    line-height: 1.5;
    margin-bottom: 1rem;
    min-height: 3rem; /* Fixed height for 2 lines */
    max-height: 3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Contact Button */
.staff-contact {
    margin-top: auto; /* Push to bottom */
    padding-top: 0.5rem;
}

.staff-contact .btn {
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.staff-contact .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* Swiper Navigation - Rounded square buttons */
.swiper-button-prev,
.swiper-button-next {
    width: 48px;
    height: 48px;
    background: #2b3c6b; /* Dark blue background */
    border-radius: 8px; /* Rounded square instead of circle */
    box-shadow: 0 4px 16px rgba(43, 60, 107, 0.3);
    transition: all 0.3s ease;
    top: 50%;
    margin-top: 0;
    transform: translateY(-50%);
    z-index: 10;
}

.swiper-button-prev {
    left: 10px; /* Position inside the container */
}

.swiper-button-next {
    right: 10px; /* Position inside the container */
}

/* Remove default Swiper arrows and use Font Awesome icons */
.swiper-button-prev:after,
.swiper-button-next:after {
    content: '';
    display: none;
}

.swiper-button-prev::before,
.swiper-button-next::before {
    font-family: 'Font Awesome 5 Free', 'Font Awesome 6 Free', 'FontAwesome';
    font-weight: 900;
    font-size: 20px;
    color: white; /* White icons on dark blue background */
    display: flex;
    align-items: center;
    justify-content: center;
}

.swiper-button-prev::before {
    content: '\f053'; /* fa-chevron-left */
}

.swiper-button-next::before {
    content: '\f054'; /* fa-chevron-right */
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background: #1f2d4d; /* Darker blue on hover */
    transform: translateY(-50%) scale(1.05); /* Slightly smaller scale for square */
    box-shadow: 0 6px 20px rgba(43, 60, 107, 0.4);
}

.swiper-button-prev:hover::before,
.swiper-button-next:hover::before {
    color: white; /* Keep white on hover */
}

.swiper-button-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Swiper Pagination */
.swiper-pagination {
    bottom: 0 !important;
    padding: 1rem 0;
}

.swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #cbd5e0;
    opacity: 1;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    background: #0d6efd;
    width: 24px;
    border-radius: 5px;
}

.swiper-pagination-bullet:hover {
    background: #0a58ca;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive (up to 575px) */
@media (max-width: 575px) {
    .officials-slider-section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .officials-swiper {
        padding: 2rem 0 3rem; /* No horizontal padding on mobile */
    }

    .staff-card {
        padding: 1.5rem 1rem; /* Adjusted padding */
        height: 340px; /* Fixed height for mobile */
        max-width: 280px; /* Limit card width on mobile */
        margin: 0 auto; /* Center the card */
    }

    .staff-avatar {
        width: 80px; /* Reduced from 100px */
        height: 80px;
        margin-bottom: 1rem; /* Reduced spacing */
    }

    .staff-name {
        font-size: 1rem; /* Reduced from 1.125rem */
        margin-bottom: 0.25rem;
        min-height: 2.4rem; /* Maintain fixed height */
    }

    .staff-position {
        font-size: 0.875rem; /* Slightly smaller */
        margin-bottom: 0.25rem;
        min-height: 2.2rem; /* Maintain fixed height */
    }

    .staff-department {
        font-size: 0.75rem; /* Smaller department text */
        margin-bottom: 0.75rem;
        min-height: 2.2rem; /* Maintain fixed height */
    }
    
    .staff-bio {
        font-size: 0.75rem;
        min-height: 2.8rem;
        max-height: 2.8rem;
        margin-bottom: 0.75rem;
    }

    .staff-bio {
        font-size: 0.8rem; /* Smaller bio text */
        margin-bottom: 1rem;
    }

    /* Show navigation arrows on mobile with smaller size */
    .swiper-button-prev,
    .swiper-button-next {
        width: 36px; /* Smaller buttons for mobile */
        height: 36px;
        display: flex; /* Show arrows on mobile */
    }

    .swiper-button-prev {
        left: 5px; /* Closer to edge */
    }

    .swiper-button-next {
        right: 5px; /* Closer to edge */
    }

    .swiper-button-prev::before,
    .swiper-button-next::before {
        font-size: 16px; /* Smaller icon */
    }
}

/* Tablet (576px - 991px) */
@media (min-width: 576px) and (max-width: 991px) {
    .section-title {
        font-size: 2rem;
    }

    .staff-avatar {
        width: 110px;
        height: 110px;
    }

    .swiper-button-prev {
        left: 5px;
    }

    .swiper-button-next {
        right: 5px;
    }
}

/* Desktop (992px and up) */
@media (min-width: 992px) {
    .officials-slider-section {
        padding: 5rem 0;
    }

    .section-heading {
        margin-bottom: 4rem;
    }
}

/* Accessibility - High Contrast Mode */
@media (prefers-contrast: high) {
    .staff-card {
        border: 2px solid #000;
    }

    .section-badge {
        border: 2px solid #fff;
    }

    .swiper-button-prev,
    .swiper-button-next {
        border: 2px solid #0d6efd;
    }
}

/* Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .officials-swiper,
    .staff-card,
    .staff-avatar,
    .swiper-button-prev,
    .swiper-button-next,
    .swiper-pagination-bullet {
        transition: none;
        animation: none;
    }

    .staff-card:hover {
        transform: none;
    }

    .officials-swiper.in-view {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .officials-slider-section {
        padding: 2rem 0;
        background: white;
    }

    .swiper-button-prev,
    .swiper-button-next,
    .swiper-pagination {
        display: none;
    }

    .staff-card {
        box-shadow: none;
        border: 1px solid #dee2e6;
        page-break-inside: avoid;
    }
}

/* Loading State */
.officials-swiper:not(.swiper-initialized) {
    opacity: 0.5;
}

.officials-swiper:not(.swiper-initialized) .staff-card {
    pointer-events: none;
}

/* Focus Styles for Accessibility */
.staff-card:focus-within {
    outline: 3px solid #0d6efd;
    outline-offset: 4px;
}

.swiper-button-prev:focus,
.swiper-button-next:focus,
.swiper-pagination-bullet:focus {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
}
