/* Member Card Styles */
.member-card {
    background-color: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    min-height: 350px;
    max-width: 400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.member-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Top Section */
.member-card-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e8ddd4;
}

.member-photo-container {
    position: relative;
    flex-shrink: 0;
}

.member-photo,
.member-photo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.member-photo-placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
}

.online-status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background-color: #51cf66;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.member-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.member-name {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 0.25rem 0;
    color: #2d2720;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.member-title {
    font-size: 14px;
    color: #8b7355;
    margin: 0;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Middle Section */
.member-card-middle {
    margin-bottom: 1.5rem;
    flex: 1;
}

.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
}

.skill-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.skill-badge-technical {
    background-color: #e3f2fd;
    color: #1976d2;
}

.skill-badge-business {
    background-color: #e8f5e9;
    color: #388e3c;
}

.skill-badge-creative {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.view-all-skills-link {
    font-size: 0.875rem;
    color: #0d6efd;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.view-all-skills-link:hover {
    color: #0a58ca;
    text-decoration: underline;
}

.experience-level-badge {
    margin-bottom: 0.75rem;
}

.rating-container {
    margin-bottom: 0.75rem;
}

.star-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.star-rating i {
    color: #ffc107;
    font-size: 1rem;
}

.star-rating .bi-star {
    color: #dee2e6;
}

.rating-value {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
}

.collaborations-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.collaborations-count i {
    color: #0d6efd;
}

/* Bottom Section */
.member-card-bottom {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #e8ddd4;
    flex-shrink: 0;
}

.member-bio {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0 0 1rem 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.625rem;
}

.member-card-actions {
    display: flex;
    gap: 0.75rem;
    flex-direction: column;
}

.member-card-btn {
    width: 100%;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

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

.member-card-btn .btn-spinner {
    display: inline-flex;
    align-items: center;
}

/* Ripple Effect */
.member-card-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.member-card-btn.ripple::before {
    width: 300px;
    height: 300px;
}

/* Dark Theme Support */
body.dark-theme .member-card {
    background-color: #2d2d2d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-theme .member-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

body.dark-theme .member-card-top {
    border-bottom-color: #404040;
}

body.dark-theme .member-name {
    color: #e0e0e0;
}

body.dark-theme .member-title {
    color: #a0a0a0;
}

body.dark-theme .skill-badge-technical {
    background-color: rgba(77, 171, 247, 0.2);
    color: #74c0fc;
}

body.dark-theme .skill-badge-business {
    background-color: rgba(51, 207, 102, 0.2);
    color: #51cf66;
}

body.dark-theme .skill-badge-creative {
    background-color: rgba(153, 102, 255, 0.2);
    color: #9775fa;
}

body.dark-theme .member-card-bottom {
    border-top-color: #404040;
}

body.dark-theme .member-bio {
    color: #a0a0a0;
}

body.dark-theme .rating-value {
    color: #a0a0a0;
}

body.dark-theme .collaborations-count {
    color: #a0a0a0;
}

/* Responsive Design */
@media (min-width: 768px) {
    .member-card-actions {
        flex-direction: row;
    }
    
    .member-card-btn {
        flex: 1;
    }
}

@media (max-width: 767.98px) {
    .member-card {
        max-width: 100%;
        min-height: auto;
        height: auto;
        padding: 1rem;
        margin-bottom: 1rem;
        /* Keep overflow: hidden for border-radius, but ensure card can grow */
    }
    
    .member-card-top {
        gap: 0.75rem;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
    
    .member-photo-container {
        flex-shrink: 0;
    }
    
    .member-photo,
    .member-photo-placeholder {
        width: 60px;
        height: 60px;
        font-size: 1.25rem;
    }
    
    .online-status-indicator {
        width: 14px;
        height: 14px;
        border-width: 2px;
        bottom: 1px;
        right: 1px;
    }
    
    .member-name {
        font-size: 16px;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .member-title {
        font-size: 13px;
        line-height: 1.3;
        -webkit-line-clamp: 2;
    }
    
    .member-card-middle {
        margin-bottom: 1rem;
    }
    
    .skills-container {
        gap: 0.375rem;
        margin-bottom: 0.75rem;
    }
    
    .skill-badge {
        padding: 0.25rem 0.625rem;
        font-size: 0.8125rem;
    }
    
    .experience-level-badge {
        margin-bottom: 0.5rem;
    }
    
    .experience-level-badge .badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    .rating-container {
        margin-bottom: 0.5rem;
    }
    
    .star-rating {
        gap: 0.125rem;
    }
    
    .star-rating i {
        font-size: 0.875rem;
    }
    
    .rating-value {
        margin-left: 0.375rem;
        font-size: 0.8125rem;
    }
    
    .collaborations-count {
        font-size: 0.8125rem;
        gap: 0.375rem;
    }
    
    .member-card-bottom {
        padding-top: 0.75rem;
        flex-shrink: 0;
        visibility: visible;
        display: block;
    }
    
    .member-card-actions {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .member-card-btn {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .member-bio {
        font-size: 0.8125rem;
        margin-bottom: 0.75rem;
        -webkit-line-clamp: 3;
        min-height: 3.65625rem;
        line-height: 1.4;
    }
    
    .member-card-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .member-card-btn {
        width: 100%;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .view-all-skills-link {
        font-size: 0.8125rem;
    }
}

/* Extra small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    .member-card {
        padding: 0.875rem;
        height: auto;
        /* Keep overflow: hidden for border-radius, but ensure card can grow */
    }
    
    .member-card-top {
        gap: 0.625rem;
        margin-bottom: 0.875rem;
        padding-bottom: 0.625rem;
    }
    
    .member-photo,
    .member-photo-placeholder {
        width: 56px;
        height: 56px;
        font-size: 1.125rem;
    }
    
    .member-name {
        font-size: 15px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .member-title {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
    
    .skills-container {
        gap: 0.25rem;
    }
    
    .skill-badge {
        padding: 0.2rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .member-bio {
        -webkit-line-clamp: 2;
        min-height: 2.5rem;
    }
}

/* Loading State */
.member-card-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.member-card-btn.loading .btn-text {
    display: none;
}

.member-card-btn.loading .btn-spinner {
    display: inline-flex !important;
}

