* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    padding: 40px 20px;
    color: #001f3f;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    text-align: center;
    color: #001f3f;
    margin-bottom: 50px;
    animation: fadeIn 0.6s ease-in;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0, 31, 63, 0.1);
    letter-spacing: 1px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.header-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #001f3f;
    padding: 60px 20px;
}

.spinner {
    border: 4px solid rgba(0, 31, 63, 0.2);
    border-top-color: #001f3f;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

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

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

@keyframes blurUp {
    from {
        opacity: 0;
        filter: blur(20px) brightness(0.8);
    }
    to {
        opacity: 1;
        filter: blur(0) brightness(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    animation: fadeIn 0.6s ease-in;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    color: #001f3f;
    padding: 60px 20px;
    font-size: 1.1rem;
    animation: slideUp 0.4s ease-out;
}

.team-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 31, 63, 0.1);
    border: 2px solid #e0e8f0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
                box-shadow 0.3s ease,
                background 0.3s ease,
                border-color 0.3s ease;
    animation: slideUp 0.6s ease-out;
    cursor: pointer;
    position: relative;
    margin: 0;
    padding: 0;
}

.team-card::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;
    pointer-events: none;
}

.team-card:hover::before {
    left: 100%;
}

.team-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 31, 63, 0.2);
    border-color: #001f3f;
}

.team-card-image {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #e0e8f0 0%, #f0f4f8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    line-height: 0;
    min-height: 320px;
}

.team-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
                filter 0.5s ease,
                opacity 0.5s ease;
    opacity: 0;
    display: block;
    margin: 0;
    padding: 0;
    border: none;
}

/* Loading state: show shimmer animation */
.team-card-img.loading {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.1) 25%, rgba(0, 0, 0, 0.05) 50%, rgba(0, 0, 0, 0.1) 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    filter: blur(20px);
}

/* Loaded state: reveal with blur-up effect */
.team-card-img.loaded {
    opacity: 1;
    filter: blur(0);
    animation: blurUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Error state: hide the broken image */
.team-card-img.load-error {
    display: none;
}

.team-card:hover .team-card-img {
    transform: scale(1.08) rotate(0.5deg);
}

.image-fallback {
    width: 100%;
    height: 100%;
    background: #e0e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    color: #7fa3c0;
    font-weight: bold;
}

.team-card-co30ent {
    padding: 25px 20px;
}

.team-card-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: #001f3f;
    margin-bottom: 5px;
}

.team-card-role {
    font-size: 0.95rem;
    color: #003d6b;
    font-weight: 500;
    margin-bottom: 12px;
}

.team-card-bio {
    font-size: 0.9rem;
    color: #556b7f;
    line-height: 1.5;
    margin-bottom: 15px;
}

.team-card-contact {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.contact-badge {
    display: inline-block;
    background: #e8f0f8;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #001f3f;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid #c5d9e8;
}

.contact-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(102, 126, 234, 0.1);
    transition: left 0.3s ease;
    z-index: -1;
}

.contact-badge:hover {
    background: #001f3f;
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 31, 63, 0.3);
    border-color: #001f3f;
}

.contact-badge:hover::before {
    left: 100%;
}

.contact-badge:active {
    transform: translateY(-1px);
}

.error {
    background: #fee;
    color: #c41e3a;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    font-size: 1.1rem;
    box-shadow: 0 10px 30px rgba(0, 31, 63, 0.1);
    border: 1px solid #ffb3b3;
}


.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-refresh {
    background: linear-gradient(135deg, #001f3f 0%, #003d6b 100%);
    color: #ffffff;
    border: none;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 20px rgba(0, 31, 63, 0.25);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.btn-refresh:hover {
    background: linear-gradient(135deg, #003d6b 0%, #005a99 100%);
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 31, 63, 0.35);
}

.btn-refresh:active {
    transform: scale(0.98);
}

.btn-refresh:hover svg,
.btn-refresh:hover .refresh-icon {
    animation: spin 0.6s linear;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
    background: #001f3f;
    color: #ffffff;
    font-weight: 600;
}

.btn-small:hover {
    background: #003d6b;
}

.btn:active {
    transform: scale(0.98);
}

/* ============================================
   FILTERS & SEARCH
   ============================================ */

.filters-container {
    background: #ffffff;
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #e0e8f0;
    animation: slideDown 0.4s ease;
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.filters-wrapper {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid #c5d9e8;
    border-radius: 8px;
    background: #f8f9fa;
    color: #001f3f;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.search-box::placeholder {
    color: #7fa3c0;
}

.search-box:focus {
    outline: none;
    background: #ffffff;
    border-color: #001f3f;
    box-shadow: 0 0 15px rgba(0, 31, 63, 0.2), 
                inset 0 0 10px rgba(0, 31, 63, 0.05);
    transform: scale(1.02);
}

.role-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.role-badge {
    padding: 6px 14px;
    background: #e8f0f8;
    border: 2px solid #c5d9e8;
    color: #001f3f;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.role-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.3s ease;
    z-index: -1;
}

.role-badge:hover {
    background: #001f3f;
    color: #ffffff;
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 31, 63, 0.2);
}

.role-badge:hover::before {
    left: 100%;
}

.role-badge.active {
    background: #001f3f;
    color: #ffffff;
    border-color: #001f3f;
    box-shadow: 0 5px 15px rgba(0, 31, 63, 0.3);
    font-weight: 600;
}

/* ============================================
   TEAM STATS
   ============================================ */

.team-stats {
    text-align: center;
    color: #001f3f;
    margin-top: 50px;
    padding: 20px;
    border-top: 2px solid #e0e8f0;
    font-size: 1.1rem;
}

.team-stats p {
    margin: 0;
}

#memberCount {
    font-weight: bold;
    font-size: 1.3rem;
}

/* ============================================
   MODAL - Profile Popup
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 31, 63, 0.1);
    border: none;
    font-size: 2rem;
    color: #001f3f;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background: rgba(0, 31, 63, 0.2);
    transform: rotate(90deg) scale(1.1);
}

.modal-header {
    height: 300px;
    background: linear-gradient(135deg, #e8f0f8 0%, #f0f4f8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.modal-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 31, 63, 0.2);
    border: 5px solid #001f3f;
    position: relative;
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s backwards;
}

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

.image-fallback-modal {
    width: 100%;
    height: 100%;
    background: #e0e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    color: #7fa3c0;
    font-weight: bold;
}

.modal-body {
    padding: 40px;
}

.modal-name {
    font-size: 2rem;
    font-weight: 700;
    color: #001f3f;
    margin-bottom: 8px;
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s backwards;
}

.modal-role {
    font-size: 1.1rem;
    color: #003d6b;
    font-weight: 600;
    margin-bottom: 25px;
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s backwards;
}

.modal-section {
    margin-bottom: 25px;
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s backwards;
}

.modal-section h3 {
    font-size: 1rem;
    color: #001f3f;
    margin-bottom: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-bio {
    font-size: 0.95rem;
    color: #556b7f;
    line-height: 1.6;
    margin: 0;
}

.modal-contact {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f0f4f8;
    border-radius: 8px;
    text-decoration: none;
    color: #001f3f;
    border: 1px solid #c5d9e8;
    transition: all 0.3s ease;
}

.contact-item:hover {
    background: #001f3f;
    color: #ffffff;
    border-color: #001f3f;
    transform: translateX(5px);
}

.modal-social {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: #e8f0f8;
    border: 1px solid #c5d9e8;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.2rem;
    color: #001f3f;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.social-link:hover {
    background: #001f3f;
    color: #ffffff;
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 31, 63, 0.3);
    border-color: #001f3f;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .team-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }

    .team-card {
        animation: slideUp 0.5s ease-out;
    }

    .btn-refresh {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 20px 10px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .team-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .team-card {
        animation: slideUp 0.4s ease-out;
    }

    .filters-wrapper {
        gap: 10px;
    }

    .search-box {
        min-width: 100%;
        padding: 10px 14px;
    }

    .contact-badge {
        font-size: 0.8rem;
        padding: 4px 10px;
    }

    /* Modal responsive */
    .modal {
        padding: 10px;
    }

    .modal-content {
        max-height: 95vh;
    }

    .modal-header {
        height: 250px;
    }

    .modal-image {
        width: 150px;
        height: 150px;
        border-width: 4px;
    }

    .modal-body {
        padding: 25px 20px;
    }

    .modal-name {
        font-size: 1.5rem;
    }

    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
}

/* Accessibility & Touch Optimization */
@media (hover: none) and (pointer: coarse) {
    .team-card:hover {
        transform: translateY(-5px) scale(1.01);
    }

    .contact-badge:hover {
        transform: translateY(-2px);
    }

    .btn:hover {
        transform: scale(1.02);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .team-card-content {
        background: #f5f5f5;
    }

    .team-card-name {
        color: #222;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
